Message Sending and Receiving Control Method, Device, Vehicle and Medium Based on UDS Service

By generating UDS service requests encapsulated with service control type and specific message ID, the problem that UDS service cannot control specific messages is solved, and the ECU controls specific messages is realized, ensuring the stability of actual vehicle tests and simulates extreme environments.

CN115903752BActive Publication Date: 2025-08-01ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211652149.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-21
Publication Date
2025-08-01
Estimated Expiration
2042-12-21

AI Technical Summary

Technical Problem

The existing UDS service cannot control the vehicle ECU to send or receive specific messages, resulting in a conflict between simulated messages and real messages in the actual vehicle test, affecting the test stability.

Method used

By generating a UDS service request encapsulated with a service control type and a specific message ID, the ECU is controlled to restore or prohibit the sending or receiving of a specific message, and control of a specific message is achieved by using a service with a SID of 0x29.

Benefits of technology

Ensure the stability of the simulated test environment, avoid the impact of the original message sent by the ECU, and be able to simulate extreme environments in real-time tests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115903752B_ABST
    Figure CN115903752B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, vehicle and computer storage medium for controlling message sending and receiving based on UDS services. In this method, the vehicle generates a corresponding UDS service request according to preset request configuration parameters. Among them, the service request encapsulates a service control type and a specific message ID of the message to be processed; the UDS service request is sent to the ECU of the vehicle to control the ECU to resume or prohibit the sending and receiving of the message to be processed according to the service control type and the specific message ID. By adopting the technical solution of the present application, it is possible to use UDS services to control the vehicle ECU to send or receive one or more specific messages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of vehicles, and in particular, to a method, device, vehicle, and computer storage medium for controlling message sending and receiving based on UDS services. Background Technique

[0002] The UDS (Unified Diagnostic Services) diagnostic protocol is a general automotive diagnostic protocol that can be implemented on different automotive buses. Generally speaking, UDS includes a total of 6 categories and 26 services, and each service has its own independent SID (Service Identifier).

[0003] In UDS, the service with SID 0x28 is used for communication control, that is, this service is used to "open / close" the sending or receiving of certain messages (including conventional application messages and network management application messages) of an ECU (Electronic Control Unit). However, the service with SID 0x28 controls the sending and receiving of a class of messages of the ECU. For example, it either controls the ECU to send or receive all conventional application messages, or controls the ECU to send or receive all network management application messages.

[0004] In summary, currently, the service in UDS that controls the vehicle ECU to send or receive messages can only control the ECU to send or receive all messages of a certain category, and cannot control the ECU to send or receive a certain or multiple specific messages. Summary of the Invention

[0005] The main purpose of the present application is to provide a method, device, vehicle, and computer storage medium for controlling message sending and receiving based on UDS services, aiming to use UDS services to control the vehicle ECU to send or receive a certain or multiple specific messages.

[0006] To achieve the above object, the present application provides a method for controlling message sending and receiving based on UDS services. The method for controlling message sending and receiving based on UDS services is applied to a vehicle, and the method for controlling message sending and receiving based on UDS services includes:

[0007] Generating a corresponding UDS service request according to preset request configuration parameters, where the service request encapsulates a service control type and a specific message ID of the message to be processed;

[0008] Sending the UDS service request to the ECU of the vehicle to control the ECU to resume or prohibit the sending and receiving of the message to be processed according to the service control type and the specific message ID.

[0009] Optionally, before the step of sending the UDS service request to the ECU of the vehicle, the method further includes:

[0010] Determine whether the ECU meets the message processing condition in a preset parking state, where the message processing condition is that the ECU does not perform a critical operation of controlling the vehicle at the current moment;

[0011] The step of sending the UDS service request to the ECU of the vehicle includes:

[0012] When it is determined that the ECU meets the message processing condition, send the UDS service request to the ECU through the vehicle bus communicatively connected to the ECU.

[0013] Optionally, after the step of sending the UDS service request to the ECU of the vehicle, the method further includes:

[0014] Monitor the response data fed back by the ECU for the UDS service request;

[0015] If the response data is a negative response code, generate a new UDS service request according to the negative response code;

[0016] Resend the new UDS service request to the ECU of the vehicle to control the ECU to resume or prohibit the sending and receiving of the to-be-processed message according to the new UDS service request.

[0017] In addition, to achieve the above object, the present application further provides a message sending and receiving control method based on UDS service. The message sending and receiving control method based on UDS service is applied to the ECU of the vehicle in any of the above methods. The message sending and receiving control method based on UDS service includes:

[0018] Receive the UDS service request sent by the vehicle;

[0019] Parse the UDS service request to determine the service control type encapsulated in the UDS service request and the specific message ID of the to-be-processed message;

[0020] Resume or prohibit the sending and receiving of the to-be-processed message according to the service control type and the specific message ID.

[0021] Optionally, the step of parsing the UDS service request to determine the service control type encapsulated in the UDS service request includes:

[0022] Parse the UDS service request to extract the byte values of each message byte in the UDS service request;

[0023] Determine the service control type encapsulated in the UDS service request according to the byte values of the sub - function bytes in each of the message bytes.

[0024] Optionally, the step of parsing the UDS service request to determine the specific message ID of the message to be processed encapsulated in the UDS service request includes:

[0025] Determine the specific message ID byte of the message to be processed in each of the message bytes according to the byte values of the communication type bytes in each of the message bytes;

[0026] Determine the specific message ID of the message to be processed encapsulated in the UDS service request according to the byte value of the specific message ID byte.

[0027] Optionally, the method further includes:

[0028] Perform message checks item by item on the UDS service requests sent by the vehicle;

[0029] If the message check result corresponding to the current item of message check fails, generate a negative response code corresponding to the current item of message check, and feedback the negative response code to the vehicle for the vehicle to generate a new UDS service request according to the negative response code;

[0030] If the message check result corresponding to the current item of message check passes, continue with the next item of message check until all checks are completed.

[0031] In addition, to achieve the above - mentioned purpose, the present application further provides a message sending and receiving control device based on UDS services. The message sending and receiving control device based on UDS services is applied to a vehicle, and the message sending and receiving control device based on UDS services includes:

[0032] A request generation module, configured to generate a corresponding UDS service request according to preset request configuration parameters, wherein the service request encapsulates a service control type and a specific message ID of a message to be processed;

[0033] A request sending module, configured to send the UDS service request to the ECU of the vehicle for the ECU to resume or prohibit the sending and receiving of the message to be processed according to the service control type and the specific message ID;

[0034] The message sending and receiving control device based on UDS services is further applied to the ECU of the vehicle, and the device further includes:

[0035] A request receiving module, configured to receive the UDS service request sent by the vehicle;

[0036] A request parsing module, configured to parse the UDS service request to determine the service control type encapsulated in the UDS service request and the specific message ID of the message to be processed;

[0037] A request response module, configured to resume or prohibit the sending and receiving of the message to be processed according to the service control type and the specific message ID.

[0038] Wherein, each functional module of the message sending and receiving control device based on the UDS service can implement the steps of the message sending and receiving control method based on the UDS service as described in any one of the above when running.

[0039] In addition, to achieve the above object, the present application further provides a vehicle, which includes: a memory, a processor, and a program of the message sending and receiving control method based on the UDS service stored on the memory and executable on the processor. When the program of the message sending and receiving control method based on the UDS service is executed by the processor, the steps of the message sending and receiving control method based on the UDS service as described above can be implemented.

[0040] The present application further provides a computer storage medium, on which a program for implementing the message sending and receiving control method based on the UDS service as described above is stored. When the program of the message sending and receiving control method based on the UDS service is executed by the processor, the steps of the message sending and receiving control method based on the UDS service as described above are implemented.

[0041] In addition, to achieve the above object, the present application further provides a computer program product, including a computer program, which when executed by the processor implements the steps of the message sending and receiving control method based on the UDS service as described above.

[0042] A message sending and receiving control method, device, vehicle and computer storage medium provided by the present application. The vehicle generates a corresponding UDS service request according to preset request configuration parameters, wherein the service request encapsulates a service control type and a specific message ID of the message to be processed; then the UDS service request is sent to the ECU of the vehicle for the ECU to resume or prohibit the sending and receiving of the message to be processed according to the service control type and the specific message ID; and the ECU of the vehicle, after receiving the UDS service request sent by the vehicle, parses the UDS service request to determine the service control type encapsulated in the UDS service request and the specific message ID of the message to be processed; and thus resumes or prohibits the sending and receiving of the message to be processed according to the service control type and the specific message ID.

[0043] Thus, in this application, a UDS service request encapsulating a service control type and a pending message with a specific message ID is generated, so that the vehicle's ECU can determine the service control type and the specific message ID by parsing the UDS service request, and then respond to the request to perform corresponding functional operations only on the pending message pointed to by the specific message ID. That is, the technical solution of this application realizes using the UDS service to control the vehicle's ECU to send or receive one or more specific messages.

[0044] Furthermore, during in-vehicle testing, using the technical solution of this application to control the vehicle's ECU to send or receive one or more specific messages through the UDS service can greatly ensure the stability of the simulation test environment (when the vehicle's ECU simulates sending messages to the vehicle bus, it only sends simulated messages, thus avoiding the influence of the ECU sending original messages in the test). Moreover, by adopting the technical solution of this application, specific message IDs can be defined in the in-vehicle test environment to specify the pending messages of the ECU, thereby simulating extreme environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with this application and, together with the specification, are used to explain the principles of this application.

[0046] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0047] Figure 1 It is a schematic flowchart of the first embodiment of the method for controlling message sending and receiving based on the UDS service in this application;

[0048] Figure 2 It is a schematic application flowchart involved in an embodiment of the method for controlling message sending and receiving based on the UDS service in this application;

[0049] Figure 3 It is a schematic structural diagram of the functional modules involved in an embodiment of the device for controlling message sending and receiving based on the UDS service in this application;

[0050] Figure 4 It is a schematic structural diagram of the equipment of the hardware operating environment involved in the vehicle in the embodiment solution of this application.

[0051] The realization of the purpose, functional features, and advantages of this application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0052] It should be understood that the specific embodiments described herein are merely for explaining this application and are not intended to limit this application.

[0053] It should be noted that the UDS diagnostic protocol is a general automotive diagnostic protocol defined by ISO (International Organization for Standardization) 15765 and ISO 14229. It is located in the application layer of the OSI model (Open System Interconnection Reference Model) and can be implemented on different automotive buses. Essentially, UDS is a series of services, including a total of 6 categories and 26 types. Each service has its own independent ID, namely SID.

[0054] Among them, the service with SID of 0x28 is used for communication control. This service is used to "open / close" the sending or receiving of certain messages (conventional application messages and network management application messages) of an ECU. This service controls the sending and receiving of a category of messages, which are either conventional application messages or network management application messages. If you want to control the sending or receiving of a certain or multiple specific messages, it cannot be achieved.

[0055] In addition, during the in-vehicle environment test, it is often necessary to use CANoe (a vehicle network simulation test and analysis software) to simulate the messages of a certain ECU and only change a certain signal value of the message to meet the prerequisite conditions required for the in-vehicle test. However, when the simulated message is sent to the CAN (Controller Area Network) bus, the ECU itself is also sending this message, resulting in two frames of messages with the same ID on the CAN bus (one frame is the simulated message and the other frame is the real message), and there is a conflict in the test messages. If it can be achieved to make the ECU prohibit sending the real message, the problem of ID conflict is solved.

[0056] In summary, there is an urgent need in the industry for a UDS service solution that enables an ECU to control the sending and receiving of specific messages, for controlling the sending or receiving of a certain or multiple specific messages.

[0057] Based on the above phenomena and concepts, the embodiments of this application provide a method for controlling message sending and receiving based on UDS services. By providing a UDS service solution that enables an ECU to control the sending and receiving of specific messages, the SID of this UDS service is 0x29, to control the sending or receiving of a certain or multiple specific messages. That is, when the SID of the diagnostic request received by the ECU is 0x29, the sending or receiving of the specific message is "opened / closed" according to the parameters (control type, communication type, ID of the specific message) in the diagnostic request.

[0058] In an embodiment of the message sending and receiving control method based on the UDS service of the present application, the present application generates a UDS service request encapsulating a service control type and a specific message ID of the message to be processed. Thus, the ECU of the vehicle can determine the service control type and the specific message ID by parsing the UDS service request, and then respond to the request to perform corresponding functional operations only on the message to be processed pointed to by the specific message ID. That is, the technical solution of the present application realizes using the UDS service to control the vehicle ECU to send or receive one or more specific messages.

[0059] Furthermore, during the in-vehicle test, using the technical solution of the present application to control the vehicle ECU to send or receive one or more specific messages through the UDS service can greatly ensure the stability of the simulation test environment (when the vehicle ECU simulates sending messages to the vehicle bus, it only sends simulated messages, thus enabling the test to avoid the influence of the ECU sending original messages). Moreover, by adopting the technical solution of the present application, in the in-vehicle test environment, a specific message ID can be defined to specify the message to be processed by the ECU, thereby simulating an extreme environment.

[0060] Based on the overall concept of the message sending and receiving control method based on the UDS service of the present application described above, a first embodiment of the message sending and receiving control method based on the UDS service of the present application is proposed.

[0061] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of the first embodiment of the message sending and receiving control method based on the UDS service of the present application. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than here.

[0062] In addition, in this embodiment, the execution subject of the message sending and receiving control method based on the UDS service of the present application can be the vehicle itself, a data processing terminal integrated and assembled inside the vehicle, or a terminal device external to the vehicle. For the convenience of elaboration and reading comprehension, hereinafter, the vehicle is used as the execution subject to elaborate on the first embodiment of the message sending and receiving control method based on the UDS service of the present application.

[0063] As Figure 1 shown, in the first embodiment of the message sending and receiving control method based on the UDS service of the present application, the message sending and receiving control method based on the UDS service of the present application specifically includes the following steps:

[0064] Step S10, generate a corresponding UDS service request according to preset request configuration parameters, where the service request encapsulates a service control type and a specific message ID of the message to be processed;

[0065] In this embodiment, during the message processing process in which the vehicle controls one or more ECUs configured therein to send or receive messages, first, according to the preset request configuration parameters, a UDS service request for currently controlling the one or more ECUs to perform message processing is generated. Since it is necessary to control the one or more ECUs to process only one or more of the regular application messages or network management application messages, when the vehicle generates the UDS service request, a service control type for controlling which message processing the ECU performs currently and one or more specific message IDs of the messages to be processed by the ECU currently are encapsulated in the request.

[0066] It should be noted that, in this embodiment, the preset request configuration parameters are obtained by the vehicle through one or more data ports provided by itself. Exemplarily, as a feasible implementation manner, the vehicle can collect one or more request configuration parameters defined by the staff or the user through the human-machine interaction data port provided for the staff or the vehicle user to perform parameter configuration operations independently. Or, as another feasible implementation manner, the vehicle can also directly extract the request configuration parameters currently used to generate the UDS service request from the port provided by itself that is connected to the local or cloud database. Of course, the request configuration parameters stored in the database can be defined and stored by the staff or the user by performing corresponding operations in advance.

[0067] In addition, it should be noted that, in this embodiment, the above-mentioned request configuration parameters collected by the vehicle include but are not limited to: request service ID, sub-function, communication type, and specific message ID.

[0068] Among them, the request service ID can specifically be: 0x29; the specific message ID can be a hexadecimal data character, such as 0x00 - 0xFF;

[0069] In addition, according to different values of the sub-function, different controls (send / receive) of the ECU for the messages to be processed can be defined. The sub-function can specifically include various parameter definitions shown in Table 1 below:

[0070]

[0071] Table 1: Sub-function parameter definitions

[0072] In addition, the communication type is used to indicate the type of the specific message to be processed by the ECU. The communication type can specifically include various parameter definitions shown in Table 2 below:

[0073] Value Description Remark 0x00 Standard Frame This value indicates that the specific message to be controlled is a standard frame 0x01 Extended Frame This value indicates that the specific message to be controlled is an extended frame

[0074] Table 2: Definition of Communication Type Parameters

[0075] It should be noted that in this embodiment, the communication type is a parameter newly added compared to the existing UDS service request message. Specifically, this parameter can be added by the vehicle to the 3rd byte of the DATA (data) part in the request message when generating the UDS service request. And, if this communication type is "standard frame" (the highest bit of the standard frame is filled with 0x0 to form a 2B standard frame ID), then the 4th and 5th bytes of the DATA part are specific message IDs. If this communication type is an extended frame, then the 4th to 7th bytes of the DATA part are all specific message IDs.

[0076] In this embodiment, after the vehicle collects the above-mentioned various request configuration parameters, it can generate a UDS service request for controlling one or more ECUs of the vehicle to resume or prohibit receiving and sending specific one or more messages as shown in Table 3 below based on the parameter definitions of each of these configuration parameters:

[0077]

[0078] Table 3

[0079] Among them, in this request message, if the value of the 3rd byte is 0x00, then the 4th and 5th bytes in the request message are specific message IDs, and the 6th and 7th bytes are filled with 0x00; if the value of the 3rd byte is 0x01, then the 4th to 7th bytes in the request message are specific message IDs.

[0080] Step S20: Send the UDS service request to the ECU of the vehicle to control the ECU to resume or prohibit receiving and sending the to-be-processed message according to the service control type and the specific message ID.

[0081] In this embodiment, after the vehicle generates the message of the UDS service request according to the above process, when further determining that one or more ECUs of the vehicle to be controlled currently meet the message processing conditions for executing this UDS service request, it immediately sends this UDS service request to the one or more ECUs through the vehicle bus configured by itself, so as to control the one or more ECUs to immediately resume receiving or sending the to-be-processed message according to the service control type and the specific message ID encapsulated in this UDS service request, or prohibit receiving or sending the to-be-processed message.

[0082] Optionally, in a feasible embodiment, before the above step S20, the method for controlling message receiving and sending based on UDS service in this application may further include:

[0083] Step S30, determine whether the ECU meets the message processing condition in a preset parking state, where the message processing condition is that the ECU does not perform a key operation to control the vehicle at the current moment;

[0084] It should be noted that, in this embodiment, the preset parking state may be: the driving speed of the vehicle at the current moment is "0", and the main propulsion system of the vehicle is not activated at the current moment. In addition, the above message processing condition is that the ECU does not perform a key operation to control the vehicle at the current moment.

[0085] In this embodiment, after the vehicle generates the above UDS service request, it further detects its own state. Thus, when it is checked and determined that the driving speed at the current moment is "0" and the main propulsion system of the vehicle is also not activated at the current moment to determine that it is in the preset parking state, it further detects one or more ECUs to be controlled to see if there is a key operation to control the vehicle operation at the current moment (such as controlling the acquisition and transmission of the real-time driving speed of the vehicle, controlling the monitoring of the real-time operating temperature of the engine and / or motor during the vehicle driving process, etc.).

[0086] Based on this, the step of "sending the UDS service request to the ECU of the vehicle" may include:

[0087] When it is determined that the ECU meets the message processing condition, send the UDS service request to the ECU through the vehicle bus communicatively connected to the ECU.

[0088] In this embodiment, during the process of the vehicle further detecting whether one or more ECUs to be controlled perform a key operation to control the vehicle operation at the current moment, once it is detected that the one or more ECUs do not perform the key operation at the current moment, the vehicle determines that the one or more ECUs currently meet the message processing condition. Thus, the vehicle immediately transmits the already generated UDS service request to the one or more ECUs through the vehicle bus (such as the CAN bus) configured by itself for the one or more ECUs to respond after receiving the UDS service request.

[0089] Optionally, in another feasible embodiment, after the step S20 of sending the UDS service request to the ECU of the vehicle to control the ECU to resume or prohibit the transceiver of the pending message according to the service control type and the specific message ID, the message transceiver control method based on the UDS service of the present application may further include:

[0090] Step S40, monitor the response data fed back by the ECU for the UDS service request;

[0091] Step S50, if the response data is a negative response code, generate a new UDS service request according to the negative response code;

[0092] Step S60, resend the new UDS service request to the ECU of the vehicle to control the ECU to resume or prohibit the transceiver of the to-be-processed message according to the new UDS service request.

[0093] In this embodiment, when the vehicle sends the above UDS service request to the ECU to control the ECU to respond to the request, whether the ECU successfully responds to the request to perform corresponding processing on one or more to-be-processed messages pointed to by the above specific message ID, or fails to successfully respond to the request due to a message error, the ECU will feedback corresponding response data to the vehicle. That is, after the ECU successfully responds to the request to resume or prohibit the transceiver of the specific to-be-processed message, the ECU will feedback a positive response message to the vehicle, and when the ECU fails to respond to the request, it will still send the corresponding negative response code to the vehicle.

[0094] In this way, after the vehicle sends the UDS service request to the ECU, it enters the state of monitoring the response data feedback by the ECU, and determines whether the type of the response data is a positive response message or a negative response code. Then, if the vehicle monitors that the response data feedback by the ECU is a negative response code, the vehicle immediately adjusts the currently generated UDS service request according to the description corresponding to the negative response code to generate a new UDS service request. Finally, the vehicle resends the new UDS service request to the ECU again according to the process of the above step S20, so as to control the ECU to continue to respond to the request to resume or prohibit the transceiver of the above to-be-processed message.

[0095] It should be noted that in this embodiment, the positive response message feedback by the ECU to the vehicle can be specifically as shown in Table 4 below:

[0096] Byte Description Value #1 Positive Response Service ID 0x69 #2 Sub-function = [Control Type] 0x00—0x03

[0097] Table 4: Positive response format

[0098] In addition, in this embodiment, the specific types of the negative response codes feedback by the ECU to the vehicle can include various types as shown in Table 5 below.

[0099]

[0100]

[0101] Table 5: Negative response codes

[0102] In this embodiment, the message sending and receiving control method of the present application based on the UDS service, during the message processing process of the vehicle controlling one or more ECUs configured therein to send or receive messages, first generates a UDS service request for currently controlling the one or more ECUs to perform message processing according to preset request configuration parameters. Since it is necessary to control the one or more ECUs to process only one or more of the regular application messages or network management application messages, the vehicle encapsulates in the request the service control type for controlling what kind of message processing the ECU performs currently and the specific message ID of one or more messages to be processed by the ECU currently when generating the UDS service request. After the vehicle generates the message of the UDS service request according to the above process, when further determining that one or more ECUs of the vehicle to be controlled currently meet the message processing conditions for executing the UDS service request, it immediately sends the UDS service request to the one or more ECUs through the vehicle bus configured therein, so as to control the one or more ECUs to immediately resume receiving or sending the messages to be processed according to the service control type and specific message ID encapsulated in the UDS service request, or prohibit receiving or sending the messages to be processed.

[0103] In this way, the present application generates a UDS service request encapsulated with the service control type and the specific message ID of the message to be processed, so that the ECU of the vehicle can determine the service control type and the specific message ID by parsing the UDS service request, and then respond to the request to perform the corresponding function operation only for the message to be processed pointed to by the specific message ID. That is, the technical solution of the present application realizes using the UDS service to control the vehicle ECU to send or receive one or more specific messages.

[0104] Furthermore, during the in-vehicle test, using the technical solution of the present application to control the vehicle ECU to send or receive one or more specific messages by means of the UDS service can greatly ensure the stability of the simulation test environment (when the vehicle ECU simulates sending messages to the vehicle bus, it only sends simulated messages, so that the test avoids the influence of the ECU sending original messages). And, adopting the technical solution of the present application can also define specific message IDs in the in-vehicle test environment to specify the messages to be processed by the ECU, so as to simulate extreme environments.

[0105] Further, based on the first embodiment of the message sending and receiving control method of the present application based on the UDS service, a second embodiment of the message sending and receiving control method of the present application based on the UDS service is proposed. In this embodiment, the execution subject of the message sending and receiving control method of the present application based on the UDS service is the ECU of the vehicle.

[0106] In this embodiment, the message sending and receiving control method of the present application based on UDS service may further include:

[0107] Step A, receiving a UDS service request sent by the vehicle;

[0108] Step B, parsing the UDS service request to determine the service control type encapsulated in the UDS service request and the specific message ID of the message to be processed;

[0109] Step C, according to the service control type and the specific message ID, resume or prohibit the sending and receiving of the message to be processed.

[0110] In this embodiment, after the vehicle's ECU receives the UDS service request generated by the vehicle through the request configuration parameter, it immediately parses the UDS service request, so as to determine, from the UDS service request, the service control type encapsulated in the UDS service request and the specific message ID of one or more specific messages to be processed that the current ECU needs to process. After that, the ECU can further resume or prohibit the receiving or sending of the message to be processed according to the service control type and the specific message ID.

[0111] Optionally, in a feasible embodiment, the step of "parsing the UDS service request to determine the service control type encapsulated in the UDS service request" in the above step B may include:

[0112] Step B1, parsing the UDS service request to extract the byte values of each message byte in the UDS service request;

[0113] Step B2, determining the service control type encapsulated in the UDS service request according to the byte value of the sub-function byte in each message byte.

[0114] In this embodiment, since the vehicle encapsulates the sub-function parameter in a certain byte of the DATA part of the request message when generating the above UDS service request, when the ECU parses the UDS service request, it first parses and determines multiple message bytes in the UDS service request, and then further determines the sub-function byte encapsulating the sub-function parameter from the multiple message bytes. Furthermore, based on the byte value of the sub-function byte, it determines the service control type encapsulated in the UDS service request.

[0115] Exemplarily, in this embodiment, it is assumed that when the vehicle generates a UDS service request according to the above-mentioned requested configuration parameters, the value "0x00" of the sub-function parameter "indicating the reception of a message for restoring a specified communication type" shown in Table 1 above is added to the second byte in the UDS service request. After the ECU receives the UDS service request, it can determine from the second byte in the UDS service request, i.e., the sub-function byte, based on the value "0x00" corresponding to the sub-function byte, that the service control type encapsulated in the currently received UDS service request is "restoring the reception of a message for a specified communication type".

[0116] Optionally, in a feasible embodiment, the step of "parsing the UDS service request to determine the specific message ID encapsulated in the UDS service request" in step B above may include:

[0117] Step B3, determining the specific message ID byte of the message to be processed in each of the message bytes according to the byte value of the communication type byte in each of the message bytes;

[0118] Step B4, determining the specific message ID of the message to be processed encapsulated in the UDS service request according to the byte value of the specific message ID byte.

[0119] In this embodiment, since when the vehicle generates the above-mentioned UDS service request, a communication type parameter is added to a certain byte in the DATA part of the request message, and since different communication types indicate that different bytes in the DATA part of the UDS service request message represent specific message IDs, when the ECU parses the UDS service request, it first determines the communication type byte encapsulating the communication type parameter from the multiple message bytes in the UDS service request, and then, based on the byte value of the communication type byte, further determines the specific message ID byte encapsulating the specific message ID parameter from the multiple message bytes. Furthermore, based on the byte value of the sub-byte, the specific message ID byte encapsulated in the UDS service request is determined.

[0120] Exemplarily, in this embodiment, it is assumed that when the vehicle generates a UDS service request according to the above-mentioned requested configuration parameters, the value "0x00" of the communication type parameter indicating that the specific message to be controlled is a standard frame shown in Table 2 above is added to the third byte of the UDS service request. After the ECU receives the UDS service request, it can determine from the third byte - the communication type byte in the UDS service request that the 4th and 5th bytes of the message DATA part in the currently received UDS service request are specific message ID bytes based on the corresponding value "0x00" of the sub-function byte. After that, the ECU can read the byte values of the 4th and 5th bytes to determine the specific message ID of the message to be processed encapsulated in the currently received UDS service request.

[0121] Optionally, in a feasible embodiment, it is assumed that the message type being transmitted and received by the vehicle's ECU is a standard frame, and the transmitted message IDs are: 0x713, 0x7DE, 0x7EE, and 0x7DF. At this time, if the vehicle needs to control the ECU to prohibit the transmission of the specific message 0x713, the vehicle can specifically generate a UDS service request in the format shown in Table 6 below based on the requirements.

[0122]

[0123]

[0124] Table 6

[0125] After that, after the ECU responds to the UDS service request and successfully prohibits the transmission of the specific message 0x713, it immediately feeds back an affirmative response message in the format shown in Table 7 below to the vehicle.

[0126] Byte Description Value #1 Positive Response Service ID 0x69 #2 Sub-function = [Control Type] 0x03

[0127] Table 7

[0128] Optionally, in a feasible embodiment, it is assumed that the message type being transmitted and received by the vehicle's ECU is an extended frame, and the specifically received message IDs are: 0x18DBF19Fx, 0x18FF779Fx, 0x18FF639Fx, and 0x18EA009Fx. At this time, if the vehicle needs to control the ECU to receive the message 0x18EA009Fx, the vehicle can specifically generate a UDS service request in the format shown in Table 8 below based on the requirements.

[0129] Byte Parameter Name Value and Meaning #1 Request Service ID 0x29 #2 Sub-function = [Control Type] 0x02 #3 Communication Type 0x01 #4 High Byte of Specific Message ID 0x18 #5 Middle High Byte of Specific Message ID 0xEA #6 Middle Low Byte of Specific Message ID 0x00 #7 Low Byte of Specific Message ID 0x9F

[0130] Table 8

[0131] After the ECU responds to the UDS service request and successfully prohibits the reception of the specific message 0x18EA009F, it immediately sends a positive response message to the vehicle in the format shown in Table 9 below.

[0132]

[0133]

[0134] Table 9

[0135] Optionally, in another feasible embodiment of the present application, the message transceiver control method based on the UDS service may further include:

[0136] Step D, perform message inspection item by item on the UDS service request sent by the vehicle;

[0137] Step E, if the message inspection result corresponding to the current item of message inspection fails, generate a negative response code corresponding to the current item of message inspection, and feedback the negative response code to the vehicle for the vehicle to generate a new UDS service request according to the negative response code;

[0138] Step F, if the message inspection result corresponding to the current item of message inspection passes, continue to perform the next item of message inspection until all inspections are completed.

[0139] As Figure 2 shown in the application process, in this embodiment, during the process of the ECU receiving the UDS service request sent by the vehicle and responding to the UDS service request, the ECU further performs message inspections on the message length, sub-function, parameters, and sub-function execution conditions item by item for the UDS service request.

[0140] In this way, if the message inspection result corresponding to any one of the inspections fails, the ECU immediately generates a negative response code corresponding to the current item of message inspection, and then the ECU feeds back the negative response code to the vehicle through the automotive bus. In this way, the vehicle can execute the process of steps S40 to S60 based on the negative response code to generate a new UDS service request.

[0141] In addition, if the message inspection result corresponding to any one of the inspections passes, the ECU immediately continues to perform the next item of message inspection. In this way, after all message inspections pass, the ECU can immediately start to resume the reception or transmission of the message to be processed according to the encapsulated service control type and specific message ID in the UDS service request, or prohibit the reception or transmission of the message to be processed.

[0142] In this embodiment, after the vehicle's ECU receives the UDS service request generated by the above vehicle passing the request configuration parameters, it immediately parses the UDS service request, and thus, from the UDS service request, determines the service control type encapsulated in the UDS service request and the specific message ID of one or more specific messages to be processed that the current ECU needs to process. After that, the ECU can further resume or prohibit the reception or transmission of the messages to be processed according to the service control type and the specific message ID.

[0143] In this way, the present application generates a UDS service request encapsulating the service control type and the specific message ID of the message to be processed, so that the vehicle's ECU can determine the service control type and the specific message ID by parsing the UDS service request, and then respond to the request to perform corresponding functional operations only on the message to be processed pointed to by the specific message ID. That is, the technical solution of the present application realizes using the UDS service to control the vehicle ECU to send or receive one or more specific messages.

[0144] In addition, the present application also provides a message sending and receiving control device based on the UDS service, as Figure 3 shown, the message sending and receiving control device based on the UDS service of the present application is applied to a vehicle. The message sending and receiving control device based on the UDS service of the present application includes:

[0145] A request generation module, configured to generate a corresponding UDS service request according to preset request configuration parameters, wherein the service request encapsulates a service control type and a specific message ID of the message to be processed;

[0146] A request sending module, configured to send the UDS service request to the vehicle's ECU for the ECU to resume or prohibit the sending and receiving of the message to be processed according to the service control type and the specific message ID;

[0147] The message sending and receiving control device based on the UDS service is also applied to the vehicle's ECU, and the device further includes:

[0148] A request receiving module, configured to receive the UDS service request sent by the vehicle;

[0149] A request parsing module, configured to parse the UDS service request to determine the service control type and the specific message ID of the message to be processed encapsulated in the UDS service request;

[0150] A request response module, configured to resume or prohibit the sending and receiving of the message to be processed according to the service control type and the specific message ID.

[0151] Optionally, the message sending and receiving control device based on the UDS service of the present application further includes:

[0152] A condition detection module, configured to determine whether the ECU meets the message processing condition in a preset parking state, where the message processing condition is that the ECU does not perform a key operation of controlling the vehicle at the current moment;

[0153] A request sending module is further configured to, when determining that the ECU meets the message processing condition, send the UDS service request to the ECU through an automotive bus communicatively connected to the ECU.

[0154] Optionally, the message sending and receiving control device based on the UDS service of the present application further includes:

[0155] A feedback monitoring module, configured to monitor response data fed back by the ECU for the UDS service request;

[0156] A request adjustment module, configured to, if the response data is a negative response code, generate a new UDS service request according to the negative response code;

[0157] The request sending module of the message sending and receiving control device based on the UDS service of the present application is further configured to re-send the new UDS service request to the ECU of the vehicle to control the ECU to resume or prohibit the sending and receiving of the to-be-processed message according to the new UDS service request.

[0158] Optionally, the request parsing module includes:

[0159] An extraction unit, configured to parse the UDS service request to extract the byte values of each message byte in the UDS service request;

[0160] A service type determination unit, configured to determine the service control type encapsulated in the UDS service request according to the byte value of the sub-function byte in each message byte.

[0161] Optionally, the request parsing module further includes:

[0162] A determination unit, configured to determine a specific message ID byte of the to-be-processed message in each message byte according to the byte value of the communication type byte in each message byte;

[0163] An ID determination unit, configured to determine a specific message ID of the to-be-processed message encapsulated in the UDS service request according to the byte value of the specific message ID byte.

[0164] Optionally, the message sending and receiving control device based on the UDS service of the present application further includes:

[0165] A message check module is used to check each UDS service request sent by the vehicle item by item; if the message check result corresponding to the current item message check fails, a negative response code corresponding to the current item message check is generated, and the negative response code is fed back to the vehicle for the vehicle to generate a new UDS service request according to the negative response code; and if the message check result corresponding to the current item message check passes, the next item message check is continued until all checks are completed.

[0166] The specific implementation manners of the message sending and receiving control device based on UDS service in this application are basically the same as those of the embodiments of the above-mentioned message sending and receiving control method based on UDS service, and will not be elaborated here.

[0167] In addition, an embodiment of this application also provides a vehicle as mentioned in any of the above embodiments.

[0168] Refer to Figure 4 , Figure 4 which is a schematic diagram of the device structure of the hardware operating environment involved in the vehicle mentioned in the embodiment solution of this application.

[0169] As Figure 4 shown, the vehicle may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between the processor 1001 and the memory 1005. The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0170] Optionally, the vehicle may further include an ECU and a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, sensors, an audio circuit, a WiFi module, etc. The rectangular user interface may include a display screen and an input sub-module such as a keyboard. Optionally, the rectangular user interface may further include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).

[0171] Those skilled in the art can understand that Figure 4 the structure shown in

[0172] does not constitute a limitation on the vehicle. Based on different design requirements of actual applications, in different feasible implementation manners, the vehicle may of course include more or fewer components than shown in the figure, or combine some components, or have different component arrangements. Figure 4As shown in the figure, the memory 1005 as a storage medium may include an operating system, a network communication module, and a message sending and receiving control program based on the UDS service. The operating system is a program that manages and controls vehicle hardware and software resources, and supports the operation of the message sending and receiving control program based on the UDS service and other software and / or programs. The network communication module is used to implement communication between components inside the memory 1005, and communication between other hardware and software in the message sending and receiving control device based on the UDS service.

[0173] In Figure 4 the vehicle shown in the figure, the processor 1001 is used to execute the message sending and receiving control program based on the UDS service stored in the memory 1005, and implement the steps of the message sending and receiving control method based on the UDS service described in any of the above embodiments.

[0174] The specific implementation manners of the vehicle of the present application are basically the same as those of the embodiments of the above message sending and receiving control method based on the UDS service, and will not be elaborated herein.

[0175] In addition, the embodiments of the present application further provide a computer storage medium, and the computer storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of the message sending and receiving control method based on the UDS service described in any of the above.

[0176] The specific implementation manners of the computer storage medium of the present application are basically the same as those of the embodiments of the above message sending and receiving control method based on the UDS service, and will not be elaborated herein.

[0177] In addition, the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the steps of the above message sending and receiving control method based on the UDS service.

[0178] The specific implementation manners of the computer program product of the present application are basically the same as those of the embodiments of the above message sending and receiving control method based on the UDS service, and will not be elaborated herein.

[0179] It should be noted that in this article, the term "including", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, the element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.

[0180] The serial numbers of the embodiments of the present application above are only for description and do not represent the superiority or inferiority of the embodiments.

[0181] Through the description of the above embodiments, those skilled in the art can clearly understand that the above embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal device (which can be an in-vehicle computer, a smart phone, a computer, or a server, etc.) to execute the methods described in various embodiments of the present application.

[0182] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present application.

Claims

1. A message sending and receiving control method based on UDS service, characterized in that, The message sending and receiving control method based on UDS service is applied to a vehicle, and the message sending and receiving control method based on UDS service includes: Generating a corresponding UDS service request according to preset request configuration parameters, where the service request encapsulates a service control type and a specific message ID of a message to be processed, the request configuration parameters include a request service ID, a sub-function, a communication type, and a specific message ID, the sub-function is used to control the ECU to perform sending / receiving processing on the message to be processed, the communication type is a standard frame or an extended frame, in the case where the communication type is the standard frame, the UDS service request includes a first specific message ID, in the case where the communication type is the extended frame, the UDS service request includes a second specific message ID, and the byte length of the first specific message ID is less than the byte length of the second specific message ID; Sending the UDS service request to the ECU of the vehicle to control the ECU to resume or prohibit the sending and receiving of the message to be processed according to the service control type and the specific message ID.

2. The message sending and receiving control method based on the UDS service according to claim 1, wherein Before the step of sending the UDS service request to the ECU of the vehicle, the method further includes: Determining whether the ECU meets the message processing condition in a preset parking state, where the message processing condition is that the ECU does not perform a key operation of controlling the vehicle at the current moment; The step of sending the UDS service request to the ECU of the vehicle includes: When it is determined that the ECU meets the message processing condition, sending the UDS service request to the ECU through an in-vehicle bus that is communicatively connected to the ECU.

3. The message sending and receiving control method based on UDS service according to claim 1, characterized in that After the step of sending the UDS service request to the ECU of the vehicle, the method further includes: Monitoring response data fed back by the ECU for the UDS service request; If the response data is a negative response code, generating a new UDS service request according to the negative response code; Resending the new UDS service request to the ECU of the vehicle to control the ECU to resume or prohibit the sending and receiving of the message to be processed according to the new UDS service request.

4. A message sending and receiving control method based on UDS service, characterized in that, The message sending and receiving control method based on UDS service is applied to the ECU of the vehicle in the method according to any one of claims 1 to 3, and the message sending and receiving control method based on UDS service includes: Receive the UDS service request sent by the vehicle, where the UDS service request is generated based on request configuration parameters, and the request configuration parameters include a request service ID, a sub-function, a communication type, and a specific message ID. The sub-function is used to control the ECU to perform sending / receiving processing on the message to be processed. The communication type is a standard frame or an extended frame. When the communication type is the standard frame, the UDS service request contains a first specific message ID. When the communication type is the extended frame, the UDS service request contains a second specific message ID. The byte length of the first specific message ID is less than the byte length of the second specific message ID; Parse the UDS service request to determine the service control type encapsulated in the UDS service request and the specific message ID of the message to be processed; Resume or prohibit the sending and receiving of the message to be processed according to the service control type and the specific message ID.

5. The message sending and receiving control method based on UDS service according to claim 4, wherein, The step of parsing the UDS service request to determine the service control type encapsulated in the UDS service request includes: Parse the UDS service request to extract the byte values of each message byte in the UDS service request; Determine the service control type encapsulated in the UDS service request according to the byte value of the sub-function byte in each message byte.

6. The message sending and receiving control method based on UDS service according to claim 5, wherein The step of parsing the UDS service request to determine the specific message ID of the message to be processed encapsulated in the UDS service request includes: Determine the specific message ID byte of the message to be processed in each message byte according to the byte value of the communication type byte in each message byte; Determine the specific message ID of the message to be processed encapsulated in the UDS service request according to the byte value of the specific message ID byte.

7. The message sending and receiving control method based on UDS service according to any one of claims 4 to 6, characterized in that, The method further includes: Perform message checks on the UDS service requests sent by the vehicle item by item; If the message check result corresponding to the current item of message check fails, generate a negative response code corresponding to the current item of message check and feedback the negative response code to the vehicle for the vehicle to generate a new UDS service request according to the negative response code; If the message check result corresponding to the current item of message check passes, continue to perform the next item of message check until all checks are completed.

8. A message sending and receiving control device based on UDS service, characterized in that, The message sending and receiving control device based on the UDS service is applied to a vehicle. The message sending and receiving control device based on the UDS service includes: A request generation module, configured to generate a corresponding UDS service request according to preset request configuration parameters, where the service request encapsulates a service control type and a specific message ID of a message to be processed, the request configuration parameters include a request service ID, a sub-function, a communication type, and a specific message ID, the sub-function is used to control the ECU to perform sending / receiving processing on the message to be processed, the communication type is a standard frame or an extended frame, when the communication type is the standard frame, the UDS service request contains a first specific message ID, when the communication type is the extended frame, the UDS service request contains a second specific message ID, and the byte length of the first specific message ID is less than the byte length of the second specific message ID; A request sending module, configured to send the UDS service request to the ECU of the vehicle, so that the ECU can resume or prohibit the sending and receiving of the message to be processed according to the service control type and the specific message ID; The message sending and receiving control device based on the UDS service is also applied to the ECU of the vehicle, and the device further includes: A request receiving module, configured to receive the UDS service request sent by the vehicle, where the UDS service request is generated according to request configuration parameters, the request configuration parameters include a request service ID, a sub-function, a communication type, and a specific message ID, the sub-function is used to control the ECU to perform sending / receiving processing on the message to be processed, the communication type is a standard frame or an extended frame, when the communication type is the standard frame, the UDS service request contains a first specific message ID, when the communication type is the extended frame, the UDS service request contains a second specific message ID, and the byte length of the first specific message ID is less than the byte length of the second specific message ID; A request parsing module, configured to parse the UDS service request to determine the service control type encapsulated in the UDS service request and the specific message ID of the message to be processed; A request response module, configured to resume or prohibit the sending and receiving of the message to be processed according to the service control type and the specific message ID.

9. A vehicle, characterized in that, The vehicle includes: a memory, a processor, and a program stored on the memory for implementing the message sending and receiving control method based on the UDS service, The memory is used to store a program for implementing the message sending and receiving control method based on the UDS service; The processor is configured to execute the program for implementing the message sending and receiving control method based on the UDS service to implement the steps of the message sending and receiving control method based on the UDS service as described in any one of claims 1 to 7.

10. A computer storage medium, characterized in that, A program for implementing the message sending and receiving control method based on the UDS service is stored on the computer storage medium, and the program for implementing the message sending and receiving control method based on the UDS service is executed by the processor to implement the steps of the message sending and receiving control method based on the UDS service as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Hybrid electric vehicle network communication system with two CAN (Controller Area Network) buses

    CN103264673A

  • Automobile CAN bus signal simulation method and device

    CN111682993A

  • Automobile ECU diagnosis test method based on hardware-in-the-loop platform

    CN114610000A

  • Automobile remote diagnosis method and system, storage medium and equipment

    CN115469644A