Vehicle-mounted diagnosis method, device and system
Patent Information
- Application Number
- CN202280094801.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-24
- Publication Date
- 2024-11-29
AI Technical Summary
In vehicle diagnostics, when concurrent and mutually exclusive diagnostic scenarios exist, existing technologies have failed to effectively standardize concurrent diagnostic processes and preemptive diagnostic processes, resulting in chaotic diagnostic processes and inaccurate diagnostic results.
Introducing an on-board diagnostic mutual exclusion protocol, the system manages sessions through a diagnostic agent device, performing session management operations such as establishing, preempting, releasing, and querying session status, thereby improving the concurrent and mutual exclusion diagnostic processes and enhancing the reliability of on-board diagnostics.
In concurrent and mutually exclusive diagnostic scenarios, it improves the reliability and efficiency of on-board diagnostics and ensures the normal operation of the diagnostic channel.
Smart Images

Figure CN119053926A_ABST
Abstract
Description
On-board diagnostic method, device and system Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an on-board diagnostic method, device, and system. Background Art
[0002] With the large-scale application of mobile 5G and the development of in-vehicle communication technology, diagnostic technology for the entire vehicle is gradually being improved, allowing users and original equipment manufacturers (OEMs) to take effective safety protection measures in a timely manner, while providing effective vehicle fault data for vehicle return repairs.
[0003] At present, based on at least two diagnostic methods or at least two diagnostic protocols supported by the entire vehicle, there can be at least two diagnostic channels for on-board diagnosis, such as a diagnostic channel based on a remote diagnostic tool and a diagnostic channel based on a proximal diagnostic tool; for example, a diagnostic channel based on the diagnostic technology of on-board Ethernet for diagnostic communication (diagnostic communicate over internet protocol, DoIP), a diagnostic channel based on the diagnostic technology of on-board controller area network (CAN) for diagnostic communication (diagnose over cAN, DoCAN), etc.
[0004] Among them, when at least two diagnostic channels work at the same time, concurrent diagnosis situations (for example, different diagnostic devices initiate diagnostic requests to different target objects) or diagnostic mutual exclusion (for example, different diagnostic devices initiate diagnostic requests to the same target object) will occur. It is necessary to formulate rules for mutual exclusion and preemption to regulate the concurrent diagnosis process and preemptive diagnosis process based on each diagnostic channel.
[0005] Summary of the Invention
[0006] The present application provides an on-board diagnostic method, device, and system, which helps to improve the concurrent diagnostic process and preemptive diagnostic process based on each diagnostic channel in scenarios where concurrent diagnosis or mutually exclusive diagnosis exist, thereby improving the reliability of on-board diagnosis.
[0007] In a first aspect, an embodiment of the present application provides an on-board diagnostic method, which can be executed by a diagnostic agent device on a vehicle. For ease of distinction, in the embodiment of the first aspect, the diagnostic agent device can be represented as a first diagnostic agent device, which can be a vehicle interface unit (VIU) configured with an on-board gateway chip. The on-board gateway chip can, for example, include at least one of the following: an Ethernet switch chip, a CAN protocol switch chip, an IP protocol switch chip, etc., or the on-board gateway chip can also include a chip that supports protocols corresponding to other wired transmission media, or can also include a chip that supports protocols corresponding to other wireless transmission technologies.
[0008] The method may include: a first diagnostic agent device receiving a diagnostic request message from a diagnostic device, wherein the diagnostic request message is used to request diagnosis of a target object, the diagnostic request message includes mutually exclusive attribute information of a first session, and the first session is associated with a first diagnostic channel between the diagnostic device; performing a session management operation according to the mutually exclusive attribute information of the first session; and sending a diagnostic response message to the diagnostic device, wherein the diagnostic response message is used to indicate a session management result.
[0009] Through the above method, the first diagnostic agent device can perform session management operations based on the mutually exclusive attribute information carried in the diagnostic request message, and through the management of the session, it can realize the management of the diagnostic channel associated with the session, so as to provide a more complete method for executing concurrent diagnostic processes or mutually exclusive diagnostic processes in concurrent diagnostic scenarios or mutually exclusive diagnostic scenarios, thereby improving the reliability of on-board diagnosis.
[0010] With reference to the first aspect, in a possible implementation, the session management operation includes any one of the following operations: establishing a session, seizing a session, releasing a session, or querying a session status.
[0011] In an embodiment of the present application, when at least two diagnostic channels are diagnosing the same target object, there is a conflict in the sessions associated with the at least two diagnostic channels. The session establishment operation may refer to an operation of directly establishing a new session when the new session to be established does not conflict with the established session. The session preemption operation may refer to a situation where the new session to be established conflicts with the established session, through the session preemption operation, the new session can preempt the diagnostic channel associated with the conflicting session to perform the diagnostic process. The session release operation may refer to releasing the established session. Querying the session status may refer to querying the status of the relevant sessions maintained by the first diagnostic agent device side, including whether the session is in the initial state, working state, exit state or empty state, etc.
[0012] In combination with the first aspect, in a possible implementation method, performing a session management operation based on the mutually exclusive attribute information of the first session includes: performing a session management operation based on the mutually exclusive attribute information of the first session and a session table, wherein the session table is used to indicate session information of the established session.
[0013] Through the above method, the first diagnostic agent can maintain and save the session table. The first diagnostic agent can determine whether there is a session conflict or other situation by comparing the mutually exclusive attribute information of the first session with the session information recorded in the session table. Thus, the first diagnostic agent can perform corresponding session management operations based on the specific situation. It should be understood that in the embodiments of the present application, the session table is merely an information table maintained to facilitate session management and does not limit the maintenance method of session information of established sessions.
[0014] In combination with the first aspect, in a possible implementation, the session management operation is performed based on the mutually exclusive attribute information and the session table of the first session, including: when the mutually exclusive attribute information of the first session and the session table meet any of the following first conditions, the operation of establishing the first session is performed: the mutually exclusive attribute information of the first session indicates the establishment of a session, and the session table is empty; the mutually exclusive attribute information of the first session indicates the establishment of a session, and the session table includes session information of a second session, wherein the second session is associated with a second diagnostic channel, and the target object corresponding to the second diagnostic channel is different from the target object corresponding to the first diagnostic channel; wherein the diagnostic response message is used to indicate the establishment result of the first session.
[0015] Through the above method, based on the session information recorded in the session table, if there is no session conflict between the established session and the new session to be established, the first diagnostic agent can directly establish the new session. The phrase "the session table is empty" can mean that the session table does not record session information for an established session, or it can mean that the first diagnostic agent does not currently maintain a session table. This embodiment of the present application does not limit the interpretation of "the session table is empty."
[0016] With reference to the first aspect, in a possible implementation, the priority of the second session is lower than a preset highest priority.
[0017] Through the above method, in one way of understanding, the highest priority can be considered as an exclusive attribute, which means that a session with an exclusive attribute cannot coexist with other sessions. Among them, if the session information in the session table indicates the highest priority, then a new session cannot be created. If the session information in the session table indicates a priority lower than the highest priority, a new session can be directly established if there is no session conflict. It should be understood that the highest priority being an exclusive attribute is only one interpretation of the meaning of the highest priority, and does not limit the highest priority to being an exclusive attribute. For example, in another understanding, the highest priority is only used for evaluation in scenarios where it is necessary to preempt a session. A new session with the highest priority can preempt the diagnostic channel associated with a conflicting session with a lower priority, and a new session with a lower priority cannot preempt the diagnostic channel associated with a conflicting session with the highest priority.
[0018] In combination with the first aspect, in a possible implementation method, the session management operation is performed based on the mutually exclusive attribute information and the session table of the first session, including: when the mutually exclusive attribute information of the first session and the session table meet the following second condition, performing a session preemption operation for the first session: the mutually exclusive attribute information of the first session indicates the establishment of a session, and the session table includes session information of a third session, wherein the third session is associated with a third diagnostic channel, the target object corresponding to the third diagnostic channel is the same as the target object corresponding to the first diagnostic channel, and the priority of the first session is higher than the priority of the third session; wherein the diagnostic response message is used to indicate the result of the first session preempting the third session.
[0019] Through the above method, according to the session information recorded in the session table, when there is no session conflict between the established session and the new session to be established, the first diagnostic agent device can determine whether it can perform the session preemption operation for the new session based on the session priority. It can be understood that the priority is only an example of the evaluation parameter used to determine whether to preempt the session in the embodiment of the present application and is not any limitation. In other embodiments, the first diagnostic agent device can also determine whether to preempt the session through other parameters, which will not be repeated here. The preemption result of the first session for the third session may include preemption related information, such as the status of the first session, the status of the third session, the exit protection time of the third session, etc. The embodiment of the present application does not limit the specific content contained in the preemption result.
[0020] With reference to the first aspect, in a possible implementation, the priority of the third session is lower than a preset highest priority.
[0021] Using the above method, based on the understanding of session priorities, if the highest priority is considered exclusive, then if the third session has exclusive access, the first session cannot preempt the third session. If the third session's priority is lower than the highest priority, then the third session does not have exclusive access. If the second condition is met, the first session can preempt the third session. This is described above and will not be repeated here.
[0022] With reference to the first aspect, in a possible implementation, performing the session preemption operation for the first session includes: setting the third session to an exit state; and causing the first session to enter a working state.
[0023] Through the above method, the first diagnostic agent device can realize the preemptive session operation by managing the session state. Among them, the exit state indicates that the session is a preempted session and the exit process is in progress. In this exit state, the third session can start an exit timer, and when the exit timer reaches the exit protection time of the third session, the session information of the third session is deleted. The working state indicates that the session is a working session, and the diagnostic channel associated with the session in the working state can be used to transmit diagnostic messages. It should be understood that the exit state and the working state are only examples of session states and not limitations. In other embodiments, the session may also include other states, which will be described in detail in conjunction with the embodiments below and will not be repeated here.
[0024] In combination with the first aspect, in a possible implementation, performing the session management operation based on the mutually exclusive attribute information of the first session and the session table includes: when the mutually exclusive attribute information of the first session indicates establishing a session and the first session has the highest priority, releasing all sessions associated with the session information in the session table; or, when the mutually exclusive attribute information of the first session indicates establishing a session and the session table includes session information indicating the highest priority, refusing to establish the first session.
[0025] Through the above method, when the highest priority is understood as an exclusive attribute, on the one hand, when the new session to be established has the highest priority, all established sessions need to be released. On the other hand, when an established session has the highest priority, a new session cannot be established. Accordingly, the first diagnostic agent device needs to perform an operation to release the session or refuse to establish a new session based on the specific situation. Thus, when different sessions conflict due to session attribute information, by releasing the conflicting established session or refusing to establish a new session, a more complete diagnostic process can be flexibly implemented, thereby improving the reliability of on-board diagnosis.
[0026] In combination with the first aspect, in a possible implementation method, the session management operation is performed based on the mutually exclusive attribute information and the session table of the first session, including: when the mutually exclusive attribute information of the first session and the session table meet the following third condition, the operation of releasing the first session is performed: the mutually exclusive attribute information of the first session indicates the release of the session, and the session table includes the session information of the first session; wherein the diagnostic response message is used to indicate the release result of the first session.
[0027] Through the above method, the diagnostic device can actively trigger the process of releasing the session. The first diagnostic agent device can perform the corresponding session release operation in response to the specific content contained in the request message from the diagnostic device. It should be noted that in the embodiment of the present application, in addition to triggering the session release operation based on the session exclusive attribute and the diagnostic request message for releasing the session, the first diagnostic agent device can also monitor the established session. When other release conditions are met, the first diagnostic agent device can actively release the relevant session. For example, if a diagnostic channel does not transmit a message within the first time period, it means that the diagnostic channel is not occupied, and the first diagnostic agent device can actively release the session associated with the diagnostic channel. The first time period can be a preset release time period, which is used for the first diagnostic agent device to monitor the usage of the relevant diagnostic channel. The first time period can be an empirical value, or it can be set according to the application scenario or business scenario, etc. The embodiment of the present application does not limit this.
[0028] In combination with the first aspect, in one possible implementation, the session information included in the session table is associated with at least one diagnostic device, and the at least one diagnostic device supports an on-board diagnostic mutually exclusive protocol, and the on-board diagnostic mutually exclusive protocol includes a first frame format of the diagnostic request message and / or a second frame format of the diagnostic response message.
[0029] Through the above method, the first diagnostic agent device can maintain session information for at least one diagnostic device so as to transmit diagnostic messages with the at least one diagnostic device. Wherein, the first diagnostic agent device and the at least one diagnostic device can both support the on-board diagnostic mutually exclusive protocol, and transmit diagnostic request messages and / or diagnostic response messages according to the frame format defined by the on-board diagnostic mutually exclusive protocol. It can be understood that the on-board diagnostic mutually exclusive protocol of the embodiment of the present application can be a new protocol defined for on-board diagnostic communication, or it can be a supplementary protocol (or called an extended protocol) for at least one existing on-board diagnostic standard protocol, so that different devices supporting the at least one on-board diagnostic standard protocol can improve the concurrent diagnostic process and preemptive diagnostic process based on each diagnostic channel in the presence of concurrent diagnosis or mutually exclusive diagnosis scenarios, thereby improving the reliability of on-board diagnosis.
[0030] In combination with the first aspect, in a possible implementation method, the on-board diagnostic mutual exclusion protocol of the embodiment of the present application can be a newly defined on-board diagnostic protocol. When the diagnostic request message adopts the first frame format, the frame type corresponding to the first frame format can be a session request or a mutual exclusion request defined by the on-board diagnostic mutual exclusion protocol, and the mutual exclusion attribute information is located in the payload field of the diagnostic request message. When the diagnostic response message adopts the second frame format, the frame type corresponding to the second frame format can be a session response or a mutual exclusion response defined by the on-board diagnostic mutual exclusion protocol, and the session management result is located in the payload field of the diagnostic response message.
[0031] It should be understood that this method is an example of the frame format of the on-board diagnostic mutual exclusion protocol in an embodiment of the present application, and does not limit the specific field position or byte position of the mutual exclusion attribute information and session management results in the corresponding message.
[0032] In combination with the first aspect, in a possible implementation method, when the diagnostic request message adopts the first frame format, the mutually exclusive attribute information is located in the first field of the diagnostic request message, wherein the first field is the effective load field when the diagnostic request message adopts the third frame format; when the diagnostic response message adopts the second frame format, the session management result is located in the second field of the diagnostic response message, wherein the second field is the effective load field when the diagnostic response message adopts the fourth frame format.
[0033] Through the above method, taking the on-board diagnostic mutual exclusion protocol of the embodiment of the present application as an example, which is a supplementary protocol for at least one existing on-board diagnostic standard protocol, the meaning of the reserved fields or reserved values of the transmission message defined by the at least one on-board diagnostic standard protocol can be defined and described, so that the communicating parties can improve the concurrent diagnostic process and preemptive diagnostic process of each diagnostic channel based on the content carried by the payload field, thereby improving the reliability of on-board diagnosis.
[0034] It is understood that in the embodiments of the present application, the payload field may have different meanings or names in different on-board diagnostic protocols. For example, in the DoIP protocol, the payload field is a field used to carry user data. In the DoCAN protocol, the payload field is the data field of the DoCAN message.
[0035] Among them, in one possible implementation, the first frame format is the same as the third frame format, and the frame type corresponding to the first frame format is different from the frame type corresponding to the third frame format; the second frame format is the same as the fourth frame format, and the frame type corresponding to the second frame format is different from the frame type corresponding to the fourth frame format.
[0036] The frame type is the message type. For example, the frame type corresponding to the first frame format may be a mutually exclusive request or a session request based on the on-board diagnostic mutually exclusive protocol extension definition of the embodiment of the present application, the frame type corresponding to the second frame format may be a mutually exclusive response or a session response based on the on-board diagnostic mutually exclusive protocol extension definition of the embodiment of the present application, the frame type corresponding to the third frame format may be a diagnostic request defined by an existing on-board diagnostic protocol, and the frame type corresponding to the fourth frame format may be a diagnostic response defined by an existing on-board diagnostic protocol. Among them, the value used to indicate the frame type corresponding to the first frame format and the value used to indicate the frame type corresponding to the second frame format are reserved values not defined by the existing on-board diagnostic protocol.
[0037] In combination with the first aspect, in a possible implementation, the method further includes: when the first session is in a working state, receiving a routing activation request message from the diagnostic device; and activating routing of the first diagnostic channel according to the routing activation request message.
[0038] Through the above method, the first diagnostic agent can determine whether to activate the first diagnostic channel associated with the first session based on whether it receives a route activation request message from the diagnostic device. The diagnostic device can, for example, query the first diagnostic agent for the status of the first session in real time or periodically, and determine whether to send the route activation request message to the first diagnostic agent based on the status of the first session. This embodiment of the present application does not limit the timing of triggering the route activation request message.
[0039] In combination with the first aspect, in a possible implementation manner, the method further includes: forwarding the diagnosis request message to a second diagnosis agent device, wherein the second diagnosis agent device and the first diagnosis agent device are ring topology Ethernet nodes.
[0040] Through the above method, the first diagnostic agent device can belong to at least one diagnostic agent device, and the at least one diagnostic agent device can be, for example, a ring topology Ethernet node on the vehicle side. The first diagnostic agent device can also forward to the second diagnostic agent device in the ring topology Ethernet node, so that the second diagnostic agent device can communicate and interact with the diagnostic device.
[0041] In conjunction with the first aspect, in one possible implementation, the mutually exclusive attribute information of the first session may include at least one of the following: a function identifier, priority information, or an exit protection time. In another possible implementation, the mutually exclusive attribute information may also include communication address information of the first diagnostic channel.
[0042] Through the above method, the diagnostic request message can carry any content used to improve the concurrent diagnostic process or preemptive process of the on-board diagnostic method of the embodiment of the present application, and the embodiment of the present application does not limit this.
[0043] In a second aspect, an embodiment of the present application provides an on-board diagnostic method, which can be performed by any diagnostic device of an embodiment of the present application. The method may include: the diagnostic device determines a diagnostic request message based on a target diagnostic task, the diagnostic request message is used to request diagnosis of a target object, the diagnostic request message includes mutually exclusive attribute information of a first session, and the first session is associated with a first diagnostic channel between the diagnostic device and the target object; the diagnostic device sends the diagnostic request message to a first diagnostic agent device; the diagnostic device receives a diagnostic response message from the first diagnostic agent device, the diagnostic response message is used to indicate a session management result obtained by performing a session management operation based on the mutually exclusive attribute information of the first session.
[0044] Through the above method, in the presence of concurrent diagnostic scenarios or mutually exclusive diagnostic scenarios, the diagnostic device can transmit diagnostic request messages and diagnostic response messages between the first diagnostic agent device according to the on-board diagnostic mutual exclusion protocol, so as to improve the concurrent diagnostic process and preemptive diagnostic process based on each diagnostic channel and improve the reliability of on-board diagnosis.
[0045] In conjunction with the second aspect, in a possible implementation, the session management operation includes any one of the following operations: establishing a session, seizing a session, releasing a session, or querying a session status.
[0046] In conjunction with the second aspect, in a possible implementation, the diagnostic device supports an on-board diagnostic mutually exclusive protocol, and the on-board diagnostic mutually exclusive protocol includes a first frame format of the diagnostic request message and a second frame format of the diagnostic response message.
[0047] In combination with the second aspect, in a possible implementation method, the on-board diagnostic mutual exclusion protocol of the embodiment of the present application can be a newly defined on-board diagnostic protocol. When the diagnostic request message adopts the first frame format, the frame type corresponding to the first frame format can be a session request or a mutual exclusion request defined by the on-board diagnostic mutual exclusion protocol, and the mutual exclusion attribute information is located in the payload field of the diagnostic request message. When the diagnostic response message adopts the second frame format, the frame type corresponding to the second frame format can be a session response or a mutual exclusion response defined by the on-board diagnostic mutual exclusion protocol, and the session management result is located in the payload field of the diagnostic response message.
[0048] It should be understood that this method is an example of the frame format of the on-board diagnostic mutual exclusion protocol in an embodiment of the present application, and does not limit the specific field position or byte position of the mutual exclusion attribute information and session management results in the corresponding message.
[0049] In combination with the second aspect, in a possible implementation method, when the diagnostic request message adopts the first frame format, the mutually exclusive attribute information is located in the first field of the diagnostic request message, wherein the first field is the effective load field when the diagnostic request message adopts the third frame format; when the diagnostic response message adopts the second frame format, the session management result is located in the second field of the diagnostic response message, wherein the second field is the effective load field when the diagnostic response message adopts the fourth frame format.
[0050] It is understood that in the embodiments of the present application, the payload field may have different meanings or names in different on-board diagnostic protocols. For example, in the DoIP protocol, the payload field is a field used to carry user data. In the DoCAN protocol, the payload field is the data field of the DoCAN message.
[0051] Among them, in one possible implementation, the first frame format is the same as the third frame format, and the frame type corresponding to the first frame format is different from the frame type corresponding to the third frame format; the second frame format is the same as the fourth frame format, and the frame type corresponding to the second frame format is different from the frame type corresponding to the fourth frame format.
[0052] The frame type is the message type. For example, the frame type corresponding to the first frame format may be a mutually exclusive request or a session request based on the on-board diagnostic mutually exclusive protocol extension definition of the embodiment of the present application, the frame type corresponding to the second frame format may be a mutually exclusive response or a session response based on the on-board diagnostic mutually exclusive protocol extension definition of the embodiment of the present application, the frame type corresponding to the third frame format may be a diagnostic request defined by an existing on-board diagnostic protocol, and the frame type corresponding to the fourth frame format may be a diagnostic response defined by an existing on-board diagnostic protocol. Among them, the value used to indicate the frame type corresponding to the first frame format and the value used to indicate the frame type corresponding to the second frame format are reserved values not defined by the existing on-board diagnostic protocol.
[0053] In combination with the second aspect, in a possible implementation manner, the mutually exclusive attribute information of the first session includes at least one of the following information: a function identifier, priority information, or an exit protection time.
[0054] In combination with the second aspect, in a possible implementation manner, the mutually exclusive attribute information further includes communication address information of the first diagnostic channel.
[0055] In combination with the second aspect, in a possible implementation, the method further includes: when the first session is in a working state, the diagnostic device sends a routing activation request message to the first diagnostic agent device, wherein the routing activation request message is used to instruct routing activation of the first diagnostic channel.
[0056] In combination with the second aspect, in a possible implementation, the method further includes: the diagnostic device sends a query request message to the first diagnostic agent device, wherein the query request message is used to request a query on the status of the first session; the diagnostic device receives a query response message from the first diagnostic agent device, wherein the query response message is used to indicate the status of the first session.
[0057] In conjunction with the second aspect, in a possible implementation manner, the method further includes: the diagnostic device sending the diagnostic request message to a second diagnostic agent device.
[0058] In a third aspect, an embodiment of the present application provides an on-board diagnostic device, comprising: a transceiver unit for receiving a diagnostic request message from a diagnostic device, wherein the diagnostic request message is used to request diagnosis of a target object, and the diagnostic request message includes mutually exclusive attribute information of a first session, and the first session is associated with a first diagnostic channel between the diagnostic device and the target object; a processing unit for performing session management operations based on the mutually exclusive attribute information of the first session; and the transceiver unit is also used to send a diagnostic response message to the diagnostic device, and the diagnostic response message is used to indicate a session management result.
[0059] In conjunction with the third aspect, in a possible implementation, the session management operation includes any one of the following operations: establishing a session, seizing a session, releasing a session, or querying a session status.
[0060] In conjunction with the third aspect, in a possible implementation, the processing unit is configured to: perform the session management operation according to the mutually exclusive attribute information of the first session and a session table, wherein the session table is used to indicate session information of the established session.
[0061] In combination with the third aspect, in a possible implementation method, the processing unit is used to: perform the operation of establishing the first session when the mutually exclusive attribute information of the first session and the session table meet any one of the following first conditions: the mutually exclusive attribute information of the first session indicates the establishment of a session, and the session table is empty; the mutually exclusive attribute information of the first session indicates the establishment of a session, and the session table includes session information of a second session, wherein the second session is associated with a second diagnostic channel, and the target object corresponding to the second diagnostic channel is different from the target object corresponding to the first diagnostic channel; wherein the diagnostic response message is used to indicate the establishment result of the first session.
[0062] With reference to the third aspect, in a possible implementation, the priority of the second session is lower than a preset highest priority.
[0063] In combination with the third aspect, in a possible implementation method, the processing unit is used to: perform a session preemption operation for the first session when the mutually exclusive attribute information of the first session and the session table meet the following second condition: the mutually exclusive attribute information of the first session indicates the establishment of a session, and the session table includes session information of a third session, wherein the third session is associated with a third diagnostic channel, the target object corresponding to the third diagnostic channel is the same as the target object corresponding to the first diagnostic channel, and the priority of the first session is higher than the priority of the third session; wherein the diagnostic response message is used to indicate the result of the first session preempting the third session.
[0064] With reference to the third aspect, in a possible implementation, the priority of the third session is lower than a preset highest priority.
[0065] In conjunction with the third aspect, in a possible implementation, the processing unit is configured to: set the third session to an exit state; and enable the first session to enter a working state.
[0066] In combination with the third aspect, in one possible implementation, the processing unit is used to: release all sessions associated with the session information in the session table when the mutually exclusive attribute information of the first session indicates the establishment of a session and the first session has the highest priority; or refuse to establish the first session when the mutually exclusive attribute information of the first session indicates the establishment of a session and the session table includes session information indicating the highest priority.
[0067] In combination with the third aspect, in a possible implementation method, the processing unit is used to: execute the operation of releasing the first session when the mutually exclusive attribute information of the first session and the session table meet the following third condition: the mutually exclusive attribute information of the first session indicates the release of the session, and the session table includes the session information of the first session; wherein the diagnostic response message is used to indicate the release result of the first session.
[0068] In combination with the third aspect, in one possible implementation, the session information included in the session table is associated with at least one diagnostic device, and the at least one diagnostic device supports an on-board diagnostic mutual exclusion protocol, and the on-board diagnostic mutual exclusion protocol includes a first frame format of the diagnostic request message and / or a second frame format of the diagnostic response message.
[0069] In combination with the third aspect, in a possible implementation method, the on-board diagnostic mutual exclusion protocol of the embodiment of the present application can be a newly defined on-board diagnostic protocol. When the diagnostic request message adopts the first frame format, the frame type corresponding to the first frame format can be a session request or a mutual exclusion request defined by the on-board diagnostic mutual exclusion protocol, and the mutual exclusion attribute information is located in the payload field of the diagnostic request message. When the diagnostic response message adopts the second frame format, the frame type corresponding to the second frame format can be a session response or a mutual exclusion response defined by the on-board diagnostic mutual exclusion protocol, and the session management result is located in the payload field of the diagnostic response message.
[0070] It should be understood that this method is an example of the frame format of the on-board diagnostic mutual exclusion protocol in an embodiment of the present application, and does not limit the specific field position or byte position of the mutual exclusion attribute information and session management results in the corresponding message.
[0071] In combination with the third aspect, in a possible implementation method, when the diagnostic request message adopts the first frame format, the mutually exclusive attribute information is located in the first field of the diagnostic request message, wherein the first field is the effective load field when the diagnostic request message adopts the third frame format; when the diagnostic response message adopts the second frame format, the session management result is located in the second field of the diagnostic response message, wherein the second field is the effective load field when the diagnostic response message adopts the fourth frame format.
[0072] It is understood that in the embodiments of the present application, the payload field may have different meanings or names in different on-board diagnostic protocols. For example, in the DoIP protocol, the payload field is a field used to carry user data. In the DoCAN protocol, the payload field is the data field of the DoCAN message.
[0073] Among them, in one possible implementation, the first frame format is the same as the third frame format, and the frame type corresponding to the first frame format is different from the frame type corresponding to the third frame format; the second frame format is the same as the fourth frame format, and the frame type corresponding to the second frame format is different from the frame type corresponding to the fourth frame format.
[0074] The frame type is the message type. For example, the frame type corresponding to the first frame format may be a mutually exclusive request or a session request based on the on-board diagnostic mutually exclusive protocol extension definition of the embodiment of the present application, the frame type corresponding to the second frame format may be a mutually exclusive response or a session response based on the on-board diagnostic mutually exclusive protocol extension definition of the embodiment of the present application, the frame type corresponding to the third frame format may be a diagnostic request defined by an existing on-board diagnostic protocol, and the frame type corresponding to the fourth frame format may be a diagnostic response defined by an existing on-board diagnostic protocol. Among them, the value used to indicate the frame type corresponding to the first frame format and the value used to indicate the frame type corresponding to the second frame format are reserved values not defined by the existing on-board diagnostic protocol.
[0075] In combination with the third aspect, in a possible implementation method, the transceiver unit is also used to: receive a routing activation request message from the diagnostic device when the first session is in a working state; the processing unit is also used to: perform routing activation on the first diagnostic channel according to the routing activation request message.
[0076] In conjunction with the third aspect, in a possible implementation, the transceiver unit is further configured to: forward the diagnosis request message to a second diagnosis agent device, wherein the second diagnosis agent device and the first diagnosis agent device are ring topology Ethernet nodes.
[0077] In conjunction with the third aspect, in a possible implementation manner, the mutually exclusive attribute information of the first session includes at least one of the following information: a function identifier, priority information, or an exit protection time.
[0078] In combination with the third aspect, in a possible implementation manner, the mutually exclusive attribute information also includes communication address information of the first diagnostic channel.
[0079] In a fourth aspect, an embodiment of the present application provides an on-vehicle diagnostic device, comprising: a determination unit, for determining a diagnostic request message based on a target diagnostic task, the diagnostic request message being used to request diagnosis of a target object, the diagnostic request message including mutually exclusive attribute information of a first session, the first session being associated with a first diagnostic channel between the diagnostic device and the target object; a transceiver unit, for sending the diagnostic request message to a first diagnostic agent device; the transceiver unit, further for receiving a diagnostic response message from the first diagnostic agent device, the diagnostic response message being used to indicate a session management result obtained by performing a session management operation based on the mutually exclusive attribute information of the first session.
[0080] In conjunction with the fourth aspect, in a possible implementation, the session management operation includes any one of the following operations: establishing a session, seizing a session, releasing a session, or querying a session status.
[0081] In conjunction with the fourth aspect, in a possible implementation, the diagnostic device supports an on-board diagnostic mutually exclusive protocol, and the on-board diagnostic mutually exclusive protocol includes a first frame format of the diagnostic request message and a second frame format of the diagnostic response message.
[0082] In combination with the fourth aspect, in a possible implementation method, the on-board diagnostic mutual exclusion protocol of the embodiment of the present application can be a newly defined on-board diagnostic protocol. When the diagnostic request message adopts the first frame format, the frame type corresponding to the first frame format can be a session request or a mutual exclusion request defined by the on-board diagnostic mutual exclusion protocol, and the mutual exclusion attribute information is located in the payload field of the diagnostic request message. When the diagnostic response message adopts the second frame format, the frame type corresponding to the second frame format can be a session response or a mutual exclusion response defined by the on-board diagnostic mutual exclusion protocol, and the session management result is located in the payload field of the diagnostic response message.
[0083] It should be understood that this method is an example of the frame format of the on-board diagnostic mutual exclusion protocol in an embodiment of the present application, and does not limit the specific field position or byte position of the mutual exclusion attribute information and session management results in the corresponding message.
[0084] It is understood that in the embodiments of the present application, the payload field may have different meanings or names in different on-board diagnostic protocols. For example, in the DoIP protocol, the payload field is a field used to carry user data. In the DoCAN protocol, the payload field is the data field of the DoCAN message.
[0085] Among them, in one possible implementation, the first frame format is the same as the third frame format, and the frame type corresponding to the first frame format is different from the frame type corresponding to the third frame format; the second frame format is the same as the fourth frame format, and the frame type corresponding to the second frame format is different from the frame type corresponding to the fourth frame format.
[0086] The frame type is the message type. For example, the frame type corresponding to the first frame format may be a mutually exclusive request or a session request based on the on-board diagnostic mutually exclusive protocol extension definition of the embodiment of the present application, the frame type corresponding to the second frame format may be a mutually exclusive response or a session response based on the on-board diagnostic mutually exclusive protocol extension definition of the embodiment of the present application, the frame type corresponding to the third frame format may be a diagnostic request defined by an existing on-board diagnostic protocol, and the frame type corresponding to the fourth frame format may be a diagnostic response defined by an existing on-board diagnostic protocol. Among them, the value used to indicate the frame type corresponding to the first frame format and the value used to indicate the frame type corresponding to the second frame format are reserved values not defined by the existing on-board diagnostic protocol.
[0087] In combination with the fourth aspect, in a possible implementation method, when the diagnostic request message adopts the first frame format, the mutually exclusive attribute information is located in the first field of the diagnostic request message, wherein the first field is the effective load field when the diagnostic request message adopts the third frame format; when the diagnostic response message adopts the second frame format, the session management result is located in the second field of the diagnostic response message, wherein the second field is the effective load field when the diagnostic response message adopts the fourth frame format.
[0088] In conjunction with the fourth aspect, in a possible implementation manner, the mutually exclusive attribute information of the first session includes at least one of the following information: a function identifier, priority information, or an exit protection time.
[0089] In combination with the fourth aspect, in a possible implementation manner, the mutually exclusive attribute information also includes communication address information of the first diagnostic channel.
[0090] In combination with the fourth aspect, in a possible implementation, the transceiver unit is further used to: when the first session is in a working state, send a routing activation request message to the first diagnostic agent device, wherein the routing activation request message is used to instruct routing activation of the first diagnostic channel.
[0091] In combination with the fourth aspect, in one possible implementation, the transceiver unit is further used to: send a query request message to the first diagnostic agent device, wherein the query request message is used to request a query on the status of the first session; and receive a query response message from the first diagnostic agent device, wherein the query response message is used to indicate the status of the first session.
[0092] In conjunction with the fourth aspect, in a possible implementation, the transceiver unit is further configured to: send the diagnosis request message to a second diagnosis agent device.
[0093] In a fifth aspect, an embodiment of the present application provides a communication system, which may include the on-board diagnostic agent device described in the third aspect and any possible implementation of the third aspect, and the on-board diagnostic device described in the fourth aspect and any possible implementation of the fourth aspect.
[0094] In the sixth aspect, an embodiment of the present application provides a chip system, which may include at least one processor and an interface circuit, wherein the processor is used to execute instructions and / or data interaction through the interface circuit, so that the chip system executes the method described in the above-mentioned first aspect and any possible implementation of the first aspect, or, the chip system executes the method described in the above-mentioned second aspect and any possible implementation of the second aspect.
[0095] In a seventh aspect, an embodiment of the present application provides a terminal, comprising the apparatus described in the third aspect and any possible implementation of the third aspect, or the chip system described in the sixth aspect, and / or comprising the apparatus described in the fourth aspect and any possible implementation of the fourth aspect, or the chip system described in the sixth aspect. For example, the terminal may be a vehicle.
[0096] In an eighth aspect, an embodiment of the present application provides an electronic control unit, comprising a unit for implementing the method described in the first aspect and any possible implementation of the first aspect.
[0097] In a ninth aspect, an embodiment of the present application provides a diagnostic device comprising a unit for implementing the method described in the second aspect and any possible implementation of the second aspect.
[0098] In the tenth aspect, an embodiment of the present application provides a communication device, comprising a processor, which is coupled to a memory: the processor is used to execute a computer program or instruction stored in the memory, so that the communication device executes the method described in the first aspect and any possible implementation of the first aspect, or executes the method described in the second aspect and any possible implementation of the second aspect.
[0099] In the eleventh aspect, an embodiment of the present application provides a computer-readable storage medium, including a program or instruction. When the program or instruction is executed, the method described in the first aspect and any possible implementation of the first aspect is executed, or the method described in the second aspect and any possible implementation of the second aspect is executed.
[0100] In the twelfth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program runs on a computer, it enables the computer to execute the method described in the first aspect and any possible implementation of the first aspect, or execute the method described in the second aspect and any possible implementation of the second aspect.
[0101] Based on the implementations provided in the above aspects, the embodiments of the present application can be further combined to provide more implementations.
[0102] The technical effects that can be achieved by any possible implementation method in any of the second to twelfth aspects mentioned above can be referred to the description of the technical effects that can be achieved by any possible implementation method in any of the first aspect mentioned above, and the repetitions will not be discussed. BRIEF DESCRIPTION OF THE DRAWINGS
[0103] FIG1 is a schematic diagram showing an applicable application scenario of an embodiment of the present application;
[0104] FIG2 shows a system architecture diagram applicable to an embodiment of the present application;
[0105] FIG3 a shows a schematic diagram of a network protocol architecture applicable to the system according to an embodiment of the present application;
[0106] FIG3 b shows a schematic diagram of the frame format of a DoIP message according to an embodiment of the present application;
[0107] FIG3 c shows a schematic diagram of the frame format of a DoCAN message according to an embodiment of the present application;
[0108] FIG4 is a schematic diagram showing a session state according to an embodiment of the present application;
[0109] FIG5 is a schematic diagram showing a logic judgment process of an example of an on-board diagnostic method according to an embodiment of the present application;
[0110] FIG6 is a schematic diagram showing a logic judgment process of another example of the on-board diagnostic method according to an embodiment of the present application;
[0111] FIG7 is a schematic diagram showing a flow chart of an on-board diagnostic method according to an embodiment of the present application;
[0112] FIG8 is a schematic diagram showing a flow chart of an on-board diagnostic method according to a scenario of an embodiment of the present application;
[0113] FIG9 is a schematic diagram showing a flow chart of an on-board diagnostic method in another scenario according to an embodiment of the present application;
[0114] FIG10 is a schematic diagram showing a flow chart of an on-board diagnostic method in another scenario according to an embodiment of the present application;
[0115] FIG11 shows a schematic diagram of a communication device according to an embodiment of the present application;
[0116] FIG12 shows a schematic diagram of a communication device according to an embodiment of the present application;
[0117] FIG13 shows a schematic structural diagram of a communication device according to an embodiment of the present application. DETAILED DESCRIPTION
[0118] To facilitate understanding, some of the terms involved in the embodiments of this application are introduced below.
[0119] 1. Electronic control unit (ECU):
[0120] The utility model relates to a microcomputer controller specially used for vehicles.
[0121] With the advancement of technology, various businesses in the automotive industry are becoming increasingly mature, and vehicle electrical systems are becoming increasingly complex. Vehicle systems are typically equipped with numerous components called ECUs, which communicate with each other over the vehicle bus, forming a local area network within the vehicle.
[0122] 2. Automotive bus:
[0123] A multiplexed communication network technology used to achieve communication interaction between multiple devices inside a vehicle, and communication interaction between internal devices in a vehicle and external equipment.
[0124] Current automotive buses mainly include: Ethernet bus, controller area network (CAN) bus, local interconnect network (LIN) bus, high-speed fault-tolerant network protocol (FlexRay, FR) bus, media oriented systems transport (MOST) bus for automotive multimedia and navigation, as well as Bluetooth and wireless LAN compatible with computer networks.
[0125] 3. On-board diagnostic protocol:
[0126] A protocol for diagnosing faults in ECUs, such as vehicle devices or instrument clusters, within the vehicle network, using the appropriate diagnostic methods based on the vehicle bus. Fault diagnosis can include, but is not limited to, reading fault codes, diagnostic trouble codes (DTCs), clearing fault codes, setting codes, reading data streams, reading vehicle information, routine control, resetting the ECU, testing actuation, and reprogramming.
[0127] The industry has developed at least one on-board diagnostic protocol based on the vehicle's supported automotive bus. Examples include the Unified Diagnostic Services (UDS) protocol, the Diagnostic Communicate over Internet Protocol (DoIP) protocol, the Diagnose over CAN (DoCAN) protocol, the LIN protocol, the FlexRay protocol, and the MOST protocol.
[0128] Messages defined in each on-board diagnostic protocol can be sent to the corresponding ECU on the vehicle that supports the diagnostic service provided by the protocol. For example, messages defined in UDS can be sent to ECUs that support UDS services, messages defined in DoIP can be sent to ECUs that support DoIP services, and messages defined in DoCAN can be sent to ECUs that support DoCAN services.
[0129] At present, the standard of at least one on-board diagnostic protocol has been gradually improved and adapted to various diagnostic tools, adapting not only to the gradually improved vehicle functions and complex ECUs, but also to the expansion and upgrade of various ECU functions that are constantly increasing in vehicles.
[0130] 4. Diagnostic device (or diagnostic tool (tester)):
[0131] A device for initiating fault diagnosis communication to a target ECU (or target object) on a vehicle according to a diagnostic task. The diagnostic device may include but is not limited to a remote diagnostic device and / or an on-board diagnostic (OBD) device.
[0132] Among them, in the mobile Internet scenario, the remote diagnostic device can be a cloud diagnostic application (referred to as a cloud diagnostic application) installed and running on a mobile device. Through cloud online diagnosis, the cloud diagnostic application can be based on the DoIP protocol or the DoCAN protocol, etc., through the cloud server and the vehicle-mounted device, to achieve protocol conversion and data transmission between different devices based on at least one of the above-mentioned vehicle buses to complete remote real-time diagnosis of the vehicle. In the near-end vehicle diagnostic scenario, the user can manually insert the near-end tester for diagnosis through OBD, and the diagnostic protocol can include the DoCAN protocol, etc.
[0133] 5. Concurrent diagnosis and mutual exclusion of diagnosis:
[0134] Concurrent diagnosis includes that if at least two diagnostic devices simultaneously initiate diagnostic requests to different target objects on the vehicle side, the at least two diagnostic devices can respectively establish communication channels and transmit messages with the corresponding target objects to diagnose their respective corresponding target objects, and there is no conflict between the communication channels.
[0135] Diagnostic mutual exclusion includes that if at least two diagnostic devices simultaneously initiate diagnostic requests to the same target object on the vehicle side, there is a conflict in the communication channels between the at least two diagnostic devices and the target object, and messages cannot be transmitted simultaneously to diagnose the target object.
[0136] 6. Routing activation: the process of activating the communication channel for message transmission.
[0137] For example, in an on-board diagnostic communication scenario, the route activation process can be implemented by exchanging route activation request messages and route activation response messages between the diagnostic device and the target object in the vehicle. For example, the diagnostic device can act as the sender and send a route activation request message. The message type of the route activation request message is route activation request, and the route activation request message can indicate the source address and destination address. For example, the source address is the logical address of the diagnostic device, and the destination address is the logical address of the target object in the vehicle. The target object in the vehicle can act as the receiver and receive the route activation request message and respond by feeding back a route activation response message to the diagnostic device. The message type of the route activation response message is route activation response, and it can indicate the source address, destination address, and response code. The response code is the response status of the target object to the route activation request message. If the target object rejects the route activation request, the diagnostic device can be informed of the reason for rejection through the response code. If the target object accepts the route activation request, diagnostic communication can be carried out between the diagnostic device and the target object, such as exchanging diagnostic messages.
[0138] However, since the standard protocols of the above-mentioned related on-board diagnostic protocols are mainly defined on top of general on-board vehicle network protocols (such as IP protocol, CAN protocol, etc.) and are specifically used for unified diagnostic services (UDS) diagnosis, and the communication mechanism limitations of these general network protocols themselves do not specify concurrent diagnostic processing procedures or mutually exclusive diagnostic processing procedures when there are concurrent diagnostic scenarios or mutually exclusive scenarios for the same target object, this may lead to problems such as confusion in the diagnostic process and inaccurate diagnostic results.
[0139] The present invention provides an on-board diagnostic method, device, and system. By introducing an on-board diagnostic mutual exclusion protocol, these methods improve the concurrent and preemptive diagnostic processes across various diagnostic channels in scenarios involving concurrent or mutually exclusive diagnostics, thereby enhancing the reliability of on-board diagnostics. The method and device are based on the same technical concept. Because the principles underlying the problems solved by the method and device are similar, their implementations can be referenced in conjunction with each other, and any repetitions will not be repeated.
[0140] It should be noted that the on-board diagnostic solution in the embodiment of the present application can be applied to the Internet of Vehicles, such as vehicle to everything (V2X), long-term evolution-vehicle (LTE-V), vehicle to vehicle (V2V), etc. For example, it can be applied to a vehicle with a driving mobile function, or other devices in a vehicle with a driving mobile function. The other devices include but are not limited to: other sensors such as an on-board terminal, an on-board controller, an on-board module, an on-board module, an on-board component, an on-board chip, an on-board unit, an on-board radar or an on-board camera. The vehicle can implement the on-board diagnostic method provided in the embodiment of the present application through the on-board terminal, on-board controller, on-board module, on-board module, on-board component, on-board chip, on-board unit, on-board radar or on-board camera. Of course, the control solution in the embodiment of the present application can also be used in other smart terminals with mobile control functions other than vehicles, or be set in other smart terminals with mobile control functions other than vehicles, or be set in a component of the smart terminal. The smart terminal can be an intelligent transportation device, a smart home device, a robot, etc. For example, it includes but is not limited to smart terminals or controllers, chips, radars, cameras and other sensors, and other components within smart terminals.
[0141] It should be noted that, in the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0142] Furthermore, unless otherwise specified, ordinal numbers such as "first" and "second" in the embodiments of this application are used to distinguish between multiple objects and are not used to define the priority or importance of multiple objects. For example, the first diagnostic request message and the second diagnostic request message are only used to distinguish different diagnostic request messages, and do not indicate a difference in priority or importance between the two diagnostic request messages.
[0143] For ease of understanding, the following is an introduction with reference to the accompanying drawings and embodiments.
[0144] Figure 1 shows a schematic diagram of an application scenario applicable to an embodiment of the present application. In this application scenario, a vehicle 100 and a cloud server 200 may be included, and the vehicle 100 and the cloud server 200 may communicate via a network. In one embodiment, the cloud server 200 may also be implemented as a virtual machine.
[0145] Part or all of the functions of vehicle 100 are controlled by a computing platform 150. Computing platform 150 may include at least one processor 151, which may execute instructions 153 stored in a non-transitory computer-readable medium such as memory 152. In some embodiments, computing platform 150 may also be a plurality of computing devices that control individual components or subsystems of vehicle 100 in a distributed manner.
[0146] The processor 151 may be any conventional processor, such as a central processing unit (CPU). Alternatively, the processor 151 may include a graphics processing unit (GPU), a field programmable gate array (FPGA), a system on chip (SOC), an application specific integrated circuit (ASIC), or a combination thereof.
[0147] In addition to instructions 153, memory 152 may also store data such as road maps, route information, the vehicle's location, direction, speed, and other vehicle data, as well as other information. This information may be used by vehicle 100 and computing platform 150 during operation of vehicle 100 in autonomous, semi-autonomous, and / or manual modes. It should be understood that the structure of the vehicle in FIG. 1 should not be construed as limiting the embodiments of the present application.
[0148] In an optional implementation, the vehicle 100 may be a car, truck, motorcycle, bus, ship, airplane, helicopter, lawn mower, recreational vehicle, amusement park vehicle, construction equipment, tram, golf cart, train, etc., and the embodiments of the present application do not impose any particular limitation.
[0149] In an embodiment of the present application, a remote diagnostic device can be deployed in the cloud server 200. The remote diagnostic device can send remote diagnostic request messages to the vehicle's target ECU and receive diagnostic response messages from the vehicle's target ECU. By matching and parsing the diagnostic request messages with the corresponding diagnostic response messages, remote diagnosis of the vehicle can be achieved, thereby improving the reliability of remote vehicle diagnosis. The vehicle 100 may also include a socket (not shown) that can be used by a user to manually insert a proximal diagnostic device. The proximal diagnostic device can be connected to the vehicle's bus system and communicate with the vehicle's target ECU to enable the proximal diagnostic device to perform real-time fault diagnosis on the vehicle's target ECU according to the on-board diagnostic method of the embodiment of the present application.
[0150] In addition, the vehicle 100 may also include a diagnostic proxy device 154. This diagnostic proxy device 154 can implement proxy functions between the diagnostic device and the target ECU, such as transparently transmitting, parsing, or processing relevant messages exchanged between the two parties. For example, the diagnostic proxy device 154 can send diagnostic request messages from the remote diagnostic device or the local diagnostic device to the target ECU, and feedback diagnostic response messages from the target ECU to the remote diagnostic device or the local diagnostic device, so that the remote diagnostic device or the local diagnostic device can complete real-time diagnosis of the vehicle.
[0151] It should be noted that the diagnostic agent device 154 shown in Figure 1 is only an example of a device to illustrate that the computing platform 150 on the vehicle side can realize the diagnostic agent function and is not any limitation. The diagnostic agent function can be implemented by an independent device located on the vehicle 100 or by the processor 151. The embodiment of the present application does not limit this.
[0152] It should be noted that in the embodiments of the present application, the remote diagnostic device deployed on the cloud server 200 and / or the proximal diagnostic device connected to the vehicle by insertion, etc., can all be used as an example of the diagnostic device (tester) in the embodiments of the present application. The diagnostic device can communicate and interact with the diagnostic agent device 154 on the vehicle 100 side to implement the on-board diagnostic method of the embodiments of the present application. In an optional implementation, the diagnostic agent device 154 can also represent an example of multiple diagnostic agent devices on the vehicle. In another optional implementation, the diagnostic agent device 154 can also represent the target ECU itself, which will not be distinguished or detailed in the following embodiments.
[0153] FIG2 shows a system architecture diagram applicable to an embodiment of the present application.
[0154] 2 , the system may include at least one diagnostic device 210 and a diagnostic agent 154 on the vehicle 100 corresponding to the diagnostic device 210 . Each diagnostic agent 154 may be connected to n ECUs 120 , where n is an integer greater than or equal to 1.
[0155] In an embodiment of the present application, the at least one diagnostic device 210 may, for example, include a diagnostic device 210-1 and a diagnostic device 210-2. For ease of distinction, the diagnostic device 210-1 may be referred to as a first diagnostic device, and the diagnostic device 210-2 may be referred to as a second diagnostic device. Similarly, the diagnostic agent 154 corresponding to the diagnostic device 210 on the vehicle 100 side may, for example, include a diagnostic agent 154-1 and a diagnostic agent 154-2. The diagnostic agent 154-1 may be referred to as a first diagnostic agent, and the diagnostic agent 154-2 may be referred to as a second diagnostic agent. Both the first diagnostic agent and the second diagnostic agent may support at least one of the on-board diagnostic protocols mentioned above, and messages may be forwarded between the first diagnostic agent and the second diagnostic agent. For example, the first diagnostic agent may communicate directly with the first diagnostic device, and the first diagnostic agent may also forward relevant messages from the first diagnostic device to the second diagnostic agent and the ECU connected to the second diagnostic agent. Similarly, the second diagnostic agent device can directly communicate with the second diagnostic device, and the second diagnostic agent device can also forward relevant messages from the second diagnostic device to the first diagnostic agent device and the ECU connected to the first diagnostic agent device.
[0156] For example, the diagnostic device 210-i represents the diagnostic device 210-1 or the diagnostic device 210-2, i=1 or 2. The diagnostic device 210-i can be an application, or a software module, or an independent device, or a chip or component in a device. For example, the diagnostic device 210-1 can be a remote diagnostic device deployed in the cloud server 200 shown in Figure 1, which can be controlled by installing and running an application in a smart device such as a mobile phone or a tablet. The diagnostic device 210-2 can be a proximal diagnostic instrument (not shown in Figure 1) that is manually inserted through a socket (not shown in Figure 1) in the relevant introduction of Figure 1 above. It should be understood that the number of diagnostic devices 210 in the embodiment of the present application is not limited to that shown in Figure 2, and the value of i can be an integer greater than or equal to 1.
[0157] The diagnostic agent device 154 - j represents the diagnostic agent device 154 - 1 or the diagnostic agent device 154 - 2 , where j=1 or 2. The diagnostic agent device 154 - j may be a vehicle interface unit (VIU) on the vehicle 100 .
[0158] The vehicle network architecture of vehicle 100 can include at least one VIU. Sensors, actuators, or n ECUs can be connected to a nearby VIU to provide power supply, electronic fuses, I / O port isolation, and other functions for vehicle 100, where n is an integer greater than or equal to 1. The VIUs can be connected, for example, via a high-speed Ethernet ring network to ensure high efficiency and reliability of the vehicle network. Diagnostic agent 154-1 or diagnostic agent 154-2 shown in Figure 2 can be a node in this ring network.
[0159] It should be noted that the above embodiments are merely illustrative and non-limiting examples of the deployment method or product form of the diagnostic device 210-i or the diagnostic agent device 154-j. In an optional embodiment, the diagnostic agent device 154-j may be the target object (e.g., target ECU) itself, that is, the diagnostic device may communicate and interact directly with the target object to implement the on-board diagnostic method of the embodiment of the present application. In the following embodiments, only the diagnostic agent device 154-j is taken as VIU as an example to introduce the on-board diagnostic method of the embodiment of the present application. The relevant implementation process of the target object directly communicating and interacting with the diagnostic device to implement the on-board diagnostic method of the embodiment of the present application can be referred to the relevant description of VIU, and will not be distinguished or repeated one by one below.
[0160] In an embodiment of the present application, the diagnostic device 210-i or the diagnostic agent 154-j can support the on-board diagnostic mutually exclusive protocol of the embodiment of the present application, and the on-board diagnostic mutually exclusive protocol may include a frame format of a diagnostic request message or a frame format of a diagnostic response message. When the diagnostic device 210-i determines that the vehicle 100 needs to be diagnosed on-board, it can determine a diagnostic request message based on the target diagnostic task and the on-board diagnostic mutually exclusive protocol, and send the diagnostic request message to the vehicle 100 to initiate an on-board diagnostic process for the vehicle 100. Accordingly, the diagnostic agent 154-j on the vehicle 100 side can receive the diagnostic request message from the diagnostic device 210-i, and perform on-board diagnosis on the target object of the vehicle 100 according to the diagnostic request message to obtain diagnostic data for the vehicle.
[0161] Furthermore, the diagnostic agent 154-j on the vehicle 100 can send a diagnostic response message to the diagnostic device 210-i based on the vehicle's diagnostic data. Accordingly, the diagnostic device 210-i can parse the diagnostic response message from the vehicle to obtain the vehicle's diagnostic results, thereby promptly identifying faulty components, resolving the problem, and improving vehicle safety. This will be described below with reference to the accompanying drawings and embodiments, and will not be further elaborated here.
[0162] FIG3 a shows a schematic diagram of a network protocol architecture applicable to the communication system of an embodiment of the present application.
[0163] As shown in Figure 3a, in the seven-layer protocol architecture of the Open System Interconnection Reference Model (OSI), from the bottom layer to the top layer, it includes the physical layer, data link layer, network layer, transport layer, session layer, presentation layer and application layer.
[0164] Each layer can be called a protocol layer, and each protocol in each layer corresponds to a protocol stack. At each protocol layer, data packets transmitted from the upper layer must be appended with a corresponding data packet header (or frame header) to facilitate parsing by the peer layer of the peer device. The process of transmitting a data packet from an upper layer to a lower layer is called delivery. The process of transmitting a data packet from a lower layer to an upper layer is called submission. Before a data packet is appended with a header, it is called a service data unit (SDU). After the header is appended, it is called a protocol data unit (PDU). For example, at the transmitting end, a data packet received by the data link layer from the network layer can be called a data link layer SDU or a network layer PDU. After the data link layer appends a header to the data packet, the resulting data packet is called a data link layer PDU. Correspondingly, at the receiving end, the data link layer removes the header from the received data link layer PDU (also called a physical layer SDU) to obtain the data link layer SDU, which it then delivers to the upper layer, the network layer.
[0165] Among them, in the on-board diagnostic scenario of the embodiment of the present application, the UDS protocol can be a universal automotive diagnostic protocol defined by the International Organization for Standardization (ISO) 15765 and ISO 14229, located in the application layer and session layer of the OSI model. The UDS protocol can be implemented on different automotive buses (such as the aforementioned CAN, LIN, FR, IP (Ethernet) and K-line, etc.). The lower transport layer, network layer, data link layer, and physical layer can support services of various on-board diagnostic protocols based on the UDS protocol, such as the DoCAN protocol, DoIP protocol, CoFR protocol, LIN protocol, etc. When transmitting messages, the user data to be transmitted can be encapsulated or transparently transmitted from the application layer to the physical layer to obtain the transmission message of the embodiment of the present application. It should be noted that in the embodiment of the present application, the automotive bus can also include future technologies for in-vehicle wired transmission and future technologies for in-vehicle wireless transmission.
[0166] Taking the DoIP protocol as an example, ISO-13400 specifies the frame format of the DoIP message, as shown in Figure 3b. The message includes a data link layer header, an IP header, a TCP / UDP header, and DoIP data. The DoIP data includes the content of the DoIP segment, such as the protocol version, the inverse protocol version, the data type, the data length, and the payload (such as user data). The user data may include, for example, the source address, the destination address, and UDS / OBD data.
[0167] The source address is used to identify the sender of the data, the destination address is used to identify the receiver of the data, and the UDS / OBD data portion is used to carry the specific diagnostic request or diagnostic response defined in the UDS / OBD. Taking the DoCAN protocol as an example, the UDS service is enabled between the diagnostic device and the ECU in the vehicle. ISO 15765-2 specifies the transport layer and network layer, and ISO 14229-1 specifies the application layer and session layer. The service identifier (SID) and service-related parameters of the UDS service can be included in the data field of the DoCAN message sent by the diagnostic device, as shown in Figure 3c. In order to realize the packet transmission of diagnostic commands, ISO 15765-2 defines a total of four types of frame formats. Each frame format is identified by the first two or one bytes of the data field (depending on the frame type), for example, 0 represents a single frame (SF), 1 represents the first frame (FF), 2 represents a consecutive frame (CF), and 3 represents a flow control (FC) frame. The data field corresponding to each frame format is used to carry the diagnostic command or response of the corresponding length of the frame format. For example, the data field of a single frame is used for the diagnostic command or response with a length not exceeding 7 bytes; the data field of the first frame, continuous frame or flow control is used to transmit the diagnostic command or response with a length greater than 7 bytes.
[0168] In an embodiment of the present application, in order to improve the diagnostic process and preemption process in concurrent diagnostic scenarios or mutually exclusive diagnostic scenarios, and improve the reliability of on-board diagnosis, one possible implementation method is to introduce an on-board diagnostic mutual exclusion protocol in the architecture shown in Figure 3a, and formulate a new message frame format corresponding to the on-board diagnostic mutual exclusion protocol (for example, the first frame format of the diagnostic request message and / or the second frame format of the diagnostic response message) based on this, so that different diagnostic devices 210-i and the diagnostic agent device 154-j on the vehicle 100 side can determine the corresponding message to be transmitted to the opposite device based on the first frame format and / or the second frame format, thereby flexibly implementing the mutual exclusion preemption or concurrent strategy of different diagnostic channels through the analysis results of the first frame format message and / or the second frame format message, thereby improving the efficiency and reliability of on-board diagnosis.
[0169] It is understandable that the on-board diagnostic mutual exclusion protocol of the embodiment of the present application can be a new protocol defined for on-board diagnostic communication, or it can be a supplementary protocol (or extended protocol) for at least one of the existing on-board diagnostic protocols mentioned above, so that different communication devices (including at least one of the diagnostic device, diagnostic agent device or ECU) that support the at least one on-board diagnostic protocol can improve the concurrent diagnostic process and preemptive diagnostic process in the presence of concurrent diagnosis or mutually exclusive diagnosis scenarios, thereby improving the reliability of on-board diagnosis. The embodiment of the present application does not limit the rules for formulating the on-board diagnostic mutual exclusion protocol.
[0170] In one example, if the on-board diagnostic mutual exclusion protocol is a new protocol defined for on-board diagnostic communication, it can be used in conjunction with most other communication protocols in the vehicle network. If the diagnostic request message is used to request diagnosis of a target object, the first frame format may include at least mutual exclusion attribute information for a first session associated with a first diagnostic channel between the diagnostic device and the target ECU. This mutual exclusion attribute information can be used by the diagnostic agent to determine whether the current scenario is concurrent or mutually exclusive. Thus, the diagnostic agent can perform concurrent diagnostic procedures or mutually exclusive preemptive diagnostic procedures by performing corresponding session management operations. The diagnostic agent sends a diagnostic response message back to the diagnostic device in response to the diagnostic request message in the first frame format, indicating the session management result. The diagnostic response message can use the second frame format included in the on-board diagnostic mutual exclusion protocol, which includes at least session management result information, such as session establishment success or failure, session preemption success or failure, and the exit time of the conflicting preempted session. The specific formats of the first frame format and the second frame format can refer to the frame formats of most other communication protocols of the vehicle network, and the embodiments of the present application do not limit this.
[0171] In another example, if the on-board diagnostic mutual exclusion protocol is a supplementary protocol to the existing on-board diagnostic protocol, the on-board diagnostic mutual exclusion protocol can be a supplementary explanation and description of the reserved values not specified in the existing on-board diagnostic protocol, so as to introduce diagnostic logic for concurrent diagnosis and mutual exclusion diagnosis into the existing on-board diagnostic protocol and improve the diagnostic process. For example, if the existing on-board diagnostic protocol stipulates that the diagnostic request message adopts the third frame format, the reserved value when the diagnostic request message adopts the third frame format can be supplemented and explained, and the payload field of the third frame format (for example, represented as the first field) can also be supplemented and explained to carry request information that matches the extended meaning of the reserved value, such as the mutually exclusive attribute information of the first session. If the existing on-board diagnostic protocol stipulates that the diagnostic request message adopts the fourth frame format, the reserved value when the diagnostic response message adopts the fourth frame format can be supplemented and explained, and the payload field of the fourth frame format (for example, represented as the second field) can also be supplemented and explained to carry response information that matches the extended meaning of the reserved value, such as the session management result. The embodiment of the present application does not limit the specific position of the request information or response information of the extended definition in the corresponding frame format.
[0172] Regardless of which of the above examples is used to introduce the on-board diagnostic mutual exclusion protocol, the mutual exclusion attribute information for the first session carried in the diagnostic request message may include at least one of the following: a function identifier, priority information, or an exit protection time. The function identifier indicates the sub-functions supported by the on-board diagnostic mutual exclusion protocol, such as establishing a session, releasing a session, and querying session status. Priority information indicates the session priority supported by the on-board diagnostic mutual exclusion protocol. In mutually exclusive diagnostic scenarios (e.g., diagnosing the same target ECU), a higher-priority session can preempt a lower-priority session, allowing the diagnostic device associated with the higher-priority session to perform on-board diagnostics on the target ECU first. A lower-priority session cannot preempt a higher-priority session and must wait for the higher-priority session to be released before establishing the lower-priority session and transmitting diagnostic messages to the target ECU using the lower-priority session's diagnostic channel. The exit protection time is used to set a session to an exit state when it is preempted and to release the session after the exit protection time has expired.
[0173] Accordingly, session management operations may include any of the following operations: establishing a session, preempting a session, releasing a session, or querying session status. The session management result carried in the diagnostic response message may include at least one of the following information: a function identifier, such as the function identifiers for establishing a session, releasing a session, or querying session status; a response result, such as session establishment success, session establishment failure, preemption not supported, preemption failure, current session status; a waiting timeout (used to indicate the exit protection time for the preempted session); and so on.
[0174] It should be understood that the specific content of the mutually exclusive attribute information or session management results here and their message frame format are only examples and not limitations. In actual applications, the mutually exclusive attribute information or session management results can be carried in messages corresponding to different protocols based on experience or business needs. The specific location and / or meaning of the carrying field may be different in different protocols, and the embodiments of the present application do not limit this.
[0175] The following describes the first frame format of a diagnostic request message and the second frame format of a diagnostic response message, taking the on-board diagnostic mutually exclusive protocol as an example, which is a supplementary protocol to at least one existing on-board diagnostic protocol.
[0176] Among them, the at least one existing on-board diagnostic protocol may include but is not limited to the DoIP protocol or DoCAN protocol mentioned above, and the third frame format of the diagnostic request message or the fourth frame format of the diagnostic response message can be shown in Figure 3b or Figure 3c. The first frame format can reuse the third frame format, and the second frame format can reuse the fourth frame format. The meaning of the specific content carried by the diagnostic request message when using the first frame format is different from that when using the third frame format, and the meaning of the specific content carried by the diagnostic request message when using the second frame format is different from that when using the fourth frame format.
[0177] During implementation, the diagnostic device 210-i (i.e., the initiator of the diagnostic request, or the sender of the diagnostic request message and the receiver of the diagnostic response message) can use the first frame format and a supplementary explanation of the reserved value when the diagnostic request message uses the third frame format to determine the diagnostic request message to be sent, which can carry the mutually exclusive attribute information of the first session.
[0178] Accordingly, the diagnostic agent device 154 (i.e., the responder of the diagnostic request, or the receiver of the diagnostic request message, the sender of the diagnostic response message) can identify and parse the mutually exclusive attribute information in the received diagnostic request message to determine whether there is a concurrent diagnostic scenario or a mutually exclusive diagnostic scenario, so as to trigger a concurrent diagnostic process or a preemptive process when there is a concurrent diagnostic scenario or a mutually exclusive diagnostic scenario, and ensure the normal operation of multiple diagnostic channels by executing session management operations, thereby ensuring the reliability of on-board diagnosis.
[0179] Furthermore, the diagnosis agent 154 may adopt the second frame format and a supplementary interpretation of the reserved value when the diagnosis response message adopts the fourth frame format to determine the diagnosis response message, which may carry the session management result.
[0180] For ease of understanding, the following uses the DoIP protocol and the DoCAN protocol with the UDS service enabled as examples to illustrate the meaning of the specific content of the first frame format or the second frame format in the embodiment of the present application.
[0181] Example 1: On-board diagnostics mutually exclusive protocol supported by the DoIP protocol.
[0182] Currently, the ISO 13400 series of standards defines the application scenarios and implementation details of DoIP technology. Taking the DoIP message type (or payload type) defined in ISO 13400-2 as an example, as shown in Table 1 below:
[0183] Table 1
[0184]
[0185] In Table 1, "0x" indicates hexadecimal. The values in the first column are DoIP payload type values defined in ISO 13400-2. This type value is carried in the "Data Type" field shown in Figure 3b and indicates the purpose of the DoIP message. For example, 4001 is used to query the DoIP entity status, 4002 is used to respond to feedback on the DoIP entity status, 4003 is used to diagnose power mode information, 4004 is used to respond to feedback on power mode information, 4005-8000 are undefined, 8001 is used to request diagnostic information, 8002-8003 are used for positive and negative responses to feedback diagnostic information, respectively, 8004-EFFF are undefined, and F000-FFFF are reserved for vendor use. Columns 2 through 6 are used to explain the type value in the first column, such as the payload type name, the subclause specified (the subclause that specifically specifies the payload type value), whether DoIP gateways or DoIP nodes are supported, and the supported ports and protocols.
[0186] In an optional implementation method of an embodiment of the present application, the on-board diagnostic mutual exclusion protocol supported by the DoIP protocol can, for example, be an extended definition of the reserved load type value not defined in ISO 13400 in Table 1, so that the mutual exclusion attribute information of the on-board diagnostic mutual exclusion protocol specification of the embodiment of the present application can be carried in the DoIP message, so that the DoIP protocol supports the on-board diagnostic mutual exclusion protocol of the embodiment of the present application.
[0187] As an example, the protocols 0x8004 and 0x8005 can be extended as supplementary protocols, as shown in Table 2 below. Accordingly, the payload field or other fields of the DoIP message corresponding to 0x8004 can carry information related to the mutually exclusive diagnosis request, such as the mutually exclusive attribute information of the first session, and the payload field or other fields of the DoIP message corresponding to 0x8005 can carry information related to the diagnosis response, such as the session management result, as shown in Figure 3b.
[0188] Table 2
[0189]
[0190] Among them, the DoIP message carrying 0x8004 can also be called a session request message, which is an example of an extended diagnostic request message in an embodiment of the present application. The message can be triggered by the above-mentioned diagnostic device and sent to the diagnostic agent device and / or target ECU on the vehicle side. The DoIP message carrying 0x8005 can also be called a session response message, which is an example of an extended diagnostic response message in an embodiment of the present application. The message can be obtained by the diagnostic agent device or the target ECU in response to the diagnostic request message and fed back to the diagnostic device. For the explanation of the type values 0x8004 and 0x8005 in the first column in the second to sixth columns of Table 2, please refer to the similar content in Table 1. In specific applications, the protocol details such as sub-clauses specifying the type value not shown in Table 2 can also be supplemented. For example, please refer to the similar content in Table 1, which will not be repeated here.
[0191] For example, for the session request message, adapted to the DoIP protocol, in the payload of the DoIP message carrying 0x8004, the content of the mutually exclusive attribute information of the first session is carried, for example, including part or all of the content shown in Table 3, and other information associated with the mutually exclusive attribute information is carried in the relevant fields of the DoIP message, for example, the byte length information occupied by the mutually exclusive attribute information is carried in the "data length" field shown in Figure 3b:
[0192] Table 3
[0193]
[0194]
[0195] The above-mentioned “entry” represents mutually exclusive attribute information of the extended definition, such as the function identifier, priority information or exit time (or exit protection time) of the sub-function.
[0196] "Position" indicates the starting position of the specific values corresponding to the various mutually exclusive attribute information defined in the extended definition in the payload field. For example, if the payload field only carries the mutually exclusive attribute information in Table 3, the function identifier can start at the first byte of the payload field, represented by 0 bytes; the priority information can start at the second byte of the payload field, represented by 1 byte; the exit time can start at the third byte of the payload field, represented by 2 bytes and 3 bytes. If the payload field also includes information other than the mutually exclusive attributes, as shown in Figure 3b, then this information can start sequentially at the bytes after the byte position where the exit time ends. For example, assuming that the exit time ends at the fourth byte of the payload field, the source address can be located at the fifth and sixth bytes of the payload field, the destination address can be located at the seventh and eighth bytes of the payload field, and the UDS / OBD data can be located at the remaining bytes of the payload field.
[0197] "Length" indicates the byte length of the specific value corresponding to each mutually exclusive attribute information item in the payload field. For example, the function identifier and priority information occupy 1 byte, and the exit time occupies 2 bytes. The total byte length of each mutually exclusive attribute information item in the payload field can be carried in the "Data Length" field as shown in Figure 3b. It should be understood that in actual applications, if the payload field includes content other than the mutually exclusive attribute information items, the length value indicated in the "Digital Length" field is the total byte length of the payload field.
[0198] "Description" is used to explain the specific meaning of each mutually exclusive attribute information. "Value" is used to indicate the specific value corresponding to each mutually exclusive attribute information carried at each byte position. For example, for a function identifier, 0x01 can indicate establishing a session, 0x02 can indicate releasing a session, and 0x03 can indicate querying the session status. For another example, for priority, 0 can be the default highest priority, and the higher the value, the lower the priority. For another example, for exit time, it can be in milliseconds (ms), and the value can be between 0-65535ms, for example. It should be understood that in the embodiments of the present application, in Table 3 and Table 4 below, the different functions corresponding to the "Description" item and the specific values corresponding to the "Value" item are only examples and not any limitations, and the correspondence between different functions and different values is also not limited. In actual applications, other functions and other values for indicating functions can be expanded and defined based on application scenarios or business requirements, etc., which will not be repeated here.
[0199] "Support conditions" are used to indicate the support conditions of each mutually exclusive attribute information, such as mandatory items (for example, represented by M), optional items (for example, represented by C), or user-defined selections (for example, represented by U), etc., indicating whether the content of each mutually exclusive attribute information must be included in the session request message.
[0200] It should be understood that Table 3 above is merely an example of mutually exclusive attribute information and does not limit it in any way. In other embodiments, the session request message may also carry or append other optional mutually exclusive attribute information, and each piece of mutually exclusive attribute information may be represented by other values, which is not limited in this embodiment of the present application. Furthermore, the position of each piece of mutually exclusive attribute information in the payload field may be before the byte position where the source address is located, or after the byte position where the UDS / OBD data is located. This embodiment of the present application does not limit the specific position of the mutually exclusive attribute information in the payload field.
[0201] It should be noted that, in the embodiments of the present application, for priority information, the default highest priority can be understood in two ways. In one understanding, the highest priority is only used for evaluation in scenarios where sessions need to be preempted. For example, when a new session is established and conflicts with an established session, the new session with the highest priority can preempt the diagnostic channel associated with the conflicting session with a lower priority, and the new session with a lower priority cannot preempt the diagnostic channel associated with the conflicting session with the highest priority. The conflicting session here can be understood as an established session that conflicts with the newly established session. In another understanding, the highest priority can also represent an exclusive attribute, and a session with an exclusive attribute cannot coexist with other sessions. For example, if the established session has the highest priority, then a new session cannot be established and the establishment of the new session needs to be rejected; or, if the new session to be established has the highest priority, then all currently established sessions need to be released. This will be described below in conjunction with the embodiments and will not be elaborated here.
[0202] It can be understood that when the diagnostic device encapsulates the diagnostic request message based on Table 3, it can carry the version number of the supplementary on-board mutually exclusive diagnostic protocol in the "Protocol Version" field shown in Figure 3b, or carry the reverse protocol version number of the supplementary on-board mutually exclusive diagnostic protocol in the "Reverse Protocol Version" field, and carry 0x8004 in the "Data Type" field to indicate that the diagnostic request message is a session request message. Accordingly, the payload field carries the mutually exclusive attribute information defined in Table 3, and the "Data Length" field carries the length of the payload. The embodiment of the present application does not limit the encapsulation protocol layer or encapsulation position of other message contents. For detailed implementation, please refer to the relevant protocol constraints of the DoIP protocol, which will not be repeated here.
[0203] For the session response message, adapted to the DoIP protocol, in the payload of the DoIP message carrying 0x8005, the response information to the session request message, such as the session management result, is carried, which may include but is not limited to part or all of the content shown in Table 4. Other information associated with the response information is carried in the relevant fields of the DoIP message, for example, the byte length information occupied by the response information is carried in the "data length" field as shown in Figure 3b.
[0204] Table 4
[0205]
[0206]
[0207] Among them, the content of Table 4 is a response to the request information of Table 3. Similar to Table 3, the above "table items" represent the extended defined session management results, such as function identifiers, results (including result 1 and / or result 2).
[0208] For example, if the request message indicates session establishment, the function identifier in the session response message is 0x01, indicating session establishment. Result 1 can include any of the following: 0x00, indicating successful session establishment; 0x01, indicating preemption failure; 0x02, indicating preemption is not supported; 0x03, indicating that the session (e.g., the conflicting session being preempted) is exiting and needs to wait until the timeout. Result 2 can include: k, indicating the waiting timeout for the new session (i.e., the exit protection time for the conflicting session being preempted). The value of k can be between 0 and 65535ms.
[0209] If the request message indicates to release the session, the function identifier value in the session response message is 0x02, indicating that the session is released. Result 1 may include: 0x00, indicating that the session is released successfully; 0x01, indicating that the release fails. Result 2 may not be included in the message.
[0210] If the request information indicates querying the session status, the function identifier value in the session response message is 0x03, indicating feedback of session status information. Result 1 may include: 0x04, indicating that the currently queried session is in normal working state; 0x05, indicating that the currently queried session is in exit state; 0x06, indicating that the currently queried session is in initial state, etc.
[0211] It should be noted that, in Table 4, the relevant explanations of "position", "length", "description", "value" and "support conditions" can be found in the relevant introduction in conjunction with Table 3 above, and will not be repeated here. It should be noted that the different functions corresponding to "description" and the specific values corresponding to "value" in Table 4 are only examples, not any limitations. In specific applications, the specific values of result 1 specified in the on-board mutual exclusion diagnostic protocol may have different meanings. For example, in the above explanation of Table 4, 0x00 indicates that the session is successfully established; 0x01 indicates that preemption fails; 0x02 indicates that preemption is not supported; 0x03, the conversation (such as the conflicting session that is preempted) is exiting and needs to wait until the timeout; 0x04, indicates that the currently queried session is in normal working state; 0x05, indicates that the currently queried session is in the exit state; 0x06, indicates that the currently queried session is in the initial state, etc. Alternatively, the specific value of result 1 may have different meanings when the same value is associated with different function identifiers. For example, when the sub-function is to establish a session, 0x00 may indicate that the session was successfully established. When the sub-function is to preempt a session, 0x00 may indicate that the session was successfully preempted but the session is exiting and needs to wait until the timeout period. For another example, when the sub-function is to establish a session, 0x01 may indicate that the session failed to be established. When the sub-function is to preempt a session, 0x01 may indicate that preemption is not supported. This embodiment of the present application does not limit this.
[0212] It should be noted that Tables 2-4 above are merely examples of the DOIP protocol, and are provided as an illustrative explanation of the content of the mutually exclusive attribute information and the content of the response information defined by the on-board diagnostic mutual exclusion protocol of the embodiment of the present application introduced into the on-board diagnostic protocol. This is not intended to be limiting. In other embodiments, the on-board diagnostic mutual exclusion protocol supported by the on-board diagnostic protocol may also be extended to define other mutually exclusive attribute information or response information. The location of the extended mutually exclusive attribute information or response information in the message may not be limited to the payload field of the original protocol, and this is not limited in this embodiment of the present application. Similarly, in on-board diagnostic protocols other than the DOIP protocol in FIG3a, such as the DoCAN protocol, the CoFR protocol, the LIN protocol, etc., similar methods may be used for extension definition and configuration, so that the DoCAN protocol, the CoFR protocol, the LIN protocol, etc. support the on-board diagnostic mutual exclusion protocol of the embodiment of the present application. Similarities can be referred to each other and will not be repeated here.
[0213] It is understandable that the above Tables 1 to 4 are only examples of partial contents contained in the DOIP message. The DOIP message may also include other information not shown, as shown in FIG3 b , which will not be described in detail here.
[0214] Example 2: On-board diagnostics mutually exclusive protocol supported by the DoCAN protocol.
[0215] Currently, the DoCAN protocol enables the UDS service. The ISO 14229 series of standards (including ISO 14229-1) defines the application scenarios and implementation details of the UDS technology. Table 5 below shows the different service identifier values (SIDs) defined in the ISO 14229 series of standards and their meanings:
[0216] Table 5
[0217]
[0218] In Table 5, "0x" represents hexadecimal. The SID value in the first column represents the UDS service defined by the ISO 14229 series of standards and is used to indicate the purpose of the message carrying this identifier. For example, in a DoCAN message with the UDS service enabled, the SID value and service-related parameters can be carried in the "Data Field" field as shown in Figure 3c to indicate the UDS service corresponding to the DoCAN message. The second and third columns are used to explain the SID value in the first column, such as the service type and definition source (i.e., which protocol defines it).
[0219] In an optional implementation method of an embodiment of the present application, the on-board diagnostic mutual exclusion protocol supported by the UDS service can, for example, be an extended definition of the reserved SID value of ISO 14229-1 shown in Table 5, so that the mutual exclusion attribute information or response information of the on-board diagnostic mutual exclusion protocol specification of the embodiment of the present application can be carried in the extended UDS message, so that the UDS service supports the on-board diagnostic mutual exclusion protocol of the embodiment of the present application.
[0220] As an example, the extended definition of 0x80 may indicate a mutually exclusive request service, and the extended definition of 0xBF may indicate a mutually exclusive response service, as shown in Table 6. Accordingly, the mutually exclusive attribute information associated with 0x80 may be carried in the payload field (e.g., data field) of the same message, and the response information associated with 0xBF may be carried in the payload field (e.g., data field) of the same message.
[0221] Table 6
[0222] Service Identifier Value Service Type Definition Source 0x80 Mutex Request New Definition 0xBF Mutex Response New Definition
[0223] Among them, the UDS message carrying the value of 0x80 and mutually exclusive attribute information can also be called a mutually exclusive request message, which is an example of the diagnostic request message of the embodiment of the present application. The message can be triggered by the diagnostic device and sent to the diagnostic agent device on the vehicle side. The UDS message carrying the value of 0xBF and response information can also be called a mutually exclusive response message, which is an example of the diagnostic response message of the embodiment of the present application. The message can be responded to by the diagnostic agent device for the diagnostic request message from the diagnostic device and fed back to the diagnostic device. For the on-board diagnostic protocols with UDS service enabled, such as DoIP protocol, DoCAN protocol, etc., according to the extended definition of Table 6, through the extended definition of the UDS service and the extended definition of the specific content of the carried payload, these on-board diagnostic protocols with UDS service enabled can support the on-board diagnostic mutually exclusive protocol of the embodiment of the present application, which will not be repeated here.
[0224] For example, for the mutual exclusion request message, adapted to the UDS protocol, the message carrying the 0x80 may carry the content of the mutual exclusion attribute information of the first session, for example, including part or all of the content shown in Table 7 below:
[0225] Table 7
[0226]
[0227]
[0228] Among them, "single data byte" represents a single byte position in the "data domain" field, which is used to carry the SID of the UDS service and the corresponding service parameters, such as mutually exclusive attribute information. Among them, in Table 7, the first column represents a single byte position, and the second to sixth columns are explanations of the specific content carried by the single byte position, such as parameters, names, agreed values, byte values, mnemonics, etc. Among them, "parameter" is used to indicate the meaning of the parameters carried by each byte position, "name" is used to indicate the parameter name, "agreed value" can include three types, namely: mandatory items (M), optional items (C), user-defined options (U), and "byte value" is used to indicate the specific parameter value carried by a single byte position. "Mnemonic" is used to carry the mnemonic symbols of the parameters carried by each byte position. For details, please refer to the relevant UDS protocol and will not be repeated here.
[0229] For example, in Table 7, the first byte position (denoted as #1) can be used to carry the SID value, such as 0x80; the second byte position (denoted as #2) can be used to carry the function identifier value of the sub-function, such as 0x01 for establishing a mutually exclusive session; 0x02 for releasing a mutually exclusive session; and 0x03 for querying the session status. The third byte position (denoted as #3) and the fourth byte position (denoted as #4) can be used to carry the high-byte and low-byte values of the source address, and the fifth byte position (denoted as #5) and the sixth byte position (denoted as #6) can be used to carry the high-byte and low-byte values of the destination address. The seventh byte position (denoted as #7) can be used to carry priority information. The priority value can range from 00 to FF (in hexadecimal), with lower values indicating higher priority. The eighth byte position (denoted as #8) and the ninth byte position (denoted as #9) can be used to carry the high-byte and low-byte values of the session exit time, ranging from 00 to FF in milliseconds.
[0230] It should be noted that in the embodiments of the present application, in Table 7 and Table 8 below, the different sub-functions shown in the "Name" column, the different response results, and the different values listed in the "Byte Value" are only examples and not any limitations. The correspondence between different functions and different values is also not limited. In actual applications, other functions and other values used to indicate functions can be expanded and defined according to application scenarios or business requirements, etc., which will not be repeated here.
[0231] For the mutually exclusive response message, in accordance with the UDS protocol, the message carrying the 0xBF may carry the response information corresponding to the request information shown in Table 7, for example, including part or all of the content shown in Table 8 below:
[0232] Table 8
[0233]
[0234] The information in Table 8 and Table 7 has similar meanings. "Single data byte" represents a single byte position in the "Data field" field, which is used to carry the SID of the UDS service and the corresponding service response information, such as session management results. In Table 8, the first column represents a single byte position, and the second to sixth columns are explanations of the specific content carried by the single byte position, such as parameters, names, agreed values, byte values, mnemonics, etc. "Parameter" is used to indicate the meaning of the parameter carried by each byte position, "Name" is used to indicate the parameter name, "Agreed value" can include three types, namely: mandatory item (M), optional item (C), and user-defined item (U), and "Byte value" is used to indicate the specific parameter value carried by a single byte position. "Mnemonic" is used to carry the mnemonic symbol of the parameter carried by each byte position. For details, please refer to the relevant UDS protocol and will not be repeated here.
[0235] For example, in Table 8, the first byte position (indicated as #1) can be used to carry the SID value, such as 0xBF; the second byte position (indicated as #2) can be used to carry the function identifier value of the sub-function, for example, 0x01, indicating establishing a mutually exclusive session; 0x02, indicating releasing a mutually exclusive session; 0x03, indicating querying the session status. The third byte position (indicated as #3) and the fourth byte position (indicated as #4) can be used to carry the high byte value and low byte value of the source address, and the fifth byte position (indicated as #5) and the sixth byte position (indicated as #6) can be used to carry the high byte value and low byte value of the destination address. The seventh byte position (denoted as #7) can be used to carry response result 1, for example, 0x00, indicating successful session establishment; 0x01, indicating preemption failure; 0x02, indicating preemption is not supported; 0x03, indicating that the session (e.g., the preempted conflicting session) is exiting and needs to wait until the timeout period; 0x04, indicating that the currently queried session is in normal working state; 0x05, indicating that the currently queried session is in the exit state; 0x06, indicating that the currently queried session is in the initial state, etc. In an optional implementation, the eighth byte position (denoted as #8) and the ninth byte position (denoted as #9) can be used to carry the high byte value and low byte value of the exit time, indicating the waiting timeout period for the new session (i.e., the exit protection period for the preempted conflicting session). The value can be between 00 and FF, and the unit can be milliseconds (ms).
[0236] It should be noted that the above Tables 6 to 8 are only examples of the DoCAN protocol with UDS enabled, and are illustrative explanations of the content and location of the mutually exclusive attribute information or response information extended and defined by the on-board diagnostic mutual exclusion protocol introduced by the DoCAN protocol in the embodiment of the present application. They are not limiting. In other embodiments, the on-board diagnostic mutual exclusion protocol supported by the UDS protocol can also extend the definition of other mutually exclusive attribute information or response information. The location of the extended mutually exclusive attribute information or response information in the message may not be limited to the payload field or data domain field of the original protocol. The embodiment of the present application does not limit this. Similarly, for other on-board diagnostic protocols that have enabled the UDS service, as well as other protocols that can replace the UDS protocol in future communications, similar methods can be used for extended definition and constraint configuration, so that the relevant on-board diagnostic protocols support the on-board diagnostic mutual exclusion protocol in the embodiment of the present application. This will not be repeated here.
[0237] It is understandable that the above Tables 6 to 8 are merely examples of partial contents contained in the DoCAN message based on the UDS protocol. The message may also include other information not shown, which will not be described in detail here.
[0238] It should be noted that Examples 1 and 2 of the present application only use the general network protocol layer architecture shown in FIG3a as an example to illustrate how to introduce the on-board diagnostic mutual exclusion protocol of the embodiment of the present application into at least one existing on-board diagnostic protocol, and are not intended to be limiting. In other embodiments, if a network protocol layer architecture other than that shown in FIG3a is used between the diagnostic device and the diagnostic agent, the frame format supporting the on-board diagnostic method of the embodiment of the present application can also be determined based on the specific network protocol layer architecture and the adopted on-board diagnostic protocol, and this will not be further described here.
[0239] The following explains the implementation principle of the on-board diagnostic method of the embodiment of the present application.
[0240] In an embodiment of the present application, in order to facilitate the management and implementation of the concurrent diagnostic processes or mutually exclusive preemption processes related to the on-board diagnostic mutual exclusion protocol specification, an optional implementation method is to introduce a session mechanism, through management operations on sessions associated with different diagnostic channels, such as establishing a session, preempting a session, releasing a session, and querying at least one of the session status operations, so as to manage the concurrent operation or mutually exclusive preemption operation of multiple diagnostic channels. Among them, the diagnostic agent device can be a VIU, and the VIU can maintain a session table for the ECUs attached to it, etc. The session table can record the session information of the established sessions, and the session information can be used to assist in the message transmission and logical judgment between the VIU and the diagnostic device to improve the concurrent diagnostic process or mutually exclusive preemption process. Alternatively, the diagnostic agent device can be the ECU itself, and any ECU can perform message transmission and logical judgment with the diagnostic device based on the on-board diagnostic mutual exclusion protocol of the embodiment of the present application to improve the concurrent diagnostic process or mutually exclusive preemption process of the embodiment of the present application. In an optional implementation, the ECU may also maintain a session table, in which the target object associated with the session information recorded in the session table is the ECU itself. The ECU may perform logical judgment and message transmission based on the session information in the session table.
[0241] Before introducing the on-board diagnostic method according to the embodiment of the present application, the session state is first introduced.
[0242] In the embodiment of the present application, as shown in FIG4 , a session associated with a diagnostic channel may include four states, as follows:
[0243] (1) Initial state (e.g., represented as Init):
[0244] Generally, after receiving a diagnostic request message based on the on-board diagnostic mutual exclusion protocol from the diagnostic device, if the message is used to request the establishment of a new session, the diagnostic agent device can start to establish a new session for diagnosis based on the mutual exclusion attribute information carried in the message, so that the new session enters the initial state.
[0245] Among them, in the initial state, the diagnostic agent device can perform a preliminary check to determine the next state of the session. For example, if there is no established session at present (for example, the session table is empty, or there is no session table, etc.), the new session can directly enter the normal working state from the initial state. If there is no session in the currently established sessions that conflicts with the new session to be established, the new session can directly enter the normal working state from the initial state. If there is a session in the currently established sessions that conflicts with the new session to be established and the new session can be preempted, the new session needs to wait for the conflicting session to exit, that is, to preempt the session, before it can enter the normal working state from the initial state. In the case of failure of the check, for example, the currently established session has an exclusive attribute and does not support the establishment of a new session, or the priority of the conflicting session is higher than the priority of the new session and does not support preemption, etc., it is necessary to delete the session currently in the Init state and enter the empty state.
[0246] (2) Normal working state (e.g., indicated as Normal):
[0247] Indicates that the session is in normal operation and is a working session. The diagnostic channel associated with this session can be used to send and receive diagnostic messages normally.
[0248] A working session can be preempted by other sessions, such as a new session associated with a request message with a higher priority. When a working session is preempted, it can be configured to transition from the Working state to the Exited state. When the session remains in the Exited state for a set Exit Protection Time, it is released and enters the Empty state.
[0249] (3) Exit status:
[0250] Indicates that the session currently needs to be released and the logout process is in progress.
[0251] Among them, the session currently needs to be released, for example, the session may be preempted by a high-priority session and needs to be released, or the diagnostic channel associated with the session may be idle (for example, no message transmission is performed) for more than a preset time, or the diagnostic device may actively request to release the session, etc. The embodiment of the present application does not limit the triggering scenario of the exit status of the session.
[0252] After the session has been in the Exit state for a preset Exit Protection Time, the session transitions from the Exit state to the Empty state. A session can be associated with an Exit Timer, which starts when the session is set to the Exit state. After the Exit Timer reaches the preset Exit Protection Time, the session transitions from the Exit state to the Empty state. Furthermore, in an optional design, a check is also triggered on sessions in the Init state to determine whether they can enter the Working state.
[0253] (4) Empty state (Delete):
[0254] Indicates that the session is released and the session information of the session has been deleted from the session table.
[0255] Among them, the session information can be deleted when the preempted session times out in the exit state, or when the session in the Init state fails the pre-check and cannot enter the working state. The embodiment of the present application does not limit this. For details, please refer to the relevant description above.
[0256] In the embodiment of the present application, as an example, the session table may include part or all of the content shown in Table 9 below:
[0257] Table 9
[0258] SaDa Priority Exit Time Status 0xXXXX 0x000111s Exiting 0xXXXX 0x0002210ms Init
[0259] Among them, each row other than the header in Table 9 corresponds to the session information of a session, "Sa" represents the source address of the diagnostic channel associated with the session, "Da" represents the destination address of the diagnostic channel associated with the session, "Priority" represents the priority information of the message associated with the session, "Exit Time" represents the exit protection time preset for the session, and "Status" represents the session status, such as any of the initial state, working state or exit state.
[0260] "0x" represents hexadecimal, and "XXXX" represents the source address information in hexadecimal, consisting of two bytes (high byte and low byte). The specific value of XXXX is not limited. "0001" and "0002" represent the destination address information in hexadecimal, consisting of two bytes (high byte and low byte). These values are examples, with "00" in the high byte and "01" and "02" in the low byte. "1" and "2" represent example priority values, using hexadecimal. "1s" and "10ms" are examples of session exit times, indicating the time it takes for a session to transition from the Exiting state to the Empty state. When a session reaches this exit time in the "Exiting" state, it transitions from the "Exiting" state to the "Delete" state, and the session is released. A session in the "Init" state can be checked to determine whether it has entered the Normal Operation state or the Empty state. A session in the "Normal" state can be preempted by a higher-priority session and transitioned to the Exiting state.
[0261] It should be noted that Table 9 is merely an example of a session table and the session information recorded therein, and does not limit the form or content of the session table.
[0262] In an optional embodiment of the present application, if the highest priority is understood as an exclusive attribute, on the one hand, if the session table indicates a session with the highest priority (e.g., 0), the session with the highest priority cannot coexist with other sessions. In this case, a new session cannot be created and no new session information can be added to the session table. On the other hand, if the mutually exclusive attribute information of the new session to be established indicates the highest priority (e.g., 0), the session with the highest priority cannot coexist with other sessions. In this case, all session information shown in Table 9 needs to be deleted, and the session associated with the session information needs to be released, so that the newly created session table only indicates the session with the highest priority.
[0263] In an optional embodiment of the present application, the maintained session table may only include Sa and Da associated with the activated diagnostic channel. The Sa and Da in the session table can be used by the diagnostic agent device to perform conflict judgment, and determine whether there is a conflict based on the diagnostic request message or routing activation request message from the diagnostic device. If there is a conflict, a negative response needs to be fed back to the diagnostic device.
[0264] In an optional embodiment of the present application, the source address information and destination address information recorded in the session information are associated with a session. When requesting to release a session, the diagnostic device can indicate the session by carrying the source address information and destination address information in the request message. Alternatively, the maintained session table can also include a unique identifier assigned to each session information. The diagnostic agent can indicate the identifier to the corresponding diagnostic device, and the diagnostic device can request to release the session based on the identifier. The embodiment of the present application does not limit the implementation method of releasing the session.
[0265] When implementing the on-board diagnostic method of the embodiments of the present application, the diagnostic agent can perform logical judgment based on the mutually exclusive attribute information carried in the received diagnostic request message and the session table, and perform session management operations based on the message type and the logical judgment result, thereby improving the on-board diagnostic method in concurrent diagnostic scenarios or mutually exclusive preemption scenarios. The session management operations may include any of the following operations: establishing a session, preempting a session, releasing a session, or querying the session status. For ease of understanding, the following describes each of these operations in conjunction with different scenarios.
[0266] Example 1: The function identifier carried in the diagnostic request message indicates that a session should be established.
[0267] In the scenario where a diagnostic request message involving session establishment is received, the logical judgment process of the embodiment of the present application may be as shown in FIG5 , including the following steps:
[0268] S501: The diagnostic device sends a diagnostic request message to the diagnostic agent device. The diagnostic request message is used to request diagnosis of a target object. Correspondingly, the diagnostic agent device receives the diagnostic request message.
[0269] S502: When the data type of the diagnosis request message indicates a session request or a mutual exclusion request, the diagnosis agent executes S503 and subsequent steps; otherwise, it executes S513 and subsequent steps.
[0270] Among them, the data type of the diagnostic request message indicates a session request or a mutual exclusion request (as shown in Table 2 and Table 6 above), indicating that the diagnostic request message is a message issued after the introduction of the on-board diagnostic mutual exclusion protocol of the embodiment of the present application, and a logical judgment is required based on the extended payload defined in the message to determine whether to execute and how to execute S503 and the subsequent mutual exclusion preemption process.
[0271] When the data type of the diagnostic request message indicates a session request or a mutual exclusion request, the diagnostic request message is a message sent without introducing the on-board diagnostic mutual exclusion protocol of the embodiment of the present application, and the subsequent S513-S516 process needs to be performed according to the existing on-board diagnostic protocol, as described below for details.
[0272] S503: The diagnostic agent device searches for session information of the established session to determine whether there is a conflicting session.
[0273] When implementing S503, the diagnostic agent may check whether it does not maintain a session table or whether the maintained session table contains session information for an established session. If no session table exists or the session table is empty, it indicates that no diagnostic session currently exists, i.e., no conflicting session exists, and the process proceeds to S512. If the session table includes a second session, and the target object corresponding to the second session is different from the target object corresponding to the first session, no conflicting session exists, and the process proceeds to S512.
[0274] If the session table includes the third session, and the target object corresponding to the third session is the same as the target object corresponding to the first session, it indicates that a conflicting session exists, and the process proceeds to S504.
[0275] S504: The diagnostic agent device determines whether the priority of the first session is higher than the priority of the conflicting session (eg, the third session).
[0276] If the priority of the first session is higher than the priority of the third session, the process proceeds to S505 ; if the priority of the first session is not higher than the priority of the third session, the process proceeds to S511 .
[0277] S505: The diagnostic agent performs a session preemption operation for the first session based on the priority information. For example, the diagnostic agent sets the first session to an initial state and sets the conflicting third session to an exit state. For example, when setting the third session to the exit state, an exit timer associated with the third session may be started.
[0278] S506: The diagnostic agent releases the conflicting session based on the session information. For example, after the exit timer of the third session reaches the preset exit time, the third session enters the empty state from the exit state, deletes the session information of the third session from the session table, and releases the third session. Simultaneously, the first session enters the working state from the initial state.
[0279] S507 (optional step): The diagnostic device may send a query request message to the diagnostic agent device. Correspondingly, the diagnostic agent device may receive the query request message from the diagnostic device. The query request message is used to request to query the status of the first session.
[0280] S508: The diagnosis agent device may send a response message to the diagnosis device, where the response message is used to indicate the status of the first session.
[0281] Among them, when implementing S507-S508, the diagnostic device can send a query request message to the diagnostic agent device in real time or periodically, or, S507 may not be implemented and only S508 may be implemented, that is, the diagnostic agent device actively reports the status of the first session to the diagnostic device, and the embodiment of the present application does not limit the query timing or reporting timing of the session status. In the case of implementing S507, the response message sent by S508 can be a query response message. In the case of not implementing S507, the response message sent by S508 can be a diagnostic response message corresponding to the diagnostic request message of S501.
[0282] For example, the state of the first session may include any of the following: an initial state, a working state, or an empty state. Based on the session state of the first session indicated by the response message in S508, if it is determined that the first session is in a working state, the diagnostic device may send a routing activation request message to the diagnostic agent device, and the routing activation request message may be used to activate the first diagnostic channel associated with the first session. When the first session is in the initial state, the diagnostic device needs to wait for the first session to switch from the initial state to the working state. When the first session is in an empty state, the diagnostic device abandons activating the first diagnostic channel associated with the first session.
[0283] It should be noted that, in an embodiment of the present application, the response message sent by S508 may explicitly indicate the status of the first session, or may implicitly indicate the status of the first session, and this embodiment of the present application does not limit this. In the explicit indication method, the diagnostic device may determine whether to execute S509 based on the indicated session status. In the implicit indication method, the response message sent by S508 is a diagnostic response message, which may carry the exit time of the preempted third session, and the exit time may be used as the waiting timeout time for the first session. The diagnostic device may start timing when receiving the diagnostic response message, and when the waiting timeout time is reached, it is considered that the first session has switched from the initial state to the normal working state, so that the diagnostic device may execute S509.
[0284] S509: When the diagnostic device determines that the first session is in a normal working state, it sends a routing activation request message to the diagnostic agent device. The routing activation request message is used to request activation of the first diagnostic channel associated with the first session.
[0285] S510: The diagnosis agent device activates the routing of the first diagnosis channel associated with the first session according to the received routing activation request message.
[0286] For example, the diagnostic agent device can parse the route activation request message and send a route activation response message to the diagnostic device. If the diagnostic agent device confirms that the first diagnostic channel can be activated, the route activation response message is a positive response, indicating that the route activation is successful. If the route activation is successful, the diagnostic device and the diagnostic agent device can maintain communication based on the first diagnostic channel and transmit messages. If the diagnostic agent device confirms that the first diagnostic channel cannot be activated, the route activation response message is a negative response, indicating that the route activation failed.
[0287] S511: When the priority of the first session is lower than or equal to the priority of the conflicting session (eg, the third session), the diagnosis agent returns a negative response to the diagnosis device, where the negative response indicates diagnosis mutual exclusion and preemption failure.
[0288] In another branch process, if it is determined in S503 that there is no conflicting session, steps S512 and S507 to S510 are executed.
[0289] S512: The diagnostic agent establishes a first session. Specifically, for example, if no conflicting sessions exist, the first session is set to a normal operating state. Furthermore, based on the state of the first session, the diagnostic agent may determine whether to activate routing for the first diagnostic channel associated with the first session. This process is described above with reference to S507-S509 and will not be further elaborated here.
[0290] In another branch process, if the result of the judgment in S502 is no, that is, the message type of the diagnosis request message does not indicate a session request or a mutual exclusion request, steps S513 to S516 are executed as follows:
[0291] S513: The diagnostic device sends a routing activation request message to the diagnostic agent. The routing activation request message is used to request activation of a first diagnostic channel between the diagnostic device and the diagnostic agent. In an optional implementation, the routing activation request message may include information about the first diagnostic channel, such as a source address and a destination address.
[0292] S514: The diagnostic agent may determine whether there is a conflict based on the information about the first diagnostic channel carried in the routing activation request message received in S513. For example, if the target object corresponding to the activated and used diagnostic channel is the same as the target object corresponding to the first diagnostic channel requested to be activated by the routing activation request message, a conflict exists. If a conflict exists, the process proceeds to S515. Otherwise, there is no conflict and the process proceeds to S516.
[0293] It should be noted that in an optional embodiment of the present application, regardless of whether the vehicle supports the on-board diagnostic mutual exclusion protocol of the embodiment of the present application, a session table can be maintained for the activated and used diagnostic channels, and the source address and destination address associated with the activated and used diagnostic channels can be recorded in the session table. When implementing S514, the diagnostic agent device can determine whether there is a conflict based on the address information indicated in the routing activation request message and the address information recorded in the session table. If the destination address indicated in the routing activation request message is the same as the destination address recorded in the session table, there is a conflict. If the destination address indicated in the routing activation request message is different from the destination address recorded in the session table, there is no conflict. The embodiment of the present application does not limit the method for judging this conflict method.
[0294] S515: The diagnosis agent device feeds back a routing activation response message to the diagnosis device. The routing activation response message is a negative response, indicating that the diagnosis is mutually exclusive and the routing activation request is rejected.
[0295] S516: The diagnostic agent device activates routing for the first diagnostic channel.
[0296] For example, upon confirming that the first diagnostic channel can be activated, the diagnostic agent sends a route activation response message to the diagnostic device. The route activation response message is a positive response, indicating successful route activation. If route activation is successful, the diagnostic device and the diagnostic agent can maintain communication and transmit messages based on the first diagnostic channel.
[0297] In an optional implementation, the highest priority can be understood as an exclusive attribute. In this case, it is also necessary to determine in S503 whether the mutually exclusive attribute information carried in the diagnostic request message indicates that the first session has an exclusive attribute, or to determine whether the session table includes information indicating an exclusive attribute. If the mutually exclusive attribute information indicates that the first session has an exclusive attribute, then after S503, the diagnostic agent device may need to release all sessions associated with the session information in the session table, establish a first session, and feedback response information to the diagnostic device. If the session table includes information indicating an exclusive attribute, the establishment of a new session is not currently supported. Then, after S503, the diagnostic agent device may feedback a negative response to the diagnostic device, indicating that the establishment of the first session is refused.
[0298] Therefore, through the logical judgment process shown in Figure 5, when the diagnostic agent device receives a diagnostic request message involving establishing a session, the diagnostic agent device can perform logical judgment based on the mutually exclusive attribute information carried in the diagnostic request message and the session information recorded in the session table to decide how to execute the concurrent diagnostic process or the mutually exclusive preemption process of the embodiment of the present application.
[0299] Example 2: The function identifier carried in the diagnosis request message indicates to release the session, or the diagnosis agent actively releases the session.
[0300] For an established session, the diagnosis agent device may also release the corresponding session and delete the corresponding session information of the session in the session table through at least one logical judgment branch process.
[0301] For example, the diagnostic device may request to exit the target session in an established session. In this case, the diagnostic device may release the session by indicating the function identifier carried in the diagnostic request message. Alternatively, when the communication link between the diagnostic agent and the diagnostic device is disconnected, the diagnostic agent may release all sessions maintained for the diagnostic device. Alternatively, the diagnostic agent may release the target session when the target session in an established session times out. Alternatively, the diagnostic agent may clear all session information when the device to which it belongs is restarted.
[0302] As shown in FIG6 , in one scenario, in a branch process, when the diagnostic apparatus requests to exit the target session, the process of releasing the target session in the established session may include the following steps:
[0303] S601: The diagnosis agent receives a diagnosis request message from the diagnosis device.
[0304] For example, in the mutually exclusive attribute information carried by the diagnosis request message, the value carried by the byte position of "Function Identifier of Sub-Function" is 0x02, indicating that the session is released.
[0305] S602: The diagnostic agent determines whether there is a matching target session based on the mutually exclusive attribute information carried in the diagnostic request message and the session table. If yes, proceed to S603, or S603 and S604; otherwise, proceed to S605.
[0306] S603: The diagnostic agent device releases the target session.
[0307] S604: The diagnosis response message fed back by the diagnosis agent to the diagnosis device indicates a positive response, indicating that the target session is released successfully.
[0308] S605: The diagnostic response message fed back by the diagnostic agent to the diagnostic device indicates a negative response, indicating that the target session does not exist and the release of the target session fails.
[0309] In another branch process, when the communication link between the diagnostic agent device and the diagnostic device is disconnected, the session release process may include the following steps:
[0310] S606: The diagnostic agent detects that the communication link between the diagnostic agent and the diagnostic device is disconnected.
[0311] S607: The diagnostic proxy device releases all sessions maintained for the disconnected diagnostic device.
[0312] In another branch process, the diagnosis agent device may release the target session in the established session when the target session times out. The session release process may include the following steps:
[0313] S608: The diagnosis agent device determines a target session for diagnosis timeout among the established sessions.
[0314] S609: The diagnostic agent device releases the target session.
[0315] In another branch process, the diagnostic agent device may clear all session information when the device to which it belongs is restarted. The session release process may include the following steps:
[0316] S610: The diagnostic agent determines that the device to which it belongs is restarted.
[0317] S611: The diagnosis agent device clears all session information in the session table. In an optional implementation, the diagnosis agent device may also delete an empty session table.
[0318] In the case where the highest priority is understood to be exclusive, if the newly created session has the exclusive attribute, it will also trigger the release process of the established session. Therefore, in another branch process, the diagnostic agent device can release the established session when it is necessary to create a new session with the exclusive attribute. The session release process may include the following steps:
[0319] S612: The diagnostic agent receives a mutually exclusive message indicating that a target session is to be established, and the target session has an exclusive attribute. For example, if the priority information included in the mutually exclusive message indicates that the target session has the highest priority (e.g., the value of the byte position carrying the priority information in the mutually exclusive message is 0, indicating the highest priority), then the target session has an exclusive attribute and does not support the coexistence of multiple sessions.
[0320] S613: The diagnosis agent device releases all sessions corresponding to the existing session table, and establishes a target session and a new session table indicating an exclusive attribute, and the session information of the target session is recorded in the session table.
[0321] It is understood that FIG6 is merely an example of the logical judgment process for releasing an established session that may be involved in an embodiment of the present application and does not constitute any limitation. In other embodiments, the diagnostic agent device may monitor the diagnostic channel and session status and release the session when necessary. For example, when a diagnostic channel does not transmit a message within a first time period (which can be determined based on the business scenario or diagnostic requirements, such as 5 minutes, which is not limited in the embodiment of the present application), the diagnostic agent device may make a decision to release the session associated with the diagnostic channel to reduce unnecessary resource usage.
[0322] Therefore, based on the extended protocol, combined with the logical judgment process shown in Figures 5 and 6, the above text flexibly implements the mutual exclusion preemption process in the business preemption scenario, the concurrent diagnosis process in the concurrent diagnosis scenario, etc. in different situations, thereby improving the reliability of on-board diagnosis.
[0323] FIG7 is a flow chart of an on-board diagnostic method according to an embodiment of the present application. The method may be implemented by the interaction of a diagnostic device, a diagnostic agent, and a target object to be diagnosed (e.g., a target ECU) as shown in FIG2 . As shown in FIG7 , the method may include the following steps:
[0324] S710: The diagnostic device may determine a diagnostic request message according to the target diagnostic task and send the diagnostic request message to the diagnostic agent device. Accordingly, the diagnostic agent device receives the diagnostic request message from the diagnostic device.
[0325] In an embodiment of the present application, the diagnostic device supports at least one of the on-board diagnostic protocols described above, as well as the on-board diagnostic mutual exclusion protocol described above in the embodiment of the present application. The diagnostic request message is used to request fault diagnosis of a target object on the vehicle side. The diagnostic request message may include mutually exclusive attribute information of a first session, wherein the first session is associated with a first diagnostic channel, and the first diagnostic channel is a communication channel that the diagnostic device expects to establish with the target ECU, or the first diagnostic channel is a communication channel that the diagnostic device already maintains with the target ECU.
[0326] S720: The diagnosis agent device may perform a session management operation according to the mutually exclusive attribute information of the first session.
[0327] S730: The diagnosis agent sends a diagnosis response message to the diagnosis device. The diagnosis response message is used to indicate the session management result.
[0328] In the embodiment of the present application, the session management operation may include any of the following operations: establishing a session, seizing a session, releasing a session, or querying a session status.
[0329] When implementing S720, the diagnostic agent device can parse the mutually exclusive attribute information carried in the diagnostic request message, and determine whether it is a concurrent diagnostic scenario or a diagnostic mutually exclusive scenario in combination with the current scenario. For example, if at least two diagnostic devices initiate diagnostic requests to different target objects, it is a concurrent diagnostic scenario; if at least two diagnostic devices initiate diagnostic requests to the same target object, it is a diagnostic mutually exclusive scenario. Subsequently, corresponding session management operations are performed in different scenarios, such as establishing a session, preempting a session, releasing a session, querying session status, etc. In this process, an optional implementation method is that the diagnostic agent device can obtain a session table (as shown in Table 9 above), and perform corresponding session management operations based on the mutually exclusive attribute information of the first session and the session table.
[0330] The session table obtained in S720 may include session information for one or more ECUs, depending on the diagnostic tasks of different diagnostic devices for different target objects, indicating session information for sessions associated with diagnostic channels between the diagnostic devices and the target ECUs. Based on the mutually exclusive attribute information of the first session and the session information in the session table, the diagnostic agent can determine whether multiple currently existing or upcoming diagnostic channels are in the concurrent diagnostic scenario or mutually exclusive diagnostic scenario described in the embodiments of this application. Thus, during the execution of session management operations, the diagnostic agent can execute the corresponding concurrent diagnostic process or mutually exclusive preemption process according to the diagnostic strategy or mutually exclusive preemption strategy corresponding to each scenario, thereby ensuring the orderly operation of multiple diagnostic channels and improving the accuracy of on-board diagnosis.
[0331] Based on the session state transition process and the logic judgment process described above in conjunction with FIG. 4 to FIG. 6 in the embodiment of the present application, in the on-board diagnostic method of the embodiment of the present application, when implementing S720, corresponding session management operations can be performed based on the mutually exclusive attribute information of the first session and the conditions satisfied by the session table, such as the following situations:
[0332] (1) When the mutually exclusive attribute information of the first session and the session table satisfy any of the following first conditions, the operation of establishing the first session is performed:
[0333] Solution a: The mutually exclusive attribute information of the first session indicates that a session is to be established, and the session table is empty. Alternatively, the mutually exclusive attribute information of the first session indicates that a session is to be established, and there is no session table currently.
[0334] That is, when no established session currently exists, the diagnosis agent device can directly establish the first session for the diagnosis device according to the received diagnosis request message, and maintain a session table containing session information of the first session.
[0335] Solution b. The mutually exclusive attribute information of the first session indicates that a session is established, and the session table includes session information of a second session, wherein the second session is associated with a second diagnostic channel, and the target object corresponding to the second diagnostic channel is different from the target object corresponding to the first diagnostic channel.
[0336] That is, when there is no session associated with the same target object as the first session in the currently established sessions, the first session and the currently established sessions do not conflict or mutually exclude each other. In this case, the diagnosis agent device can directly establish and run the first session.
[0337] In solution a and solution b of scenario (1), the diagnostic response message is used to indicate the result of establishing the first session. If the first session is successfully established, the diagnostic response message is used to indicate a positive response, indicating that the first session is successfully established. If the first session fails to be established, the diagnostic response message is used to indicate a negative response, indicating that the first session fails to be established.
[0338] In one optional implementation, the highest priority can be understood as an exclusive attribute. In solution b above, the priority of the second session is lower than the preset highest priority, meaning that the second session does not have the exclusive attribute. In other words, if the second session has the exclusive attribute, the first session cannot be established in solution b above.
[0339] (2) When the mutually exclusive attribute information of the first session and the session table meet the following second condition, the session preemption operation is performed for the first session:
[0340] The mutually exclusive attribute information of the first session indicates that a session is established, and the session table includes session information of a third session, wherein the third session is associated with a third diagnostic channel, the target object corresponding to the third diagnostic channel is the same as the target object corresponding to the first diagnostic channel, and the priority of the first session is higher than the priority of the third session.
[0341] That is, when the first and third diagnostic channels correspond to the same target object, this is a mutually exclusive diagnostic scenario, and the sessions associated with these two diagnostic channels conflict. If the priority of the first session is higher than the priority of the third session, the diagnostic agent can perform a session preemption operation for the first session to preempt the resources of the conflicting third session, so that in the mutually exclusive diagnostic scenario, the first diagnostic channel is prioritized for on-board vehicle diagnosis.
[0342] In this scenario (2), the diagnostic response message is used to indicate the result of the first session preempting the third session. For example, the diagnostic response message may indicate a positive response, indicating that the first session successfully preempted the third session. Alternatively, the diagnostic response message may indicate a negative response, indicating that the first session failed to preempt the third session.
[0343] In an optional implementation, the established session may be configured with an exit protection time. When the diagnostic agent determines that the first session can preempt the third session, it may set the third session to an exiting state and enable the first session to enter a working state.
[0344] Specifically, the diagnostic agent device can start the exit timer associated with the third session while setting the third session to the exit state, and at the same time, cause the first session to enter the initial state. After the exit timer associated with the third session reaches the exit protection time preset for the third session, that is, after the third session is in the exit state for the exit protection time, the third session is released, the session information of the third session is deleted from the session table, and at the same time, the first session is caused to enter the normal working state from the initial state. When the first session is in the normal working state, the first diagnostic channel can be used for normal communication, and diagnostic messages can be transmitted between the diagnostic device and the target ECU. In one example, the diagnostic response message can carry the exit protection time of the third session, and the exit protection time of the third session is the waiting timeout of the first session. The diagnostic device can determine whether to initiate a routing activation request message to perform routing activation on the first diagnostic channel associated with the first session based on the waiting timeout of the first session. In another example, the diagnostic device can query the status of the first session in real time or periodically. When it is determined that the first session is in a working state, the diagnostic device can send a routing activation request message to the diagnostic agent device to perform routing activation on the first diagnostic channel associated with the first session. For detailed implementation details, please refer to the relevant introduction in conjunction with the logic judgment flowchart above, which will not be repeated here.
[0345] In one optional implementation, the highest priority can be understood as an exclusive attribute. In the above scenario (2), the priority of the third session is lower than the preset highest priority, that is, the third session does not have the exclusive attribute. In other words, if the third session has the exclusive attribute, the session preemption operation cannot be performed for the first session in the above scenario (2).
[0346] (3) When the mutually exclusive attribute information of the first session and the session table satisfy the following third condition, executing an operation of releasing the first session:
[0347] The mutual exclusion attribute information of the first session indicates that the session is released, and the session table includes session information of the first session.
[0348] That is, when the diagnostic apparatus requests to exit the established first session, the diagnostic agent apparatus may execute the step of releasing the first session in response to the request of the diagnostic apparatus.
[0349] In this case (3), the diagnostic response message is used to indicate the release result of the first session. For example, the diagnostic response message can be a positive response, indicating that the first session is released successfully. Alternatively, the diagnostic response message can be a negative response, indicating that the first session is released unsuccessfully.
[0350] (4) The highest priority can be understood as an exclusive attribute. When the mutually exclusive attribute information of the first session indicates that a session should be established and the first session has the highest priority, all sessions associated with the session information in the session table are released. Alternatively, when the mutually exclusive attribute information of the first session indicates that a session should be established and the session table includes session information indicating the highest priority, the establishment of the first session is refused.
[0351] That is, when the first session to be established has an exclusive attribute, no other sessions running concurrently with the first session are allowed. In this case, there is no need to determine, based on the session table, whether there is an established session whose target object conflicts with the target object of the first session. The diagnostic agent device needs to release all sessions associated with the session information in the session table before establishing the first session and maintaining a session table with an exclusive attribute for the first session to record the session information of the first session. When the session table includes session information indicating an exclusive attribute, the first session cannot be established. When the session table only records the session information of a session with an exclusive attribute, no other sessions running concurrently with the established session with an exclusive attribute are allowed. In this case, there is no need to consider whether the target object of the first session to be established conflicts with the target object of the established session with an exclusive attribute; instead, the establishment of the first session can be rejected.
[0352] It should be noted that, in the embodiments of the present application, in the above-mentioned situations (1) to (4), the session information included in the session table can be associated with at least one diagnostic device shown in Figure 2, and the at least one diagnostic device can include the diagnostic device 210-1 and the diagnostic device 210-2 shown in Figure 2, etc. The on-board diagnostic protocols supported by the at least one diagnostic device can be the same or different, and the at least one diagnostic device supports the on-board diagnostic mutually exclusive protocol of the embodiment of the present application, and the on-board diagnostic mutually exclusive protocol can be used to define the first frame format of the diagnostic request message and / or the second frame format of the diagnostic response message.
[0353] For example, as shown in FIG2 , in the above scenario (1), the diagnostic request message used to establish the first session may come from diagnostic device 210-1, and the session information of the second session recorded in the session table may be established and maintained by diagnostic agent 154-1 based on the diagnostic request message from diagnostic device 210-2. The second diagnostic channel associated with the second session is the diagnostic channel between diagnostic agent 154-1 and diagnostic device 210-2. The on-board diagnostic protocol supported by diagnostic device 210-1 and the on-board diagnostic protocol supported by diagnostic device 210-2 may be the same or different. If the on-board diagnostic protocol supported by diagnostic device 210-1 and the on-board diagnostic protocol supported by diagnostic device 210-2 are different, the message can also be forwarded between the diagnostic agent devices associated with each of the two parties.
[0354] Similarly, as shown in FIG2 , in the above scenario (2), the diagnostic request message used to establish the first session may come from diagnostic device 210-1, and the session information of the third session recorded in the session table may be established and maintained by diagnostic agent 154-1 based on the third diagnostic request message from diagnostic device 210-2. The third diagnostic channel associated with the third session is the diagnostic channel between diagnostic agent 154-1 and diagnostic device 210-2. The on-board diagnostic protocol supported by diagnostic device 210-1 and the on-board diagnostic protocol supported by diagnostic device 210-2 may be the same or different. If the on-board diagnostic protocol supported by diagnostic device 210-1 and the on-board diagnostic protocol supported by diagnostic device 210-2 are different, the message can also be forwarded between the respective diagnostic agents of both parties.
[0355] For ease of understanding, the following takes the example of a first diagnostic device being a remote diagnostic device based on the extended DoIP protocol and a second diagnostic device being a proximal OBD diagnostic device based on the extended DoCAN protocol, and describes the on-board diagnostic process of the on-board diagnostic mutual exclusion protocol of the embodiment of the present application in different business scenarios in conjunction with Figures 8-10. Among them, in the following embodiments, the extended DoIP protocol can be extended and defined using the message frame format described in Example 1 above, and the extended DoCAN protocol can be extended and defined using the message frame format described in Example 2 above. The message frame format can be found in the relevant description above in conjunction with Example 1 and Example 2, and will not be repeated here. It is understood that Figures 8-10 are merely illustrative and do not limit the on-board diagnostic protocol used by the diagnostic device. In other embodiments, the first diagnostic device may be a proximal OBD diagnostic device based on the extended DoCAN protocol, and the second diagnostic device may be a remote diagnostic device based on the extended DoIP protocol. In the method steps shown in Figures 8-10 below, the first diagnostic device and the second diagnostic device may be interchangeable, and the diagnostic proxy device that directly communicates with the first diagnostic device may be interchangeable with the diagnostic proxy device that directly communicates with the second diagnostic device. This will not be discussed in detail below. Alternatively, the first diagnostic device and the second diagnostic device may use the same protocol, such as the extended DoIP protocol. The on-board diagnostic implementation process can be found in the description of Figures 8-10 below. This is not limited in the present embodiment.
[0356] 1. Mutually exclusive diagnostic scenarios
[0357] FIG8 is a flow chart illustrating an on-board diagnostic method according to an embodiment of the present application in a mutually exclusive diagnostic scenario, wherein different diagnostic devices (e.g., a first diagnostic device and a second diagnostic device) perform mutually exclusive diagnostics on the same ECU connected to the same diagnostic proxy device.
[0358] As shown in FIG8 , the method may include the following steps:
[0359] S801: The second diagnostic device sends a diagnostic request message to the diagnostic agent based on the extended DoCAN protocol. Correspondingly, the diagnostic agent receives the diagnostic request message from the second diagnostic device.
[0360] The diagnostic request message is a mutually exclusive request message, which includes at least the SID 0x80 indicated by the extended DoCAN protocol and the mutually exclusive attribute information carried in the data field of the DoCAN message with the SID 0x80 of the UDS service, as shown below:
[0361] 80 01 0400 0500 0a 0010;
[0362] Wherein, referring to the detailed description in conjunction with Table 7 above, "80" is located in the first byte (for example, represented as #1) of the data field of the message, indicating that the message is a mutual exclusion request message; "01" is located in the second byte (for example, represented as #2) of the data field of the message, indicating that the specific value carried by the #2 byte position is 0x 01, indicating that the sub-function of the diagnostic request message is to establish a mutually exclusive session; "0400" is located in bytes #3 and #4 of the data field of the message, used to indicate the source address 0x0400 of the diagnostic channel associated with the diagnostic request message; "0500" is located in bytes #5 and #6 of the data field of the message, used to indicate the destination address 0x0500 of the diagnostic channel associated with the diagnostic request message, and the corresponding target ECU is ECU1; "0a" is located in byte #7 of the data field of the message, in hexadecimal, corresponding to 10 in binary, indicating the priority of the session associated with the diagnostic request message; "0010" is located in bytes #8 and #9 of the data field of the message, indicating the exit protection time of the session associated with the diagnostic request message.
[0363] S802: If no session is currently established, the diagnostic agent directly establishes a corresponding session, for example, Session 1, based on the mutually exclusive attribute information carried in the diagnostic request message. Simultaneously, the diagnostic agent maintains a session table containing session information for Session 1, such as the source and destination addresses of the diagnostic channel associated with the session, the session priority, the exit protection time, and the session status, as shown in FIG8 .
[0364] S803: The diagnostic agent sends a diagnostic response message to the second diagnostic device based on the extended DoCAN protocol, indicating that the session is successfully established.
[0365] The diagnostic response message is a mutually exclusive response message, which includes at least the SID 0xBF indicated by the extended DoCAN protocol and the response information carried in the data field of the DoCAN message with the SID 0xBF of the UDS service, as shown below:
[0366] BF 01 0400 0500 00;
[0367] Among them, referring to the detailed description in combination with Table 8 above, "BF" is located in the first byte (for example, represented as #1) of the data field of the message, indicating that the message is a mutually exclusive response message; "01" is located in the second byte (for example, represented as #2) of the data field of the message, indicating that the specific value carried by the #2 byte position is 0x01, indicating that the sub-function of the diagnostic response message is to establish a mutually exclusive session; "0400" is located in the #3 and #4 bytes of the data field of the message, used to indicate the source address of the diagnostic channel associated with the diagnostic response message; "0500" is located in the #5 and #6 bytes of the data field of the message, used to indicate the destination address of the diagnostic channel associated with the diagnostic response message; "00" is located in the #7 byte of the data field of the message, indicating that the specific value carried by the #7 byte position is 0x00, indicating that the session associated with the diagnostic response message is successfully established.
[0368] S804: After the diagnostic channel associated with session 1 in the working state is routed and activated, the normal on-board diagnostic process can be performed between the second diagnostic device, the diagnostic agent device and ECU1, and diagnostic messages can be exchanged between the second diagnostic device and ECU1 based on the established diagnostic channel associated with session 1.
[0369] S805: The first diagnostic device sends a diagnostic request message to the diagnostic agent based on the extended DoIP protocol. Correspondingly, the diagnostic agent receives the diagnostic request message from the first diagnostic device.
[0370] The diagnostic request message is a session request message, which includes at least 0x8004 indicated based on the extended DoIP protocol and the mutually exclusive attribute information carried in the payload field of the DoIP message with the DoIP message type of 0x8004, as shown below:
[0371] 8004 01 09 000a;
[0372] Also, the information carried in other byte positions of the payload field of the session request message, such as the source address 0x0600 and the destination address 0x0500, corresponds to the target ECU ECU1.
[0373] Based on the description in Table 3 above, "8004" indicates that the extended DoIP message type is a session request. Among the mutually exclusive attributes carried in the session request message, "01" indicates that the sub-function of the session request message is session establishment, "09" indicates the priority of the session requested by the session request message, and "000a," in hexadecimal notation, corresponds to 10 milliseconds and indicates the exit protection time of the session requested by the session request message.
[0374] S806: The diagnostic agent device may obtain a session table and perform a logical judgment based on the existing session information in the session table to determine whether a session seizure operation is required. If it is determined that a session seizure operation is required, the session seizure step is performed.
[0375] For example, in Figure 8, after S802, the maintained session table includes the destination address associated with session 1, which is the same as the destination address associated with the new session to be established (denoted as session 2), both of which are 0x0500, that is, there is a conflict, and the current situation is a mutually exclusive diagnosis scenario. At the same time, the priority value of session 1 is 10, and the priority value of session 2 to be established is 09. The priority of session 2 is higher than the priority of session 1, that is, preemption is allowed. The diagnostic agent device can set the conflicting session 1 from the working state to the exit state, and set the session 2 to be established to the initial state at the same time. After reaching the exit protection time of 10ms of session 1, the session state is switched, and the preempted session 1 is switched from the exit state to the empty state. The session information of the session 1 is deleted from the session table, and session 2 is switched from the initial state to the working state.
[0376] S807: The diagnosis agent sends a diagnosis response message to the first diagnosis device based on the extended DoIP protocol, indicating the session management result, for example, indicating that session 2 is preempting session 1 and needs to wait.
[0377] The diagnostic response message is a session response message, which includes at least 0x8005 indicated based on the extended DoIP protocol and the response information carried in the payload field of the DoIP message with the DoIP message type of 0x8005, for example, as shown below:
[0378] 8005 01 02 000a;
[0379] As described in detail above in conjunction with Table 4, "8005" indicates that the extended DoIP message type is Session Response. Among the mutually exclusive attribute information carried in the Session Response message, "01" indicates that the sub-function of the Session Response message is Session Establishment, "02" indicates that the preempted session is exiting and needs to wait until the timeout (i.e., the exit protection time of the preempted session) expires, and "000a" (in hexadecimal notation, corresponding to 10) indicates the exit protection time of the conflicting session (Session 1), i.e., the waiting timeout for establishing a new session.
[0380] S808 (optional step): The first diagnostic device sends a query request message to the diagnostic agent device based on the extended DoIP protocol to query the session status of the first session.
[0381] S809 (optional step): The diagnosis agent device sends a query response message to the first diagnosis device based on the extended DoIP protocol, indicating the session status query result of the first session.
[0382] Wherein, when the status of session 2 is the working status, the first diagnostic device can perform routing activation on the diagnostic channel associated with session 2 to conduct a normal diagnostic session and exchange diagnostic messages.
[0383] S810: When established Session 2 is in an active state, the first diagnostic device may activate the diagnostic channel associated with Session 2. After successful route activation, the first diagnostic device, the diagnostic agent, and ECU 1 can proceed with normal on-board diagnostics, exchanging diagnostic messages from ECU 1 over the diagnostic channel associated with Session 2. The activation process is described in detail in the DoIP protocol and is not detailed here.
[0384] Therefore, through the above steps, when there are at least two diagnostic devices that want to diagnose the same target ECU, the diagnostic agent device can make logical judgments based on the sub-function indicated by the diagnostic request message, the mutually exclusive attribute information carried in the diagnostic request message, and the existing session information. When there is a mutually exclusive diagnostic situation, the mutually exclusive preemption process is executed so that the diagnostic task corresponding to the high-priority message is executed first.
[0385] Furthermore, the first diagnostic device may also instruct the diagnostic agent device to release the corresponding session by carrying a function identifier for instructing to release the session in the session request message. The on-board diagnostic method may further include the following steps:
[0386] S811: The first diagnostic device sends a diagnostic request message instructing to release the session, also called a release request message, to the diagnostic agent based on the extended DoIP protocol, requesting to release session 2. The specific value of the function identifier carried in the release request message indicates to release the session.
[0387] Based on the content shown in Table 3, the release request message may carry the following information:
[0388] 8004 02
[0389] As well as the information carried in other byte positions of the payload field of the release request message, such as the source address 0x0600 and the destination address 0x0500, the corresponding target ECU is represented as ECU1.
[0390] Among them, "8004" indicates that the extended DoIP message type is session request, and "02" indicates that the sub-function of the message is to release the session. The address information carried in the payload field of the message can indicate the session associated with the diagnostic channel, such as session 2.
[0391] S812: The diagnostic agent releases the corresponding session, such as session 2, according to the release request message from the first diagnostic device, and deletes the session information of session 2 from the session table. Furthermore, in an optional design, when there is no session information in the session table, the session table can be deleted to reduce occupied resources.
[0392] S813: The diagnostic agent sends a diagnostic response message instructing to release the session to the first diagnostic device based on the extended DoIP protocol, also called a release response message, indicating the release result of session 2. The specific value of the function identifier carried in the release response message indicates the release of the session.
[0393] 2. Concurrent diagnosis scenario
[0394] FIG9 is a flow chart illustrating an on-board diagnostic method in a concurrent diagnostic scenario according to an embodiment of the present application, wherein the concurrent diagnostic scenario involves different diagnostic devices (e.g., a first diagnostic device and a second diagnostic device) concurrently diagnosing different ECUs (e.g., ECU1 and ECU2) connected to the same diagnostic proxy device.
[0395] As shown in FIG9 , the method may include the following steps:
[0396] S901: The second diagnostic device sends a diagnostic request message to the diagnostic agent based on the extended DoCAN protocol. Correspondingly, the diagnostic agent receives the diagnostic request message from the second diagnostic device.
[0397] The diagnostic request message is a mutually exclusive request message, which includes at least the SID 0x80 indicated by the extended DoCAN protocol and the mutually exclusive attribute information carried in the data field of the DoCAN message with the SID 0x80 of the UDS service, as shown below:
[0398] 80 01 0400 0500 0a 0010;
[0399] As described above in conjunction with the detailed description in Table 7, "80" is located in the first byte (e.g., represented as #1) of the data field of the message, indicating that the message is a mutually exclusive request message; "01" is located in the second byte (e.g., represented as #2) of the data field of the message, indicating that the specific value of byte position #2 is 0x01, indicating that the sub-function of the diagnostic request message is to establish a mutually exclusive session; "0400" is located in bytes #3 and #4 of the data field of the message, and is used to indicate the source address 0x0400 of the diagnostic channel associated with the diagnostic request message; "0500" is located in bytes #5 and #6 of the data field of the message, and is used to indicate the destination address 0x0500 of the diagnostic channel associated with the diagnostic request message, and the corresponding target ECU is ECU1; "0a" is located in byte #7 of the data field of the message, which corresponds to 10 in binary in hexadecimal and indicates the priority of the session associated with the diagnostic request message; "0010" is located in bytes #8 and #9 of the data field of the message, and indicates the exit protection time of the session associated with the diagnostic request message.
[0400] S902: If no session currently exists, the diagnostic agent directly establishes a corresponding session, for example, Session 1, based on the mutually exclusive attribute information carried in the diagnostic request message. Simultaneously, the diagnostic agent maintains a session table containing session information for Session 1, such as the source and destination addresses of the diagnostic channel associated with the session, the session priority, the exit protection time, and the session status, as shown in FIG9 .
[0401] S903: The diagnostic agent sends a diagnostic response message to the second diagnostic device based on the extended DoCAN protocol, indicating that session 1 is successfully established.
[0402] The diagnostic response message is a mutually exclusive response message, which includes at least the SID 0xBF indicated by the extended DoCAN protocol and the response information carried in the data field of the DoCAN message with the SID of the UDS service at 0xBF, as shown below:
[0403] BF 01 0400 0500 00;
[0404] Among them, referring to the detailed description in combination with Table 8 above, "BF" is located in the first byte (for example, represented as #1) of the data field of the message, indicating that the message is a mutually exclusive response message; "01" is located in the second byte (for example, represented as #2) of the data field of the message, indicating that the specific value carried by the #2 byte position is 0x01, indicating that the sub-function of the diagnostic response message is to establish a mutually exclusive session; "0400" is located in the #3 and #4 bytes of the data field of the message, used to indicate the source address of the diagnostic channel associated with the diagnostic response message; "0500" is located in the #5 and #6 bytes of the data field of the message, used to indicate the destination address of the diagnostic channel associated with the diagnostic response message; "00" is located in the #7 byte of the data field of the message, indicating that the specific value carried by the #7 byte position is 0x00, indicating that the session associated with the diagnostic response message is successfully established.
[0405] S904: After the routing of the diagnostic channel associated with the working session 1 is activated, the normal on-board diagnostic process can be carried out between the second diagnostic device, the diagnostic agent device and ECU1, and the diagnostic message of ECU1 (logical address is 0x0500) can be exchanged based on the diagnostic channel associated with the established session 1.
[0406] S905: The first diagnostic device sends a diagnostic request message to the diagnostic agent based on the extended DoIP protocol. Correspondingly, the diagnostic agent receives the diagnostic request message from the first diagnostic device.
[0407] The diagnostic request message is a session request message, which includes at least 0x8004 indicated by the extended DoIP protocol and the mutually exclusive attribute information carried in the payload field of the DoIP message with the DoIP message type of 0x8004, as shown below:
[0408] 8004 01 0a 0010;
[0409] Also, the information carried in other byte positions of the payload field of the session request message, such as the source address 0x0600 and the destination address 0x0700, corresponds to the target ECU ECU2.
[0410] Based on the description in Table 3 above, "8004" indicates that the extended DoIP message type is a session request. In the mutually exclusive attribute information in the session request message, "01" indicates that the sub-function of the session request message is to establish a session, "0a" indicates the priority of the session requested by the session request message, which corresponds to a hexadecimal value of 10, and "0010" indicates the exit protection time of the session requested by the session request message.
[0411] S906: The diagnostic agent obtains the session table and performs a logical analysis based on the existing session information in the session table to determine whether to preempt the session. If it is determined that there is no conflict in preemption, the diagnostic agent proceeds to establish session 2. At this point, session 1 and session 2 can run concurrently.
[0412] For example, in FIG9 , the destination logical address 0x0500 associated with the session information in the session table maintained at S902 is different from the destination logical address 0x0700 of the new session to be established. Therefore, there is no session conflict, so a new session 2 is established, and the session information of the new session 2 is added to the maintained session table, as shown in FIG9 . It is understood that, at this point, the diagnostic agent can implement concurrent diagnosis of different sessions.
[0413] S907: The diagnosis agent sends a diagnosis response message to the first diagnosis device based on the extended DoIP protocol, indicating the establishment result of session 2.
[0414] The diagnostic response message is a session response message, which includes at least 0x8005 indicated by the extended DoIP protocol and the response information carried in the payload field of the DoIP message with the DoIP message type of 0x8005, as shown below:
[0415] 8005 01 04;
[0416] Among them, referring to the detailed description in conjunction with Table 4 above, "8005" indicates that the extended definition of the DoIP message type is a session response; "01" indicates that the sub-function of the session response message is to establish a session; and "04" indicates that the current session 2 is in normal working state.
[0417] S908: After activating the routing of the diagnostic channel associated with the established session 2, the first diagnostic device, the diagnostic agent device and ECU2 can perform normal on-board diagnostic procedures, and the diagnostic messages of ECU2 can be exchanged based on the diagnostic channel associated with the established session.
[0418] Furthermore, the first diagnostic device may further instruct the diagnostic agent device to release the corresponding session. The on-board diagnostic method may further include the following steps:
[0419] S909: The first diagnosis device sends a session request message (which may be referred to as a release request message) for instructing to release the session to the diagnosis agent device based on the extended DoIP protocol, so as to request to release the session.
[0420] Based on the content shown in Table 3, the release request message may carry at least the following information:
[0421] 8004 02
[0422] Also, the information carried in other byte positions of the payload field of the session request message, such as the source address 0x0600 and the destination address 0x0700, corresponds to the target ECU ECU2.
[0423] Among them, "8004" indicates that the message type is a session request message, and "02" indicates that the sub-function of the message is to release the session. The address information carried by the payload field of the message can indicate the session associated with the diagnostic channel, such as session 2.
[0424] S910: The diagnostic agent releases the corresponding session 2 according to the request message from the first diagnostic device and deletes the session information of the session 2 from the session table. Furthermore, in an optional design, when there is no session information in the session table, the session table can be deleted to reduce occupied resources.
[0425] S911: The diagnosis agent device may send a session response message indicating a session release result to the first diagnosis device based on the extended DoIP protocol, which may also be called a release response message and is used to indicate the release result of session 2.
[0426] Therefore, by extending the protocol and the above steps, when there are at least two diagnostic devices to diagnose different target ECUs, the diagnostic agent device can make logical judgments based on the mutually exclusive attribute information carried in the diagnostic request message and the existing session information, and run diagnostic sessions concurrently for different diagnostic devices if there is no conflict, thereby flexibly improving the diagnostic process in concurrent scenarios.
[0427] 3. Forwarding scenario
[0428] Figure 10 shows a flow chart of the on-board diagnostic method in a forwarding scenario according to an embodiment of the present application. The forwarding scenario involves different diagnostic devices (e.g., a first diagnostic device and a second diagnostic device) diagnosing ECUs that are connected to a cross-diagnostic proxy device. For example, the first diagnostic device diagnoses ECU3 connected to the second diagnostic proxy device via the first diagnostic proxy device and the second diagnostic proxy device, and the first diagnostic device cannot directly diagnose ECU3. The second diagnostic device diagnoses ECU3 connected to the second diagnostic proxy device via the second diagnostic proxy device, and the second diagnostic device can directly diagnose ECU3.
[0429] In an embodiment of the present application, the session tables maintained by different diagnostic proxy devices can at least record the session information of the target ECUs under the corresponding diagnostic proxy devices themselves. In an optional implementation, the session tables maintained by different diagnostic proxy devices can record the session information for the target ECUs under other diagnostic proxy devices across diagnostic proxy devices. For example, the session table of the first diagnostic proxy device can also record the session information of the diagnostic device (including the first diagnostic device and the second diagnostic device) for the ECU3 under the second diagnostic proxy device. Recording session information across diagnostic proxy devices can be achieved by forwarding diagnostic request messages to achieve synchronous update of session information recorded by different diagnostic proxy devices, or it can be achieved by forwarding updated session tables to update the session information maintained by each diagnostic proxy device. The embodiment of the present application does not limit the synchronization method of the session information.
[0430] It should be noted that in the embodiment of the present application, when forwarding messages from different diagnostic devices or forwarding messages sent to different diagnostic devices between different diagnostic agent devices on the vehicle side, according to the protocols adopted by different diagnostic devices, if the protocols adopted are the same, they can be forwarded directly; if the protocols adopted are different, the diagnostic agent devices can perform protocol conversion on the data to be transmitted and then send the converted messages, which will not be repeated here.
[0431] Taking ECU3 as an example, as shown in FIG10 , the method may include the following steps:
[0432] S1001: The second diagnostic device sends a diagnostic request message to the second diagnostic agent device of the vehicle based on the extended DoCAN protocol. Correspondingly, the second diagnostic agent device of the vehicle receives the diagnostic request message.
[0433] The diagnostic request message is a mutually exclusive request message, which includes at least the SID 0x80 indicated by the extended DoCAN protocol and the mutually exclusive attribute information carried in the data field of the DoCAN message with the SID 0x80 of the UDS service, as shown below:
[0434] 80 01 0400 0800 0a 000a;
[0435] Among them, referring to the detailed description in conjunction with Table 7 above, "80" is located in the first byte (for example, represented as #1) of the data field of the message, indicating that the message is a mutually exclusive request message; "01" is located in the second byte (for example, represented as #2) of the data field of the message, indicating that the specific value carried by the #2 byte position is 0x01, indicating that the sub-function of the diagnostic request message is to establish a mutually exclusive session; "0400" is located in the #3 and #4 bytes of the data field of the message, used to indicate the source address 0x0400 of the diagnostic channel associated with the diagnostic request message ; "0800" is located in bytes #5 and #6 of the data field of the message, and is used to indicate the destination address 0x0800 of the diagnostic channel associated with the diagnostic request message, and the corresponding target ECU is ECU3; "0a" is located in byte #7 of the data field of the message, and in hexadecimal, corresponds to the number 10, indicating that the priority of the session associated with the diagnostic request message is 10; "000a" is located in bytes #8 and #9, and in hexadecimal, corresponds to the number 10 (ms), indicating the exit protection time of the session associated with the diagnostic request message.
[0436] S1002: If no diagnostic session currently exists (e.g., the session table is empty), the second diagnostic agent establishes a session based on the diagnostic request message, for example, designated as Session 1. Simultaneously, the second diagnostic agent maintains a session table, which includes session information for Session 1, such as the source and destination addresses of the diagnostic channel associated with the session, the session priority, the exit protection time, and the session status, as shown in FIG10 .
[0437] S1003: The second diagnostic agent sends a diagnostic response message to the second diagnostic device based on the extended DoCAN protocol, indicating that the session is successfully established.
[0438] The diagnostic response message is a mutually exclusive response message, which includes at least the SID 0xBF indicated by the extended DoCAN protocol and the response information carried in the data field of the DoCAN message with the SID 0xBF of the UDS service, as shown below:
[0439] BF 01 0400 0800 00;
[0440] Among them, referring to the detailed description in combination with Table 8 above, "BF" is located in the first byte (for example, represented as #1) of the data field of the message, indicating that the message is a mutually exclusive response message; "01" is located in the second byte (for example, represented as #2) of the data field of the message, indicating that the specific value carried by the #2 byte position is 0x01, indicating that the sub-function of the diagnostic response message is to establish a mutually exclusive session; "0400" is located in the #3 and #4 bytes of the data field of the message, used to indicate the source address of the diagnostic channel associated with the diagnostic response message; "0800" is located in the #5 and #6 bytes of the data field of the message, used to indicate the destination address of the diagnostic channel associated with the diagnostic response message, and the corresponding target ECU is ECU3; "00" is located in the #7 byte, indicating that the specific value of the #7 byte is 0x00, indicating that the session associated with the diagnostic response message is successfully established.
[0441] S1004 (optional step): After receiving the diagnosis request message in S1001, the second diagnosis agent forwards the diagnosis request message to the first diagnosis agent. Correspondingly, the first diagnosis agent receives the diagnosis request message.
[0442] S1005 (optional): If no diagnostic session currently exists (e.g., the session table is empty), the first diagnostic agent establishes a session based on the diagnostic request message, denoted as Session 1. Simultaneously, the first diagnostic agent maintains a session table containing session information for Session 1, such as the source and destination addresses of the diagnostic channel associated with the session, the session priority, the exit protection time, and the session status, as shown in FIG10 .
[0443] S1006 (optional step): The first diagnostic agent sends a diagnostic response message to the second diagnostic agent, and the second diagnostic agent forwards the diagnostic response message to the second diagnostic device, indicating that the session is successfully established. Detailed implementation is described above and will not be repeated here.
[0444] It should be noted that the above S1004-S1006 are optional steps, which are an example of synchronously updating session information between different diagnostic agent devices. In an optional embodiment of the present application, the first diagnostic agent device and the second diagnostic agent device, as nodes in the vehicle's ring network, can maintain the same session table. After S1002, the second diagnostic agent device can synchronize the updated session table to the first diagnostic agent device and other diagnostic agent devices in the ring network. Accordingly, the contents of S1004-S1006 can be replaced with the following content: S1004: The second diagnostic agent device sends the updated session table to other diagnostic agent devices in the ring network. S1005: The first diagnostic agent device receives the updated session table from the second diagnostic agent device. S1006: The first diagnostic agent device sends a response message to the second diagnostic agent device to indicate that the session table has been updated.
[0445] S1007: The second diagnostic agent activates the routing channel associated with Session 1. Afterward, the second diagnostic agent and ECU 3 can proceed with the normal on-board diagnostic process, exchanging diagnostic messages from ECU 3 based on the established diagnostic channel associated with Session 1. For example, the second agent sends the diagnostic message from ECU 3 to the second diagnostic agent.
[0446] S1008: The first diagnostic device sends a diagnostic request message to the first diagnostic agent device based on the extended DoIP protocol. Correspondingly, the first diagnostic agent device of the vehicle receives the diagnostic request message.
[0447] The diagnostic request message is a session request message, which includes at least 0x8004 indicated by the extended DoIP protocol and the mutually exclusive attribute information carried in the payload field of the DoIP message with the DoIP message type of 0x8004, as shown below:
[0448] 8004 01 0b 000a;
[0449] Furthermore, the source address 0x0600 and the destination address 0x0800 carried in other fields of the session request message correspond to a target ECU, denoted as ECU3.
[0450] Among them, based on the relevant description in combination with Table 3 above, in the mutually exclusive attribute information in the session request message, "8004" indicates that the message is a mutually exclusive request message, "01" indicates that the sub-function of the session request message is to establish a session, "0b" indicates the priority of the session requested by the session request message, which corresponds to the number 11 in hexadecimal, and "000a" indicates the exit protection time of the session requested by the session request message, which corresponds to the number 10 (ms) in hexadecimal.
[0451] S1009: The first diagnostic agent device may obtain a session table maintained by itself and perform a logical judgment based on the existing session information in the session table to determine whether there is a mutually exclusive session. If it is determined that there is a mutually exclusive session, determine whether to execute the step of preempting the session.
[0452] For example, in Figure 10, the destination address associated with the session information of Session 1 in the session table maintained in S1005 is the same as the destination address of the new session to be established (denoted as Session 3), both of which are 0x0800, indicating that they are currently in a mutually exclusive diagnostic scenario. Furthermore, the priority of Session 2 to be established is 11, which is lower than the priority of Session 1, which is 10, indicating that preemption is not allowed.
[0453] S1010: The first diagnostic agent sends a diagnostic response message to the first diagnostic device, indicating the session preemption result. For example, if the preemption is successful, the diagnostic response message is a positive response, indicating a successful preemption. If the preemption fails, the diagnostic response message is a negative response, indicating a failed preemption. The session preemption process can be found in the above description in conjunction with FIG8 and will not be further described here.
[0454] S1011 (optional step): The first diagnostic agent forwards the diagnostic request message to the second diagnostic agent.
[0455] S1012 (optional step): The second diagnostic agent can obtain a session table maintained by itself and perform a logical judgment based on the existing session information in the session table to determine whether there is a mutually exclusive session. If it is determined that there is a mutually exclusive session, determine whether to execute the step of preempting the session.
[0456] For example, in Figure 10, the destination address associated with the session information of Session 1 in the session table maintained in S1002 is the same as the destination address of the new session to be established (denoted as Session 4), both of which are 0x0800, indicating that they are currently in a mutually exclusive diagnostic scenario. Furthermore, the priority of Session 2 to be established is 11, which is lower than the priority of Session 1, which is 10, indicating that preemption is not allowed.
[0457] S1013 (optional step): The second diagnostic agent sends a diagnostic response message to the first diagnostic device via the first diagnostic agent, indicating the session preemption result. For example, if the preemption is successful, the diagnostic response message is a positive response, indicating a successful preemption. If the preemption fails, the diagnostic response message is a negative response, indicating a failed preemption. The session preemption process can be found in the above description in conjunction with FIG8 and will not be repeated here.
[0458] In S1010 and S1013, the diagnostic response message is a session response message, which includes at least 0x8005 indicated based on the extended DoIP protocol and the response information carried in the payload field of the DoIP message of DoIP message type 0x8005, as shown below:
[0459] 8005 01 01;
[0460] Also, information carried in other byte positions of the payload field of the session response message, such as source address 0x0600 and destination address 0x0800.
[0461] Among them, referring to the detailed description in combination with Table 4 above, "8005" indicates that the extended definition of the DoIP message type is a session response; the first "01" indicates that the sub-function of the session response message is to establish a session, and the second "01" indicates that the preemption result is a preemption failure.
[0462] It should be noted that the above S1011-S1013 are optional steps, which are an example of a conflict in synchronizing and updating sessions between different diagnostic agent devices. In an optional embodiment of the present application, the first diagnostic agent device and the second diagnostic agent device, as nodes in the vehicle's ring network, can maintain the same session table and synchronize conflict information. The conflict information can, for example, indicate whether there is a session conflict, which sessions conflict, and the solution to the conflict. After S1009, the first diagnostic agent device can synchronize the conflict information to the second diagnostic agent device and other diagnostic agent devices in the ring network. Accordingly, the content of S1011-S1013 can be replaced with the following content: S1011: The first diagnostic agent device sends conflict information to other diagnostic agent devices in the ring network. S1012: The second diagnostic agent device receives the conflict information from the first diagnostic agent device. S1013: The second diagnostic agent device sends a response message to the first diagnostic agent device to indicate that the conflict information has been synchronized.
[0463] It is understandable that in another implementation of the present application, when implementing the above-mentioned S1009-S1013, the judgment process and the response process can also be performed by the second diagnostic agent. In this case, the content of S1009-S1013 shown in Figure 10 can be replaced with the following content: S1009: The first diagnostic agent forwards the diagnostic request message to the second diagnostic agent. S1010: The second diagnostic agent can obtain the session table maintained by itself and perform a logical judgment based on the existing session information in the session table to determine whether there is a mutually exclusive session. If it is determined that there is a mutually exclusive session, determine whether to perform the step of preempting the session. S1011: The second diagnostic agent sends a diagnostic response message to the first diagnostic agent to indicate the session preemption result. S1012: The first diagnostic agent sends a diagnostic response message to the first diagnostic device to indicate the session preemption result. S1013: The first diagnostic agent records the conflict information locally based on the diagnostic response message.
[0464] Therefore, through the above steps, when there are at least two diagnostic devices that need to diagnose the target ECU across the diagnostic proxy device, the at least two diagnostic devices can maintain the same session table with the topological network composed of several diagnostic proxy devices on the vehicle side, so as to determine whether it is a mutually exclusive diagnostic scenario based on the session information in the session table and the received diagnostic request message, thereby realizing a mutually exclusive diagnostic process in the scenario of forwarding between topological networks.
[0465] So far, the specific diagnostic processes of implementing concurrent diagnostic services, mutually exclusive diagnostic services or forwarding mutually exclusive diagnostic services in different scenarios in the embodiments of the present application have been introduced in combination with Figures 8-10. The embodiments of the present application aim to extend the definition of at least one on-board diagnostic protocol supported by the vehicle based on the on-board diagnostic mutual exclusion protocol, so as to provide a more complete diagnostic process in scenarios where concurrent diagnostic services or mutually exclusive diagnostic services exist, thereby ensuring the certainty of on-board diagnosis.
[0466] An embodiment of the present application further provides a communication device, which can be used to implement the method implemented by any of the diagnostic devices or diagnostic agent devices described above.
[0467] As shown in FIG11 , the communication device 1100 can be implemented as a diagnostic agent device. The device 1100 may include: a transceiver unit 1101 for receiving a diagnostic request message from a diagnostic device, wherein the diagnostic request message is used to request diagnosis of a target object, and the diagnostic request message includes mutually exclusive attribute information of a first session, wherein the first session is associated with a first diagnostic channel between the diagnostic device and the target object; a processing unit 1102 for performing a session management operation based on the mutually exclusive attribute information of the first session; and the transceiver unit 1101 may also be used to send a diagnostic response message to the diagnostic device, wherein the diagnostic response message is used to indicate a session management result. Relevant features can be found in the above-mentioned method embodiment and will not be described in detail here.
[0468] As shown in Figure 12, the communication device 1200 can be implemented as a diagnostic device, and the device 1200 may include: a determination unit 1201, used to determine a diagnostic request message based on a target diagnostic task, wherein the diagnostic request message is used to request diagnosis of a target object, and the diagnostic request message includes mutually exclusive attribute information of a first session, and the first session is associated with a first diagnostic channel between the diagnostic device and the target object; a transceiver unit 1202, used to send the diagnostic request message to a first diagnostic agent device; the transceiver unit 1202 is also used to receive a diagnostic response message from the first diagnostic agent device, and the diagnostic response message is used to indicate a session management result obtained by performing a session management operation based on the mutually exclusive attribute information of the first session.
[0469] It should be noted that the division of units in the embodiments of the present application is schematic and is merely a logical functional division. In actual implementation, other division methods may be used. The functional units in the embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0470] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the contributing part or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0471] In one possible implementation, an embodiment of the present application provides a computer-readable storage medium, which stores program code. When the program code runs on the computer, the computer executes the above method embodiment.
[0472] In a possible implementation, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above method embodiment.
[0473] In a simple embodiment, those skilled in the art can imagine that the communication devices in the above embodiments may all adopt the form shown in FIG. 13 .
[0474] As shown in FIG13 , the apparatus 1300 includes at least one processor 1310 and a communication interface 1330. In an optional design, a memory 1320 may also be included.
[0475] The specific connection medium between the processor 1310 and the memory 1320 is not limited in the embodiment of the present application.
[0476] In the apparatus as shown in FIG. 13 , the processor 1310 may transmit data through the communication interface 1330 when communicating with other devices.
[0477] When the communication device adopts the form shown in Figure 13, the processor 1310 in Figure 13 can call the computer execution instructions stored in the memory 1320, so that the device 1300 can execute the method executed by the communication device in any of the above method embodiments.
[0478] An embodiment of the present application also relates to a chip system, which includes a processor for calling a computer program or computer instructions stored in a memory so that the processor executes the method of any of the above embodiments.
[0479] In a possible implementation, the processor may be coupled to the memory through an interface.
[0480] In a possible implementation, the chip system may also directly include a memory, in which a computer program or computer instructions are stored.
[0481] For example, the memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0482] An embodiment of the present application further relates to a processor, which is used to call a computer program or computer instruction stored in a memory so that the processor executes the method described in any of the above embodiments.
[0483] For example, in the embodiment of the present application, the processor is an integrated circuit chip with signal processing capabilities. For example, the processor can be a field programmable gate array (FPGA), a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, a system on chip (SoC), a central processing unit (CPU), a network processor (NP), a microcontroller (MCU), a programmable logic device (PLD) or other integrated chip, which can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiment of the present application can be directly embodied as a hardware decoding processor for execution, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0484] It should be understood that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0485] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0486] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0487] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the scope of the embodiments of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application also intends to include such modifications and variations.
Claims
1. A vehicle-mounted diagnostic method, characterized in that: Applied to a first diagnostic agent, the method includes: receiving a diagnostic request message from a diagnostic device, wherein the diagnostic request message is used to request diagnosis of a target object, and the diagnostic request message includes mutually exclusive attribute information of a first session, and the first session is associated with a first diagnostic channel between the diagnostic device and the target object; performing a session management operation according to the mutually exclusive attribute information of the first session; A diagnosis response message is sent to the diagnosis device, where the diagnosis response message is used to indicate a session management result.
2. The method according to claim 1, characterized in that The session management operation includes any of the following operations: establishing a session, seizing a session, releasing a session, or querying a session status.
3. The method according to claim 2, characterized in that The performing a session management operation according to the mutually exclusive attribute information of the first session includes: The session management operation is performed according to the mutually exclusive attribute information of the first session and a session table, wherein the session table is used to indicate session information of the established session.
4. The method according to claim 3, characterized in that The performing the session management operation according to the mutually exclusive attribute information of the first session and the session table includes: When the mutually exclusive attribute information of the first session and the session table satisfy any one of the following first conditions, performing an operation of establishing the first session: The mutually exclusive attribute information of the first session indicates that a session is established, and the session table is empty; The mutually exclusive attribute information of the first session indicates that a session is established, and the session table includes session information of a second session, wherein the second session is associated with a second diagnostic channel, and a target object corresponding to the second diagnostic channel is different from a target object corresponding to the first diagnostic channel; The diagnostic response message is used to indicate the establishment result of the first session.
5. The method according to claim 4, characterized in that The priority of the second session is lower than the preset highest priority.
6. The method according to claim 3, characterized in that The performing the session management operation according to the mutually exclusive attribute information of the first session and the session table includes: When the mutually exclusive attribute information of the first session and the session table meet the following second condition, performing a session preemption operation for the first session: The mutually exclusive attribute information of the first session indicates that a session is established, and the session table includes session information of a third session, wherein the third session is associated with a third diagnostic channel, a target object corresponding to the third diagnostic channel is the same as a target object corresponding to the first diagnostic channel, and a priority of the first session is higher than a priority of the third session; The diagnostic response message is used to indicate a result of the first session preempting the third session.
7. The method according to claim 6, characterized in that The priority of the third session is lower than the preset highest priority.
8. The method according to claim 6 or 7, characterized in that The performing the session preemption operation for the first session includes: Setting the third session to exit state; The first session enters a working state.
9. The method according to any one of claims 3 to 8, characterized in that The performing the session management operation according to the mutually exclusive attribute information of the first session and the session table includes: When the mutually exclusive attribute information of the first session indicates that a session is to be established and the first session has the highest priority, releasing all sessions associated with the session information in the session table; or When the mutually exclusive attribute information of the first session indicates establishing a session and the session table includes session information indicating a highest priority, establishing the first session is rejected.
10. The method according to any one of claims 3 to 8, characterized in that The performing the session management operation according to the mutually exclusive attribute information of the first session and the session table includes: When the mutually exclusive attribute information of the first session and the session table satisfy the following third condition, an operation of releasing the first session is performed: The mutual exclusion attribute information of the first session indicates that the session is released, and the session table includes session information of the first session; The diagnostic response message is used to indicate a release result of the first session.
11. The method according to any one of claims 3 to 10, characterized in that The session information included in the session table is associated with at least one diagnostic device, and the at least one diagnostic device supports an on-board diagnostic mutually exclusive protocol, and the on-board diagnostic mutually exclusive protocol includes a first frame format of the diagnostic request message and / or a second frame format of the diagnostic response message.
12. The method according to claim 11, characterized in that When the diagnosis request message adopts the first frame format, the mutually exclusive attribute information is located in the first field of the diagnosis request message, wherein the first field is the payload field when the diagnosis request message adopts the third frame format; When the diagnosis response message adopts the second frame format, the session management result is located in the second field of the diagnosis response message, wherein the second field is the effective load field when the diagnosis response message adopts the fourth frame format.
13. The method according to any one of claims 1 to 12, characterized in that The method further comprises: When the first session is in an active state, receiving a routing activation request message from the diagnostic device; According to the routing activation request message, routing activation is performed on the first diagnostic channel.
14. The method according to any one of claims 1 to 13, characterized in that The method further comprises: The diagnostic request message is forwarded to a second diagnostic agent device, wherein the second diagnostic agent device and the first diagnostic agent device are ring topology Ethernet nodes.
15. A vehicle-mounted diagnostic method, characterized in that: include: The diagnostic device determines a diagnostic request message according to a target diagnostic task, wherein the diagnostic request message is used to request diagnosis of a target object, and the diagnostic request message includes mutually exclusive attribute information of a first session, wherein the first session is associated with a first diagnostic channel between the diagnostic device and the target object; The diagnostic device sends the diagnostic request message to the first diagnostic agent device; The diagnostic device receives a diagnostic response message from the first diagnostic agent device, where the diagnostic response message is used to indicate a session management result obtained by performing a session management operation according to the mutually exclusive attribute information of the first session.
16. The method according to claim 15, characterized in that The session management operation includes any of the following operations: establishing a session, seizing a session, releasing a session, or querying a session status.
17. The method according to claim 15 or 16, characterized in that The mutually exclusive attribute information of the first session includes at least one of the following information: a function identifier, priority information, or an exit protection time.
18. The method according to claim 17, characterized in that The mutually exclusive attribute information also includes communication address information of the first diagnostic channel.
19. The method according to any one of claims 15 to 18, characterized in that The method further comprises: When the first session is in a working state, the diagnostic device sends a routing activation request message to the first diagnostic agent device, where the routing activation request message is used to instruct routing activation of the first diagnostic channel.
20. The method according to claim 19, characterized in that The method further comprises: The diagnostic device sends a query request message to the first diagnostic agent device, where the query request message is used to request to query the status of the first session; The diagnostic device receives a query response message from the first diagnostic agent device, where the query response message is used to indicate a status of the first session.
21. The method according to any one of claims 15 to 20, characterized in that The method further comprises: The diagnostic device sends the diagnostic request message to the second diagnostic agent device.
22. An on-board diagnostic agent device, characterized in that: include: a transceiver unit, configured to receive a diagnostic request message from a diagnostic device, wherein the diagnostic request message is used to request diagnosis of a target object, and the diagnostic request message includes mutually exclusive attribute information of a first session, wherein the first session is associated with a first diagnostic channel between the diagnostic device and the target object; a processing unit, configured to perform a session management operation according to the mutually exclusive attribute information of the first session; The transceiver unit is further configured to send a diagnosis response message to the diagnosis device, wherein the diagnosis response message is used to indicate a session management result.
23. An on-board diagnostic device, characterized in that: include: a determining unit, configured to determine, based on a target diagnostic task, a diagnostic request message for requesting diagnosis of a target object, the diagnostic request message including mutually exclusive attribute information of a first session, the first session being associated with a first diagnostic channel between the diagnostic apparatus and the target object; a transceiver unit, configured to send the diagnosis request message to the first diagnosis agent device; The transceiver unit is further configured to receive a diagnosis response message from the first diagnosis agent device, wherein the diagnosis response message is used to indicate a session management result obtained by performing a session management operation according to the mutually exclusive attribute information of the first session.
24. A communication system, characterized in that: It comprises the on-board diagnostic agent device as claimed in claim 22 and the on-board diagnostic device as claimed in claim 23.
25. A chip system, characterized in that: It includes at least one processor and an interface circuit, wherein the processor is used to execute instructions and / or data interaction through the interface circuit, so that the chip system executes the method described in any one of claims 1-14, or the chip system executes the method described in any one of claims 15-21.
26. A terminal, characterized in that: Comprising the device as claimed in claim 22 or the chip system as claimed in claim 25, and / or, the device as claimed in claim 23 or the chip system as claimed in claim 25.
27. The terminal according to claim 26, characterized in that The terminal is a vehicle.
28. An electronic control unit, characterized in that: The method comprises means for implementing the method according to any one of claims 1 to 14.
29. A diagnostic device, characterized in that The method comprises means for implementing the method according to any one of claims 15 to 21.
30. A computer-readable storage medium, characterized in that The method comprises a program or an instruction. When the program or the instruction is executed, the method according to any one of claims 1 to 14 is executed, or the method according to any one of claims 15 to 21 is executed.
Citation Information
Cited By
Remote consultation method, storage medium, server, client and system
CN121098905A
