An ECU upgrading method, device and equipment based on a UDS protocol and a storage medium
Through the ECU upgrade method based on the UDS protocol, the Ethernet interface is used to implement the upgrade of ECUs that are not configured with an operating system, which solves the problem of low upgrade efficiency of ECUs that are not configured with an operating system and realizes efficient and safe ECU software upgrade.
Patent Information
- Application Number
- CN202211152244.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-21
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-09-21
AI Technical Summary
In the existing technology, ECUs that are not equipped with an operating system cannot efficiently perform software upgrades under the Ethernet architecture, cannot take advantage of the transmission advantages of Ethernet, and traditional upgrade methods are inefficient.
An ECU upgrade method based on the UDS protocol is adopted to implement the ECU upgrade process through the Ethernet interface. The interaction process and message format are designed, and combined with security authentication steps to ensure the security and efficiency of the upgrade.
Without adopting the SOA method, the advantages of Ethernet transmission are utilized to improve the efficiency and security of ECU upgrades, with strong applicability and convenient expansion and development.
Smart Images

Figure CN115580536B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present invention relate to the field of vehicle networking technology, and in particular to an ECU upgrade method, device, equipment, and storage medium based on the UDS protocol. Background Art
[0002] In current vehicles that combine mechanical power technology and electronic information technology, ECU (Electronic Control Unit) is one of the core electronic components that complete the control of various vehicle components. Software upgrades to the ECU can improve performance experience simply and efficiently.
[0003] Under the Ethernet architecture, for ECUs equipped with operating systems, the current related technology can use SOA (Service-Oriented Architecture) to implement ECU upgrades. However, for ECUs not equipped with operating systems, only some traditional methods can be used to implement ECU upgrades, which have certain disadvantages in terms of efficiency. Summary of the Invention
[0004] In view of this, one or more embodiments of the present invention provide an ECU upgrade method, apparatus, device, and storage medium based on the UDS protocol.
[0005] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:
[0006] According to a first aspect of one or more embodiments of the present invention, a method for upgrading an ECU based on the UDS protocol is proposed. The method is targeted at an ECU not configured with an operating system under an Ethernet architecture. The method is applied to a server and includes:
[0007] Sending a UDS request message to the target client to request the target client to enter the ECU upgrade mode;
[0008] After receiving the UDS response message from the target client indicating that the target client agrees to enter the ECU upgrade mode, sending a UDS request message to the target client to request the target client to start downloading ECU upgrade data;
[0009] After receiving the UDS response message from the target client agreeing to start downloading the ECU upgrade data, sending a UDS data message to the target client based on the transmission parameters carried in the UDS response message;
[0010] After the ECU upgrade data is sent, a UDS request message is sent to the target client to request the target client to exit the ECU upgrade mode.
[0011] In an optional implementation, the method further includes:
[0012] Before interacting with the target client, receive ECU upgrade data for the target client sent by the cloud.
[0013] In an optional implementation, before sending the UDS request message to request the target client to enter the ECU upgrade mode, or before sending the UDS request message to request the target client to start downloading the ECU upgrade data, or before sending the UDS request message to request the target client to activate the ECU upgrade data, the method further includes:
[0014] A UDS request message is sent to the target client to request security authentication with the target client, and if the security authentication passes, subsequent other interactions are performed with the target client.
[0015] In an optional implementation, the sending a UDS request message to the target client to request security authentication with the target client includes:
[0016] Sending a UDS request message to the target client to request the target client to provide a key seed;
[0017] After receiving the UDS response message carrying the key seed in response to the target client, the server key is determined based on the preset algorithm and the key seed, and a UDS request message is sent to the target client to request the target client to determine whether the security authentication is passed based on the server key.
[0018] In an optional implementation, the sending a UDS request message to the target client to request the target client to exit the ECU upgrade mode includes:
[0019] After the ECU upgrade data is sent, a server-side CRC code is calculated for the ECU upgrade data, and a UDS request message is sent to the target client to request the target client to determine whether to exit the ECU upgrade mode based on the server-side CRC code.
[0020] In an optional implementation, the method further includes:
[0021] After receiving the UDS response message from the target client agreeing to exit the ECU upgrade mode, based on the vehicle operating conditions, a UDS request message is sent to the target client to request the target client to activate the ECU upgrade data, and a UDS response message carrying the activation time of the ECU upgrade data is received from the target client.
[0022] According to a second aspect of one or more embodiments of the present invention, another ECU upgrade method based on the UDS protocol is proposed. The method is for an ECU not configured with an operating system under an Ethernet architecture. The method is applied to a client and includes:
[0023] After receiving a UDS request message from the server requesting to enter the ECU upgrade mode, determining whether the current ECU state and communication state support entering the ECU upgrade mode, and if so, responding to the server with a UDS response message agreeing to enter the ECU upgrade mode;
[0024] After receiving a UDS request message from the server requesting to start downloading ECU upgrade data, determining whether the package size of the ECU upgrade data is correct, and if so, responding to the server with a UDS response message agreeing to start downloading the ECU upgrade data; wherein the UDS response message carries transmission parameters of a UDS data message for transmitting the ECU upgrade data;
[0025] Receiving a UDS data message sent by the server based on the transmission parameters;
[0026] After receiving the UDS request message from the server requesting to exit the ECU upgrade mode, it is determined whether the ECU upgrade data has been received, and if so, a UDS response message is sent to the server agreeing to exit the ECU upgrade mode.
[0027] In an optional implementation, before receiving a UDS request message from the server requesting to enter an ECU upgrade mode, or before receiving a UDS request message from the server requesting to start downloading ECU upgrade data, or before receiving a UDS request message from the server requesting to activate ECU upgrade data, the method further includes:
[0028] Receive the UDS request message from the server requesting security authentication, and perform security authentication with the server. If the security authentication passes, perform subsequent other interactions with the server.
[0029] In an optional implementation, the receiving a UDS request message from the server requesting security authentication and performing security authentication with the server includes:
[0030] After receiving the UDS request message from the server requesting the key seed, responding to the server with a UDS response message carrying the key seed;
[0031] After receiving the UDS request message carrying the server key sent by the server, the client key is compared with the server key based on a preset algorithm and the key seed and the server key, and in the case that the client key is consistent with the server key, a UDS response message of safe authentication passing is responded to the server.
[0032] In an alternative implementation, the determining whether the ECU upgrade data is received completely comprises:
[0033] A client CRC code is calculated for the currently received ECU upgrade data, and compared with a server CRC code carried in the UDS request message, and in the case that the client CRC code is consistent with the server CRC code, it is determined that the ECU upgrade data is received completely.
[0034] In an alternative implementation, the method further comprises:
[0035] After receiving the UDS request message of the server requesting to activate the ECU upgrade data, the ECU upgrade data is activated by using a local FBL mode, and a UDS response message carrying an activation time of the ECU upgrade data is responded to the server.
[0036] According to a third aspect of one or more embodiments of the present application, an ECU upgrade device based on a UDS protocol is provided, the device is for an ECU not configured with an operating system under an Ethernet architecture, the device is applied to a server, and comprises a server receiving unit and a server requesting unit; wherein:
[0037] The server receiving unit is configured to receive a UDS response message responded by a target client.
[0038] The server requesting unit is configured to send a UDS request message to a target client to request the target client to enter an ECU upgrade mode.
[0039] The server requesting unit is further configured to, after receiving a UDS response message of the target client agreeing to enter the ECU upgrade mode, send a UDS request message to the target client to request the target client to start downloading ECU upgrade data.
[0040] The server requesting unit is further configured to, after receiving a UDS response message of the target client agreeing to start downloading the ECU upgrade data, send a UDS data message to the target client based on transmission parameters carried in the UDS response message.
[0041] The server request unit is further configured to send a UDS request message to the target client to request the target client to exit the ECU upgrade mode after the ECU upgrade data is sent.
[0042] According to a fourth aspect of one or more embodiments of the present invention, a UDS-based ECU upgrade device is provided. The device is targeted at ECUs not configured with an operating system under an Ethernet architecture. The device is applied to a client, a client receiving unit, and a client responding unit; wherein:
[0043] The client receiving unit is configured to receive a UDS request message sent by the server and a UDS data message sent by the server;
[0044] The client response unit is configured to, after receiving a UDS request message from the server requesting to enter the ECU upgrade mode, determine whether the current ECU state and communication state support entering the ECU upgrade mode, and if so, respond to the server with a UDS response message agreeing to enter the ECU upgrade mode;
[0045] The client response unit is further configured to, upon receiving a UDS request message from the server requesting to start downloading ECU upgrade data, determine whether the package size of the ECU upgrade data is correct, and if so, respond to the server with a UDS response message agreeing to start downloading the ECU upgrade data; wherein the UDS response message carries transmission parameters of a UDS data message for transmitting the ECU upgrade data;
[0046] The client response unit is further configured to, after receiving the UDS request message from the server requesting to exit the ECU upgrade mode, determine whether the ECU upgrade data has been received, and if so, respond to the server with a UDS response message agreeing to exit the ECU upgrade mode.
[0047] According to a fifth aspect of one or more embodiments of the present invention, an electronic device is provided, including:
[0048] a processor, and a memory for storing instructions executable by the processor;
[0049] The processor implements the steps of the method described in the first aspect or the second aspect by running the executable instructions.
[0050] According to a sixth aspect of one or more embodiments of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the first or second aspect are implemented.
[0051] From the above description, it can be seen that, under the Ethernet architecture, the present invention designs the interactive process and message format of ECU upgrade based on the industry-wide UDS protocol for ECUs that are not configured with an operating system. Therefore, without adopting the SOA method, the software upgrade of the vehicle ECU is completed through the Ethernet interface, avoiding the problems existing in the relevant technologies. While ensuring the applicability of the solution and facilitating expansion and development, the transmission advantages of Ethernet are utilized to effectively take into account the ECU upgrade efficiency. In addition, the security authentication step further combined in the present invention can also improve the security of ECU upgrades. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A flowchart of an ECU upgrade method based on the UDS protocol is provided as an exemplary embodiment.
[0053] Figure 2 The flowchart of a method for requesting a target client to exit ECU upgrade mode is shown as an exemplary embodiment.
[0054] Figure 3 The flowchart of an ECU upgrade method based on the UDS protocol is shown as another exemplary embodiment.
[0055] Figure 4 The flowchart of a method for upgrading an ECU based on the UDS protocol is shown as another exemplary embodiment.
[0056] Figure 5 The figure is a flow chart of a method for performing security authentication between a server and a client, showing an exemplary embodiment.
[0057] Figure 6 A flowchart of another ECU upgrade method based on the UDS protocol is provided as an exemplary embodiment.
[0058] Figure 7 The present invention is a flowchart of a method for determining whether ECU upgrade data has been received, showing an exemplary embodiment.
[0059] Figure 8 The flowchart of another ECU upgrade method based on the UDS protocol is shown as another exemplary embodiment.
[0060] Figure 9 The flowchart of another ECU upgrade method based on the UDS protocol is shown as another exemplary embodiment.
[0061] Figure 10 The figure is a flow chart of a method for performing security authentication between a client and a server, showing an exemplary embodiment.
[0062] Figure 11An interaction diagram of a server and a client in an ECU upgrade process provided for an exemplary embodiment.
[0063] Figure 12 A structure diagram of an electronic device in which an ECU upgrade device based on a UDS protocol is provided for an exemplary embodiment.
[0064] Figure 13 A block diagram of an ECU upgrade device based on a UDS protocol provided for an exemplary embodiment.
[0065] Figure 14 A block diagram of another ECU upgrade device based on a UDS protocol provided for an exemplary embodiment. DETAILED DESCRIPTION
[0066] The exemplary embodiments will be described in detail herein with reference to the attached drawings. In the following description, the same numbers are used to designate the same elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not meant to represent all embodiments consistent with one or more embodiments of the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of the present application as detailed in the appended claims.
[0067] It should be noted that the steps of the methods in other embodiments are not necessarily performed in the order described in the present application. In some other embodiments, the steps of the methods can be more or less than those described in the present application. In addition, a single step described in the present application can be broken down into multiple steps in other embodiments, and multiple steps described in the present application can be combined into a single step in other embodiments.
[0068] Thanks to the development of related technologies, current vehicle systems have already been the product of the organic combination of mechanical power technology and electronic information technology, and they have better performance experience than traditional cars.
[0069] And as the core electronic element of the vehicle, the ECU (Electronic Control Unit), i.e. the "driving computer", is essentially a microchip used to coordinate and control the normal operation of each component of the vehicle. Its circuit composition includes but is not limited to microprocessors, memories, input / output interfaces, analog / digital converters and drivers. Specifically, the ECU can be an MCU (Microcontroller Unit) or a SoC (System on Chip).
[0070] In vehicle after-sales and other related businesses, ECU software upgrades, also known as ECU chip tuning, are one of the simplest and most efficient ways to improve vehicle performance. By reading and writing new data to the ECU, it can achieve better performance or add more diverse functional services.
[0071] Under the Ethernet architecture, in some new vehicles whose ECUs are equipped with operating systems, ECU software upgrades can be completed using the SOA (Service-Oriented Architecture) approach. However, for ECUs that are not equipped with an operating system, for example, when the vehicle ECU is only implemented using an MCU, the SOA approach cannot be used to complete the ECU upgrade. Developing separate protocols for this purpose is too time-consuming and labor-intensive. Therefore, currently, most vehicle ECUs that are not equipped with an operating system are remotely upgraded through CAN transmission, which cannot take advantage of the transmission advantages of Ethernet and urgently needs to be improved in terms of upgrade efficiency.
[0072] In view of this, the present invention proposes an ECU upgrade method based on the UDS protocol. The method is aimed at ECUs that are not configured with an operating system under the Ethernet architecture. The ECU upgrade process is implemented by the Ethernet interface based on the industry-wide UDS protocol. While ensuring universality, it can take into account the ECU upgrade efficiency while taking into account the advantages of Ethernet transmission.
[0073] First, the server and client in the ECU upgrade method based on the UDS protocol proposed in the present invention are explained.
[0074] It's understandable that a car can have multiple ECUs deployed in different parts of the vehicle, and they can exchange data with each other. Common vehicle ECUs include EMS (Engine Management System) and BMS (Battery Management System).
[0075] In the ECU upgrade method proposed in this invention, both the server and client are actually ECUs in the vehicle. These are referred to as "clients" to clarify the interaction during the upgrade process. The server is typically the ECU that coordinates and manages the entire vehicle network, such as a T-BOX (Telematics Box), while the client can be any ECU in the vehicle that requires a software upgrade.
[0076] Please refer to Figure 1 , Figure 1 Shown is a flowchart of an ECU upgrade method based on the UDS protocol provided by an exemplary embodiment of the present invention.
[0077] The ECU upgrade method is for an ECU that is not configured with an operating system under an Ethernet architecture. The ECU upgrade method is applied to a server and may include the following specific steps:
[0078] Step 102: Send a UDS request message to the target client to request the target client to enter the ECU upgrade mode.
[0079] In this embodiment, the interaction between the server and each client is based on the UDS protocol (Unified Diagnostic Services, ie ISO 14229, unified diagnostic services), and the message format and interaction process all comply with the requirements of the UDS protocol.
[0080] Please refer to Table 1, which is a schematic diagram of the format of a UDS message for ECU upgrade according to an exemplary embodiment of the present invention.
[0081] Field 1 Field 2 Field 3 Field 4 Field 5 … meaning Frame Type Reserve Reserve Reserve Service / Response Parameters … Field Value 0x01… —— —— —— 0x10 / 0x34... …
[0082] Table 1
[0083] As shown in Table 1 above, based on the relevant requirements of the UDS protocol regarding the message format, the present invention shows a UDS message frame structure that can be used in this case. The message frame structure stipulates that it includes a frame type for clarifying the overall purpose of the message, service parameters or response parameters for clarifying the specific service or response of the message, and a Reserve field for subsequent expansion.
[0084] The frame types include a service frame type 0x01 representing a request and a response, a data frame type 0x02 representing data to be written, and an invalid frame type 0x00 representing an ignored frame.
[0085] In the case where the UDS message is a UDS request message, the service parameters include service parameter 0x10 indicating a request to enter the ECU upgrade mode, service parameter 0x34 indicating a request to start downloading, service parameter 0x37 indicating a request to exit the ECU upgrade mode, and service parameter 0x27 indicating a request to perform security authentication.
[0086] In the case where the UDS message is a UDS response message, the response parameters include 0x7F representing a negative response, 0x50 representing an affirmative response representing consent to enter the ECU upgrade mode, 0x74 representing an affirmative response representing consent to start downloading ECU upgrade data, 0x77 representing an affirmative response representing consent to exit the ECU upgrade mode, and 0x67 representing an affirmative response for security authentication.
[0087] It can be understood that the above-mentioned message frame structure is a message format designed and allocated by the present invention based on the relevant requirements of the UDS protocol. Applicability modifications or further development using reserved fields on this basis should also be within the scope of protection of this case.
[0088] Before interacting with the target client, the server may first obtain ECU upgrade data for the target client. In one optional implementation, the server may obtain ECU upgrade data for the target client from a cloud. The cloud may specifically be a server of an automobile manufacturer providing after-sales service, and the implementation process for transmitting ECU upgrade data between the cloud and the server is not specifically limited.
[0089] After obtaining the ECU upgrade data for the target client, the server may send a UDS request message to the target client via the Ethernet interface to request the target client to enter the ECU upgrade mode.
[0090] Please refer to Table 2, which is a schematic diagram of the format of a UDS request message for requesting to enter the ECU upgrade mode according to an exemplary embodiment of the present invention.
[0091] Field 1 Field 2 Field 3 Field 4 Field 5 meaning Frame Type Reserve Reserve Reserve Service Parameters Field Value 0x01 0x00 0x00 0x00 0x10
[0092] Table 2
[0093] As shown in Table 2 above, in the UDS request message in which the server requests the target client to enter the ECU upgrade mode, the frame type is 00x1 and the service parameter is 0x10.
[0094] After receiving the UDS request message, the target client may perform demodulation and other processing based on the Ethernet communication protocol and the UDS protocol, and respond to the request to enter the ECU upgrade mode.
[0095] Step 104 : After receiving the UDS response message indicating that the target client agrees to enter the ECU upgrade mode, a UDS request message is sent to the target client to request the target client to start downloading ECU upgrade data.
[0096] In this embodiment, after the server sends a UDS request message to the target client requesting to enter the ECU upgrade mode, it will receive a UDS response message returned by the target client in response to this request, and perform demodulation and other processing based on the Ethernet communication protocol and the UDS protocol. If the UDS response message is a negative response, the upgrade can be terminated and the ECU software upgrade can be performed after the next conversation. If the UDS response message is a positive response, a UDS request message can be sent to the target client through the Ethernet interface to request the target client to start downloading the ECU upgrade data.
[0097] Please refer to Table 3, which is a schematic diagram of the format of a UDS request message for requesting to start downloading ECU upgrade data according to an exemplary embodiment of the present invention.
[0098] Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 and subsequent meaning Frame Type Reserve Reserve Reserve Service Parameters Package size Field Value 0x01 0x00 0x00 0x00 0x34 ——
[0099] Table 3
[0100] As shown in Table 3 above, in the UDS request message in which the server requests the target client to start downloading ECU upgrade data, the frame type is 0x01, the service parameter is 0x34, and in addition, the UDS request message also carries a parameter called package size, which is the package size of the ECU upgrade data.
[0101] After receiving the UDS request message, the target client may perform demodulation and other processing based on the Ethernet communication protocol and the UDS protocol, and after confirming that the program package size is correct, respond to the request to start downloading the ECU upgrade data.
[0102] It should be noted that, in some cases, before requesting the target client to start downloading the ECU upgrade data, the server will also request the target client to erase the original data.
[0103] Specifically, the server may send a UDS request message to the target client requesting to erase original data, and after receiving a UDS response message from the target client indicating that erasure of original data has been completed, send a UDS request message to the target client requesting to start downloading ECU upgrade data.
[0104] Step 106 : After receiving the UDS response message from the target client indicating that the target client agrees to start downloading the ECU upgrade data, a UDS data message is sent to the target client based on the transmission parameters carried in the UDS response message.
[0105] In this embodiment, after the server sends a UDS request message to the target client requesting to start downloading ECU upgrade data, it will receive a UDS response message returned by the target client in response to this request, and perform demodulation and other processing based on the Ethernet communication protocol and the UDS protocol. If the UDS response message is a negative response, the upgrade can be terminated and the ECU software upgrade can be carried out again after the next conversation.
[0106] In the case where the UDS response message is a positive response, the UDS response message should carry the transmission parameters for the subsequent transmission of the ECU upgrade data, such as the single packet data length SPS and the minimum time interval PT of the data packet. The server can send the UDS data message to the target client through the Ethernet interface in accordance with the requirements of the transmission parameters. Multiple UDS data messages can jointly complete the transmission of the ECU upgrade data, and each UDS data message carries part of the ECU upgrade data.
[0107] Please refer to Table 4, which is a schematic diagram of the format of a UDS data message according to an exemplary embodiment of the present invention.
[0108] Field 1 Field 2 Field 3 Field 4 Field 5 and subsequent meaning Frame Type Reserve Reserve Reserve Data to be transmitted Field Value 0x02 0x00 0x00 0x00 ——
[0109] Table 4
[0110] As shown in Table 4 above, in the UDS data message sent by the server to the target client, the frame type is 0x02, and the other fields after the reserved field are part of the ECU upgrade data to be sent this time, and the data length should not exceed the single packet data length required by the above transmission parameter SPS.
[0111] Step 108: After the ECU upgrade data is sent, a UDS request message is sent to the target client to request the target client to exit the ECU upgrade mode.
[0112] In this embodiment, after the server completes sending the ECU upgrade data to the target client, it may send a UDS request message to the target client through the Ethernet interface to request the target client to exit the ECU upgrade mode.
[0113] Please refer to Figure 2 , Figure 2 Shown is a flow chart of a method for requesting a target client to exit an ECU upgrade mode according to an exemplary embodiment of the present invention.
[0114] In order to ensure the integrity of the ECU upgrade data during transmission, in an optional implementation, in step 108, the sending of a UDS request message to the target client to request the target client to exit the ECU upgrade mode specifically includes:
[0115] Step 108a: After the ECU upgrade data is sent, a server CRC code is calculated for the ECU upgrade data, and a UDS request message is sent to the target client to request the target client to determine whether to exit the ECU upgrade mode based on the server CRC code.
[0116] Specifically, the server can calculate and determine the server CRC code (Cyclic Redundancy Check) for the ECU upgrade data that the server plans to send, and send a UDS request message carrying the server CRC code to the target client to request the target client to determine whether the ECU upgrade data is completely transmitted and whether to exit the ECU upgrade mode based on the server CRC. The specific process of calculating the CRC code can be found in the relevant principles and will not be repeated here.
[0117] Please refer to Table 5, which is a schematic diagram of the format of a UDS request message for requesting to exit the ECU upgrade mode according to an exemplary embodiment of the present invention.
[0118] Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 and subsequent meaning Frame Type Reserve Reserve Reserve Service Parameters Server CRC code Field Value 0x01 0x00 0x00 0x00 0x37 ——
[0119] Table 5
[0120] As shown in Table 5 above, in the UDS request message in which the server requests the target client to exit the ECU upgrade mode, the frame type is 0x01, the service parameter is 0x37, and in addition, the UDS request message also carries a parameter of the server CRC code.
[0121] After receiving the UDS request message, the target client can perform demodulation and other processing based on the Ethernet communication protocol and the UDS protocol, and respond to the request to exit the ECU upgrade mode after determining that the server CRC code is correct.
[0122] Please refer to Figure 3 , Figure 3 Shown is a flowchart of an ECU upgrade method based on the UDS protocol according to another exemplary embodiment of the present invention.
[0123] In an optional implementation, the ECU upgrade method further includes the following steps:
[0124] Step 110: After receiving the UDS response message from the target client agreeing to exit the ECU upgrade mode, based on the vehicle operating conditions, a UDS request message is sent to the target client to request the target client to activate the ECU upgrade data, and a UDS response message carrying the activation time of the ECU upgrade data is received from the target client.
[0125] In this embodiment, after the server sends a UDS request message requesting to exit the ECU upgrade mode to the target client, it will receive a UDS response message returned by the target client in response to this request, and perform demodulation and other processing based on the Ethernet communication protocol and the UDS protocol. At the same time, combined with parameters such as the vehicle operating conditions, if the UDS response message is a positive response and it is determined that the target client can support the ECU software upgrade, a UDS request message can be sent to the target client through the Ethernet interface to request the target client to activate the ECU upgrade data, and then receive the UDS response message carrying the activation time of the ECU upgrade data returned by the target client after completing the ECU data flashing.
[0126] Please refer to Table 6, which is a schematic diagram showing the format of a UDS request message for requesting activation of ECU upgrade data according to an exemplary embodiment of the present invention.
[0127] Field 1 Field 2 Field 3 Field 4 Field 5 meaning Frame Type Reserve Reserve Reserve Service Parameters Field Value 0x01 0x00 0x00 0x00 0x1C
[0128] Table 6
[0129] As shown in Table 6 above, in the UDS request message in which the server requests the target client to activate ECU upgrade data, the frame type is 0x01 and the service parameter is 0x1C.
[0130] After receiving the UDS request message, the target client may perform demodulation and other processing based on the Ethernet communication protocol and the UDS protocol, and respond to the request to activate the ECU upgrade data.
[0131] Please refer to Figure 4 , Figure 4 Shown is a flowchart of an ECU upgrade method based on the UDS protocol according to another exemplary embodiment of the present invention.
[0132] To ensure the security of ECU software upgrades, in an optional implementation, the above-mentioned ECU upgrade method based on the UDS protocol may further include the following steps before sending a UDS request message to request the target client to enter the ECU upgrade mode, before sending a UDS request message to request the target client to start downloading the ECU upgrade data, or before sending a UDS request message to request the target client to activate the ECU upgrade data:
[0133] A UDS request message is sent to the target client to request security authentication with the target client, and if the security authentication passes, subsequent other interactions are performed with the target client.
[0134] In this embodiment, before sending UDS request messages such as requesting to enter ECU upgrade mode, requesting to start downloading ECU upgrade data, and requesting to activate ECU upgrade data, the server can perform security authentication with the target client, exchange key seeds and keys through the Ethernet interface, determine the security of this conversation based on a preset unified encryption and decryption algorithm, and proceed to other subsequent steps if the security authentication is passed.
[0135] It is understandable that before sending a UDS request message such as requesting to erase the original data and requesting to roll back the original version, the server can also perform security authentication with the target client, and then proceed to other subsequent steps if the security authentication is passed.
[0136] Please refer to Figure 5 , Figure 5 Shown is a flow chart of a method for performing security authentication between a server and a client according to an exemplary embodiment of the present invention.
[0137] In an optional implementation, the sending a UDS request message to the target client to request security authentication with the target client specifically includes:
[0138] Step 502: Send a UDS request message to the target client to request the target client to provide a key seed;
[0139] Step 504: After receiving the UDS response message carrying the key seed from the target client, the server key is determined based on the preset algorithm and the key seed, and a UDS request message is sent to the target client to request the target client to determine whether the security authentication is passed based on the server key.
[0140] Specifically, the server can send a UDS request message to the target client through the Ethernet interface to request the target client to provide a key seed, and after receiving the UDS response message returned by the target client in response to this request, perform demodulation and other processing based on the Ethernet communication protocol and the UDS protocol. If the UDS response message is a negative response, the upgrade can be terminated and the ECU software upgrade can be carried out after the next conversation.
[0141] If the UDS response message is a positive response, the server key can be calculated based on a preset algorithm and the key seed carried in the UDS response message. A UDS request message carrying the server key is then sent to the target client, requesting the target client to determine whether security authentication has passed based on the server key. The specific form of the key and key seed, as well as the encryption and decryption algorithm used, are not specifically limited.
[0142] Please refer to Table 7, which is a schematic diagram of the format of a UDS request message for requesting to provide a key seed according to an exemplary embodiment of the present invention.
[0143] Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 meaning Frame Type Reserve Reserve Reserve Service Parameters Subservice parameters Field Value 0x01 0x00 0x00 0x00 0x27 0x41 / 0x61
[0144] Table 7
[0145] As shown in Table 7 above, in the UDS request message in which the server requests the target client to provide a key seed, the frame type is 0x01, the service parameter is 0x27, and in the security authentication before requesting to enter the ECU upgrade mode, the sub-service parameter is 0x41. In the security authentication before requesting to start downloading the ECU upgrade data, and in the security authentication before requesting to activate the ECU upgrade data, the sub-service parameter is 0x61.
[0146] After receiving the UDS request message, the target client may perform demodulation and other processing based on the Ethernet communication protocol and the UDS protocol, and respond to the request to provide a key seed.
[0147] Please refer to Table 8, which is a schematic diagram of the format of a UDS request message for requesting verification of a server key according to an exemplary embodiment of the present invention.
[0148]
[0149] Table 8
[0150] As shown in Table 8 above, in the UDS request message in which the server requests the target client to verify the server key, the frame type is 0x01, the service parameter is 0x27, the sub-service parameter is 0x42 in the security authentication before requesting to enter the ECU upgrade mode, and the sub-service parameter is 0x62 in the security authentication before requesting to start downloading the ECU upgrade data and before requesting to activate the ECU upgrade data. In addition, the UDS request message also carries the parameter of the server key.
[0151] After receiving the UDS request message, the target client can perform demodulation and other processing based on the Ethernet communication protocol and the UDS protocol, and respond to the request to verify the server key after determining that the server key is correct.
[0152] From the above description, it can be seen that, under the Ethernet architecture, the present invention designs the interactive process and message format of ECU upgrade based on the industry-wide UDS protocol for ECUs that are not configured with an operating system. In this way, the software upgrade of the vehicle ECU is completed through the Ethernet interface without adopting the SOA method, avoiding the problems existing in the relevant technologies. While ensuring the applicability of the solution and facilitating expansion and development, the transmission advantages of Ethernet are utilized to effectively take into account the ECU upgrade efficiency. In addition, the security authentication step further combined in the present invention can also improve the security of ECU upgrades.
[0153] Please refer to Figure 6 , Figure 6 Shown is a flowchart of another ECU upgrade method based on the UDS protocol provided by an exemplary embodiment of the present invention.
[0154] The ECU upgrade method is for an ECU that is not configured with an operating system under an Ethernet architecture. The ECU upgrade method is applied to a client and may include the following specific steps:
[0155] Step 602: After receiving the UDS request message from the server requesting to enter the ECU upgrade mode, determine whether the current ECU status and communication status support entering the ECU upgrade mode, and if so, respond to the server with a UDS response message agreeing to enter the ECU upgrade mode.
[0156] In this embodiment, the client is the target client for ECU upgrade, which interacts with the server through the Ethernet interface. After receiving the UDS request message sent by the server, it performs demodulation and other processing based on the Ethernet communication protocol and the UDS protocol. After determining that the server requests it to enter the ECU upgrade mode, it can determine whether the current ECU status and communication status support entering the ECU upgrade mode, and return the corresponding UDS response message to the server based on the status determination result.
[0157] Please refer to Table 9, which is a schematic diagram of the format of a UDS response message for agreeing to enter the ECU upgrade mode according to an exemplary embodiment of the present invention.
[0158] Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 and subsequent meaning Frame Type Reserve Reserve Reserve Response Parameters Sub-response parameters Field Value 0x01 0x00 0x00 0x00 0x50 0x00
[0159] Table 9
[0160] As shown in Table 9 above, in the UDS response message in which the client agrees to enter the ECU upgrade mode, the frame type is 0x01, the response parameter is 0x50, and the sub-response parameter is 0x00.
[0161] Please refer to Table 10, which is a schematic diagram showing the format of a UDS response message for disagreeing to enter the ECU upgrade mode according to an exemplary embodiment of the present invention.
[0162] Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 and subsequent meaning Frame Type Reserve Reserve Reserve Response Parameters Sub-response parameters Field Value 0x01 0x00 0x00 0x00 0x7F 0x22 / 0x78
[0163] Table 10
[0164] As shown in Table 10 above, in the UDS response message in which the client does not agree to enter the ECU upgrade mode, the frame type is 0x01, the response parameter is 0x7F, and when the relevant conditions are not met, the sub-response parameter is 0x22. When the response times out, the sub-response parameter is 0x78.
[0165] Step 604: After receiving the UDS request message from the server requesting to start downloading the ECU upgrade data, determine whether the package size of the ECU upgrade data is correct, and if so, respond to the server with a UDS response message agreeing to start downloading the ECU upgrade data; wherein, the UDS response message carries the transmission parameters of the UDS data message used to transmit the ECU upgrade data.
[0166] In this embodiment, after receiving a UDS request message from the server, the client performs demodulation and other processing based on the Ethernet communication protocol and the UDS protocol. After determining that the server has requested it to begin downloading ECU upgrade data, the client can obtain the package size carried in the UDS request message and determine whether the package size is correct. After confirming that the package size is correct, the client can return a UDS response message carrying transmission parameters to the server via the Ethernet interface. If the package size is incorrect, the client can return a UDS response message indicating a negative response. The transmission parameters are used to negotiate the specific requirements of the UDS data message for the subsequent transmission of the ECU upgrade data, including the single packet data length (SPS) and the minimum time interval (PT) for data packets.
[0167] Please refer to Table 11, which is a schematic diagram showing the format of a UDS response message for agreeing to start downloading ECU upgrade data according to an exemplary embodiment of the present invention.
[0168]
[0169] Table 11
[0170] As shown in Table 11 above, in the UDS response message in which the client agrees to start downloading ECU upgrade data, the frame type is 0x01, the response parameter is 0x74, and in addition, the UDS response message also carries transmission parameters SPS and PT.
[0171] Please refer to Table 12, which is a schematic diagram showing the format of a UDS response message for not agreeing to start downloading ECU upgrade data according to an exemplary embodiment of the present invention.
[0172] Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 and subsequent meaning Frame Type Reserve Reserve Reserve Response Parameters Sub-response parameters Field Value 0x01 0x00 0x00 0x00 0x7F 0x31 / 0x78
[0173] Table 12
[0174] As shown in Table 12 above, in the UDS response message in which the client does not agree to start downloading the ECU upgrade data, the frame type is 0x01, the response parameter is 0x7F, and when the package size is incorrect, the sub-response parameter is 0x31. When the response times out, the sub-response parameter is 0x78.
[0175] Step 606: Receive the UDS data message sent by the server based on the transmission parameters.
[0176] In this embodiment, after the client agrees to start downloading the ECU upgrade data, the client can receive the UDS data message sent by the server through the Ethernet interface. The server will send multiple UDS data messages to the client in accordance with the requirements of the above-mentioned transmission parameters for the client to subsequently perform ECU software upgrades. Multiple UDS data messages jointly complete the transmission of the ECU upgrade data, and each UDS data message carries part of the ECU upgrade data.
[0177] Step 608: After receiving the UDS request message from the server requesting to exit the ECU upgrade mode, determine whether the ECU upgrade data has been received. If so, respond to the server with a UDS response message agreeing to exit the ECU upgrade mode.
[0178] In this embodiment, after receiving the UDS request message sent by the server, the client performs demodulation and other processing based on the Ethernet communication protocol and the UDS protocol. After determining that the server requests it to exit the ECU upgrade mode, it can determine whether the ECU upgrade data has been received and return a corresponding UDS response message to the server based on the data reception result.
[0179] Please refer to Figure 7 , Figure 7 FIG2 is a flow chart of a method for determining whether ECU upgrade data has been received according to an exemplary embodiment of the present invention.
[0180] In an optional implementation, in step 608, determining whether the ECU upgrade data has been received includes:
[0181] Step 608a, calculate and determine the client CRC code for the currently received ECU upgrade data, and compare it with the server CRC code carried in the UDS request message. If the client CRC code is consistent with the server CRC code, it is determined that the ECU upgrade data has been received.
[0182] Specifically, the client can obtain the server CRC code carried in the UDS request message, calculate and determine the client CRC code for the currently received ECU upgrade data, and verify whether the server CRC code and the client CRC code are consistent. If the two are consistent, it is determined that the ECU upgrade data has been received and a UDS response message indicating a positive response is returned. If the two are inconsistent, it is determined that the ECU upgrade data has not been received and a UDS response message indicating a negative response is returned. The specific process of calculating the CRC code can be found in the relevant principles and will not be repeated here.
[0183] Please refer to Table 13, which is a schematic diagram of the format of a UDS response message for agreeing to exit the ECU upgrade mode according to an exemplary embodiment of the present invention.
[0184] Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 and subsequent meaning Frame Type Reserve Reserve Reserve Response Parameters Client CRC code Field Value 0x01 0x00 0x00 0x00 0x77 ——
[0185] Table 13
[0186] As shown in Table 13 above, in the UDS response message in which the client agrees to exit the ECU upgrade mode, the frame type is 0x01, the response parameter is 0x77, and in addition, the UDS response message also carries a parameter of the client CRC code.
[0187] Please refer to Table 14, which is a schematic diagram of the format of a UDS response message for disagreeing to exit the ECU upgrade mode, according to an exemplary embodiment of the present invention.
[0188] Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 and subsequent meaning Frame Type Reserve Reserve Reserve Response Parameters Sub-response parameters Field Value 0x01 0x00 0x00 0x00 0x7F 0x01 / 0x78
[0189] Table 14
[0190] As shown in Table 14 above, in the UDS response message in which the client does not agree to exit the ECU upgrade mode, the frame type is 0x01, the response parameter is 0x7F, and in the case of inconsistent CRC code check, the sub-response parameter is 0x01. In the case of response timeout, the sub-response parameter is 0x78.
[0191] Please refer to Figure 8 , Figure 8 Shown is a flowchart of another ECU upgrade method based on the UDS protocol according to another exemplary embodiment of the present invention.
[0192] In an alternative implementation, the ECU upgrading method further comprises the following steps:
[0193] At step 610, after receiving the UDS request message for activating the ECU upgrading data sent by the server, the client activates the ECU upgrading data by using the local FBL method and sends a UDS response message to the server, wherein the UDS response message carries the activation time of the ECU upgrading data.
[0194] In this embodiment, after the client determines that the ECU upgrading data has been received and sends a UDS response message to the server, the client receives a UDS request message sent by the server, decodes and processes the UDS request message based on the Ethernet communication protocol and the UDS protocol, determines that the server requests the client to activate the ECU upgrading data, and then activates the program package by using the local FBL method. After the ECU software upgrading is completed, the client sends a UDS response message to the server, wherein the UDS response message carries the activation time of the ECU upgrading data and indicates a positive response. If the ECU software upgrading fails, the client sends a UDS response message to the server, wherein the UDS response message indicates a negative response.
[0195] Please refer to Table 15, which shows the format of a UDS response message for agreeing to activate ECU upgrading data according to an example embodiment of the present application.
[0196] Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 and subsequent meaning Frame Type Reserve Reserve Reserve Response Parameters Activation time Field Value 0x01 0x00 0x00 0x00 0x4C ——
[0197] Table 15
[0198] As shown in Table 15, in the UDS response message for agreeing to activate ECU upgrading data sent by the client, the frame type is 0x01 and the response parameter is 0x4C. In addition, the UDS response message carries the activation time of the ECU upgrading data.
[0199] Please refer to Table 16, which shows the format of a UDS response message for disagreeing to activate ECU upgrading data according to an example embodiment of the present application.
[0200] Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 and subsequent meaning Frame Type Reserve Reserve Reserve Response Parameters Sub-response parameters Field Value 0x01 0x00 0x00 0x00 0x7F 0x22 / 0x78
[0201] Table 16
[0202] As shown in Table 16, in the UDS response message for disagreeing to activate ECU upgrading data sent by the client, the frame type is 0x01 and the response parameter is 0x7F. In the case that the related conditions are not met, the sub-response parameter is 0x22. In the case that the response is timed out, the sub-response parameter is 0x78.
[0203] Please refer to Figure 9 , Figure 9 Shown is a flowchart of another ECU upgrade method based on the UDS protocol according to yet another exemplary embodiment of the present invention.
[0204] To ensure the security of ECU software upgrades, in an optional implementation, the above-mentioned ECU upgrade method based on the UDS protocol may further include the following specific steps before receiving a UDS request message from the server requesting to enter the ECU upgrade mode, or before receiving a UDS request message from the server requesting to start downloading ECU upgrade data, or before receiving a UDS request message from the server requesting to activate ECU upgrade data:
[0205] Receive the UDS request message from the server requesting security authentication, and perform security authentication with the server. If the security authentication passes, perform subsequent other interactions with the server.
[0206] In this embodiment, before receiving UDS request messages such as requests to enter ECU upgrade mode, requests to start downloading ECU upgrade data, and requests to activate ECU upgrade data, the target client can perform security authentication with the server, exchange key seeds and keys through the Ethernet interface, determine the security of this conversation based on a preset unified encryption and decryption algorithm, and proceed to other subsequent steps if the security authentication is passed.
[0207] It is understandable that before receiving UDS request messages such as requesting to erase original data and requesting to roll back the original version, the target client can also perform security authentication with the server, and then perform other subsequent steps if the security authentication is passed.
[0208] Please refer to Figure 10 , Figure 10 Shown is a flow chart of a method for performing security authentication between a client and a server according to an exemplary embodiment of the present invention.
[0209] In an optional implementation, the receiving a UDS request message from the server requesting security authentication and performing security authentication with the server includes:
[0210] Step 1002: After receiving the UDS request message from the server requesting the key seed, respond to the server with a UDS response message carrying the key seed;
[0211] Step 1004: After receiving the UDS request message carrying the server key sent by the server, the client key and the server key are compared based on a preset algorithm, the key seed and the server key. If the client key is consistent with the server key, a UDS response message indicating that the security authentication is passed is sent to the server.
[0212] Specifically, the client performs demodulation and other processing based on the Ethernet communication protocol and the UDS protocol, and after determining that it has received the UDS request message from the server requesting it to provide a key seed, it can return a UDS response message carrying the key seed to the server through the Ethernet interface.
[0213] After the client returns a UDS response message carrying a key seed to the server, the client will receive a UDS request message from the server carrying the server key. The client can calculate and determine the client key based on a preset algorithm and the key seed, and verify whether the server key and the client key are consistent. If the two are consistent, the client determines that the security authentication has passed and returns a UDS response message representing a positive response. If the two are inconsistent, the client determines that the security authentication has failed and returns a UDS response message representing a negative response. The specific form of the key and key seed, as well as the encryption and decryption algorithm used, are not specifically limited.
[0214] Please refer to Table 17, which is a schematic diagram of the format of a UDS response message for providing a key seed according to an exemplary embodiment of the present invention.
[0215]
[0216] Table 17
[0217] As shown in Table 17 above, in the UDS response message in which the client provides the key seed, the frame type is 0x01, the response parameter is 0x67, the sub-response parameter is 0x41 in the security authentication before requesting to enter the ECU upgrade mode, and the sub-response parameter is 0x61 in the security authentication before requesting to start downloading the ECU upgrade data and before requesting to activate the ECU upgrade data. In addition, the UDS response message also carries the key seed parameter.
[0218] Please refer to Table 18, which is a schematic diagram of the format of a UDS response message that passes security authentication according to an exemplary embodiment of the present invention.
[0219] Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 and subsequent meaning Frame Type Reserve Reserve Reserve Response Parameters Sub-response parameters Field Value 0x01 0x00 0x00 0x00 0x67 0x42 / 0x62
[0220] Table 18
[0221] As shown in Table 18 above, in the UDS response message of the client that passes the security authentication, the frame type is 0x01, the response parameter is 0x67, the sub-response parameter is 0x42 in the security authentication before requesting to enter the ECU upgrade mode, and the sub-service parameter is 0x62 in the security authentication before requesting to start downloading the ECU upgrade data and the security authentication before requesting to activate the ECU upgrade data.
[0222] Please refer to Table 19, which is a schematic diagram showing the format of a UDS response message that fails security authentication according to an exemplary embodiment of the present invention.
[0223] Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 and subsequent meaning Frame Type Reserve Reserve Reserve Response Parameters Sub-response parameters Field Value 0x01 0x00 0x00 0x00 0x7F 0x01 / 0x78 / 0x7E
[0224] Table 19
[0225] As shown in Table 19 above, in the UDS response message in which the client fails the security authentication, the frame type is 0x01, the response parameter is 0x7F, and in the case of inconsistent key verification, the sub-response parameter is 0x01. In the case of response timeout, the sub-response parameter is 0x78. In the case of non-ECU upgrade mode, the sub-response parameter is 0x7E.
[0226] From the above description, it can be seen that, under the Ethernet architecture, the present invention designs the interactive process and message format of ECU upgrade based on the industry-wide UDS protocol for ECUs that are not configured with an operating system. In this way, the software upgrade of the vehicle ECU is completed through the Ethernet interface without adopting the SOA method, avoiding the problems existing in the relevant technologies. While ensuring the applicability of the solution and facilitating expansion and development, the transmission advantages of Ethernet are utilized to effectively take into account the ECU upgrade efficiency. In addition, the security authentication step further combined in the present invention can also improve the security of ECU upgrades.
[0227] In order to make those skilled in the art understand the technical solution provided by the present invention more clearly, Figure 11 The interaction diagram shown is further explained.
[0228] Please refer to Figure 11 , Figure 11 Shown is an interaction diagram between a server and a client during an ECU upgrade process provided by an exemplary embodiment of the present invention.
[0229] Figure 11 The interaction shown here is the complete interaction process between the server and the target client to successfully upgrade the ECU based on the UDS protocol. The specific steps are as follows:
[0230] In step 1101 , the server sends a UDS request message to a target client, requesting the target client to provide a key seed.
[0231] Step 1102: The target client returns a UDS response message carrying the key seed to the server.
[0232] In step 1103 , the server calculates and determines the server key based on a preset algorithm and the key seed carried in the received UDS response message, and sends a UDS request message carrying the server key to the target client to request the target client to verify the server key.
[0233] In step 1104, the target client verifies whether the client key is consistent with the server key based on the preset algorithm, key seed, and the server key carried in the received UDS request message, and returns a UDS response message indicating that the security authentication is passed to the server after confirming that the two are consistent.
[0234] In step 1105 , the server sends a UDS request message to the target client, requesting the target client to enter an ECU upgrade mode.
[0235] In step 1106 , the target client returns a UDS response message to the server, indicating that the target client agrees to enter the ECU upgrade mode.
[0236] In step 1107, the server sends a UDS request message to the target client, requesting the target client to pass the key seed.
[0237] In step 1108, the target client returns a UDS response message carrying the key seed to the server.
[0238] In step 1109 , the server calculates and determines the server key based on a preset algorithm and the key seed carried in the received UDS response message, and sends a UDS request message carrying the server key to the target client to request the target client to verify the server key.
[0239] In step 1110, the target client verifies whether the client key is consistent with the server key based on the preset algorithm, key seed, and the server key carried in the received UDS request message, and after confirming that the two are consistent, returns a UDS response message indicating that the security authentication is passed to the server.
[0240] In step 1111 , the server sends a UDS request message carrying a program package size to the target client, requesting the target client to start downloading ECU upgrade data.
[0241] In step 1112, the target client verifies whether the package size carried in the received UDS request message is correct. After confirming that the package size is correct, the target client returns a UDS response message carrying transmission parameters to the server, agreeing to start downloading the ECU upgrade data.
[0242] In step 1113 , the server sends UDS data messages to the target client based on the transmission parameters carried in the received UDS response message until the ECU upgrade data is sent.
[0243] Step 1114 : Calculate and determine the server-side CRC code for the ECU upgrade data, and send a UDS request message carrying the server-side CRC code to the target client, requesting the target client to exit the ECU upgrade mode.
[0244] In step 1115, the target client calculates the client CRC code for the currently received ECU upgrade data, verifies whether the client CRC code is consistent with the server CRC code carried in the received UDS request message, and after confirming that the two are consistent, returns a UDS response message to the server agreeing to exit the ECU upgrade mode.
[0245] In step 1116, the server sends a UDS request message to the target client, requesting the target client to pass the key seed.
[0246] In step 1117, the target client returns a UDS response message carrying the key seed to the server.
[0247] In step 1118, the server calculates and determines the server key based on a preset algorithm and the key seed carried in the received UDS response message, and sends a UDS request message carrying the server key to the target client to request the target client to verify the server key.
[0248] In step 1119, the target client verifies whether the client key is consistent with the server key based on the preset algorithm, key seed, and the server key carried in the received UDS request message, and after confirming that the two are consistent, returns a UDS response message indicating that the security authentication is passed to the server.
[0249] In step 1120 , the server sends a UDS request message to the target client, requesting the target client to activate ECU upgrade data.
[0250] In step 1121 , the target client activates the ECU upgrade data in a local FBL manner, and returns a UDS response message carrying the activation time of the ECU upgrade data to the server.
[0251] Please refer to Figure 12 , Figure 12The figure shows a schematic diagram of the structure of an electronic device in which an ECU upgrade device based on the UDS protocol is provided, provided by an exemplary embodiment of the present invention. At the hardware level, the electronic device includes a processor 1202, an internal bus 1204, a network interface 1206, a memory 1208, and a non-volatile memory 1210, and may also include hardware required for other services. One or more embodiments of the present invention can be implemented based on software, such as the processor 1202 reading the corresponding computer program from the non-volatile memory 1210 into the memory 1208 and then running it. Of course, in addition to software implementation, one or more embodiments of the present invention do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0252] Please refer to Figure 13 , Figure 13 FIG2 is a block diagram of an ECU upgrade device based on the UDS protocol provided by an exemplary embodiment of the present invention. The ECU upgrade device can be applied to Figure 12 The electronic device shown in the figure is used to implement the technical solution of the present invention. The ECU upgrade device is for ECUs that are not equipped with an operating system under the Ethernet architecture. The ECU upgrade device is applied to the server and includes a server receiving unit 1310 and a server requesting unit 1320; wherein:
[0253] The server receiving unit 1310 is configured to receive a UDS response message from a target client;
[0254] The server request unit 1320 is configured to send a UDS request message to the target client to request the target client to enter the ECU upgrade mode;
[0255] The server request unit 1320 is further configured to, after receiving a UDS response message from the target client indicating that the target client agrees to enter the ECU upgrade mode, send a UDS request message to the target client to request the target client to start downloading ECU upgrade data;
[0256] The server request unit 1320 is further configured to, after receiving a UDS response message from the target client indicating that the target client agrees to start downloading the ECU upgrade data, send a UDS data message to the target client based on the transmission parameters carried in the UDS response message;
[0257] The server request unit 1320 is further configured to send a UDS request message to the target client to request the target client to exit the ECU upgrade mode after the ECU upgrade data is sent.
[0258] Optionally, the server receiving unit 1310 is further configured to:
[0259] Before interacting with the target client, receive ECU upgrade data for the target client sent by the cloud.
[0260] Optionally, the server request unit 1320, before sending a UDS request message to request the target client to enter the ECU upgrade mode, or before sending a UDS request message to request the target client to start downloading the ECU upgrade data, or before sending a UDS request message to request the target client to activate the ECU upgrade data, is further configured to:
[0261] A UDS request message is sent to the target client to request security authentication with the target client, and if the security authentication passes, subsequent other interactions are performed with the target client.
[0262] Optionally, the server request corresponds to 1320, and when sending a UDS request message to the target client to request security authentication with the target client, is specifically used to:
[0263] Sending a UDS request message to the target client to request the target client to provide a key seed;
[0264] After receiving the UDS response message carrying the key seed in response to the target client, the server key is determined based on the preset algorithm and the key seed, and a UDS request message is sent to the target client to request the target client to determine whether the security authentication is passed based on the server key.
[0265] Optionally, when the server request unit 1320 sends a UDS request message to the target client to request the target client to exit the ECU upgrade mode, it is specifically configured to:
[0266] After the ECU upgrade data is sent, a server-side CRC code is calculated for the ECU upgrade data, and a UDS request message is sent to the target client to request the target client to determine whether to exit the ECU upgrade mode based on the server-side CRC code.
[0267] Optionally, the server request unit 1320 is further configured to:
[0268] After receiving the UDS response message from the target client agreeing to exit the ECU upgrade mode, based on the vehicle operating conditions, a UDS request message is sent to the target client to request the target client to activate the ECU upgrade data, and a UDS response message carrying the activation time of the ECU upgrade data is received from the target client.
[0269] Please refer to Figure 14 , Figure 14 FIG2 is a block diagram of another ECU upgrade device based on the UDS protocol provided by an exemplary embodiment of the present invention. The ECU upgrade device can be applied to Figure 12 The electronic device shown in the figure is used to implement the technical solution of the present invention. The ECU upgrade device is for ECUs that are not equipped with an operating system under the Ethernet architecture. The ECU upgrade device is applied to the client and includes a client receiving unit 1410 and a client responding unit 1420; wherein:
[0270] The client receiving unit 1410 is configured to receive a UDS request message sent by a server and a UDS data message sent by the server;
[0271] The client response unit 1420 is configured to, upon receiving a UDS request message from the server requesting to enter the ECU upgrade mode, determine whether the current ECU state and communication state support entering the ECU upgrade mode, and if so, respond to the server with a UDS response message agreeing to enter the ECU upgrade mode;
[0272] The client response unit 1420 is further configured to, upon receiving the UDS request message from the server requesting to start downloading the ECU upgrade data, determine whether the package size of the ECU upgrade data is correct, and if so, respond to the server with a UDS response message agreeing to start downloading the ECU upgrade data; wherein the UDS response message carries transmission parameters of the UDS data message for transmitting the ECU upgrade data;
[0273] The client response unit 1420 is further configured to, after receiving the UDS request message from the server requesting to exit the ECU upgrade mode, determine whether the ECU upgrade data has been received, and if so, respond to the server with a UDS response message agreeing to exit the ECU upgrade mode.
[0274] Optionally, the client receiving unit 1410, before receiving a UDS request message from the server requesting to enter the ECU upgrade mode, or before receiving a UDS request message from the server requesting to start downloading the ECU upgrade data, or before receiving a UDS request message from the server requesting to activate the ECU upgrade data, is further configured to:
[0275] Receive the UDS request message from the server requesting security authentication, and perform security authentication with the server. If the security authentication passes, perform subsequent other interactions with the server.
[0276] Optionally, the client response unit 1420, in response to receiving the UDS request message in which the server requests to perform security authentication, and performing security authentication with the server, is specifically configured to:
[0277] after receiving the UDS request message in which the server requests a key seed, responding to the server with a UDS response message carrying the key seed;
[0278] after receiving the UDS request message in which the server sends the server key, comparing the client key with the server key based on a preset algorithm, the key seed and the server key, and in the case that the client key is consistent with the server key, responding to the server with a UDS response message indicating that the security authentication is passed.
[0279] Optionally, the client response unit 1420, in determining whether the ECU upgrade data is received completely, is specifically configured to:
[0280] calculating a client CRC code for the currently received ECU upgrade data, and comparing the client CRC code with a server CRC code carried in the UDS request message, and in the case that the client CRC code is consistent with the server CRC code, determining that the ECU upgrade data is received completely.
[0281] Optionally, the client response unit 1420 is further configured to:
[0282] after receiving the UDS request message in which the server requests to activate the ECU upgrade data, activating the ECU upgrade data in a local FBL mode, and responding to the server with a UDS response message carrying an activation time of the ECU upgrade data.
[0283] The system, device, module or unit illustrated in the above embodiments can be specifically implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0284] In a typical configuration, a computer includes one or more processors (CPU), input / output interface, network interface, and memory.
[0285] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0286] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0287] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0288] The foregoing description describes specific embodiments of the present invention. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0289] The terminology used by the one or more embodiments of the application, is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0290] It is to be understood that the one or more embodiments of the application can be employed in which the term first, second, third and the like can be used herein to describe various information. Such information should not be limited by these terms. These terms are only used to distinguish one category of information from another. For example, a first information can also be termed a second information, and, similarly, a second information can also be termed a first information, without departing from the scope of the one or more embodiments of the application. The word "if' as used herein means "when" or "upon" or "in response to the determination" depending on the context.
[0291] The foregoing is merely illustrative of the one or more embodiments of the application, and is not intended to limit the one or more embodiments of the application. Any modification, equivalent replacement, improvement, and the like made within the spirit and principle of the one or more embodiments of the application are intended to be included in the scope of the one or more embodiments of the application.
Claims
1. An ECU upgrade method based on the UDS protocol, characterized in that: The method is for an ECU that is not configured with an operating system under an Ethernet architecture. The method is applied to a server and includes: Sending a UDS request message to the target client to request the target client to enter the ECU upgrade mode; After receiving the UDS response message from the target client indicating that the target client agrees to enter the ECU upgrade mode, sending a UDS request message to the target client requesting to erase the original data, and after receiving the UDS response message from the target client indicating that the original data erasure is completed, sending a UDS request message to the target client to request the target client to start downloading the ECU upgrade data; After receiving the UDS response message from the target client agreeing to start downloading the ECU upgrade data, sending a UDS data message to the target client based on the transmission parameters carried in the UDS response message; After the ECU upgrade data is sent, a UDS request message is sent to the target client to request the target client to exit the ECU upgrade mode; After receiving the UDS response message from the target client agreeing to exit the ECU upgrade mode, based on the vehicle operating conditions, a UDS request message is sent to the target client to request the target client to activate the ECU upgrade data, and a UDS response message carrying the activation time of the ECU upgrade data is received from the target client.
2. The method according to claim 1, characterized in that The method further comprises: Before interacting with the target client, receive ECU upgrade data for the target client sent by the cloud.
3. The method according to claim 1, characterized in that Before sending the UDS request message to request the target client to enter the ECU upgrade mode, or before sending the UDS request message to request the target client to start downloading the ECU upgrade data, or before sending the UDS request message to request the target client to activate the ECU upgrade data, the method further includes: A UDS request message is sent to the target client to request security authentication with the target client, and if the security authentication passes, subsequent other interactions are performed with the target client.
4. The method according to claim 3, characterized in that The sending of a UDS request message to the target client to request security authentication with the target client includes: Sending a UDS request message to the target client to request the target client to provide a key seed; After receiving the UDS response message carrying the key seed in response to the target client, the server key is determined based on the preset algorithm and the key seed, and a UDS request message is sent to the target client to request the target client to determine whether the security authentication is passed based on the server key.
5. The method according to claim 1, wherein The sending a UDS request message to the target client to request the target client to exit the ECU upgrade mode includes: After the ECU upgrade data is sent, a server-side CRC code is calculated for the ECU upgrade data, and a UDS request message is sent to the target client to request the target client to determine whether to exit the ECU upgrade mode based on the server-side CRC code.
6. An ECU upgrade method based on the UDS protocol, characterized in that: The method is for an ECU that is not configured with an operating system under an Ethernet architecture. The method is applied to a client and includes: After receiving a UDS request message from the server requesting to enter the ECU upgrade mode, determining whether the current ECU state and communication state support entering the ECU upgrade mode, and if so, responding to the server with a UDS response message agreeing to enter the ECU upgrade mode; After receiving a UDS request message from the server requesting to erase existing data, erasing the UDS request message for the existing data and sending a UDS response message to the server indicating that erasing of the existing data has been completed; after receiving a UDS request message from the server requesting to start downloading ECU upgrade data, determining whether the package size of the ECU upgrade data is correct and, if so, responding to the server with a UDS response message agreeing to start downloading the ECU upgrade data; wherein the UDS response message carries transmission parameters for transmitting the UDS data message for the ECU upgrade data; Receiving a UDS data message sent by the server based on the transmission parameters; After receiving the UDS request message from the server requesting to exit the ECU upgrade mode, determining whether the ECU upgrade data has been received, and if so, responding to the server with a UDS response message agreeing to exit the ECU upgrade mode; After receiving the UDS request message from the server requesting to activate the ECU upgrade data, the ECU upgrade data is activated in a local FBL manner, and a UDS response message carrying the activation time of the ECU upgrade data is responded to the server.
7. The method according to claim 6, characterized in that Before receiving a UDS request message from the server requesting to enter an ECU upgrade mode, or before receiving a UDS request message from the server requesting to start downloading ECU upgrade data, or before receiving a UDS request message from the server requesting to activate ECU upgrade data, the method further includes: Receive the UDS request message from the server requesting security authentication, and perform security authentication with the server. If the security authentication passes, perform subsequent other interactions with the server.
8. The method according to claim 7, characterized in that The receiving a UDS request message from the server requesting security authentication, and performing security authentication with the server, includes: After receiving the UDS request message from the server requesting the key seed, responding to the server with a UDS response message carrying the key seed; After receiving the UDS request message carrying the server key sent by the server, the client key and the server key are compared based on the preset algorithm, the key seed and the server key. If the client key is consistent with the server key, the server responds to the server with a UDS response message indicating that the security authentication is passed.
9. The method according to claim 6, characterized in that The determining whether the ECU upgrade data has been received includes: The client CRC code is calculated and determined for the currently received ECU upgrade data, and compared with the server CRC code carried in the UDS request message. If the client CRC code is consistent with the server CRC code, it is determined that the ECU upgrade data has been received.
10. An ECU upgrade device based on the UDS protocol, characterized in that: The device is for an ECU that is not configured with an operating system under an Ethernet architecture. The device is applied to a server and includes a server receiving unit and a server requesting unit; wherein: The server receiving unit is configured to receive a UDS response message from the target client; The server request unit is configured to send a UDS request message to the target client to request the target client to enter an ECU upgrade mode; The server request unit is further configured to, after receiving a UDS response message from the target client indicating that the target client agrees to enter the ECU upgrade mode, send a UDS request message to the target client requesting that the original data be erased, and after receiving a UDS response message from the target client indicating that the original data has been erased, send a UDS request message to the target client requesting that the target client start downloading the ECU upgrade data; The server request unit is further configured to, after receiving a UDS response message from the target client indicating that the target client agrees to start downloading the ECU upgrade data, send a UDS data message to the target client based on the transmission parameters carried in the UDS response message; The server request unit is further configured to send a UDS request message to the target client to request the target client to exit the ECU upgrade mode after the ECU upgrade data is sent. The server request unit is further used to, after receiving the UDS response message from the target client agreeing to exit the ECU upgrade mode, send a UDS request message to the target client based on the vehicle operating condition to request the target client to activate the ECU upgrade data, and receive a UDS response message from the target client carrying the activation time of the ECU upgrade data.
11. An ECU upgrade device based on the UDS protocol, characterized in that: The device is for an ECU that is not configured with an operating system under an Ethernet architecture. The device is applied to a client and includes a client receiving unit and a client responding unit; wherein: The client receiving unit is configured to receive a UDS request message sent by the server and a UDS data message sent by the server; The client response unit is configured to, after receiving a UDS request message from the server requesting to enter the ECU upgrade mode, determine whether the current ECU state and communication state support entering the ECU upgrade mode, and if so, respond to the server with a UDS response message agreeing to enter the ECU upgrade mode; The client response unit is further configured to, after receiving a UDS request message from the server requesting to erase existing data, erase the UDS request message for the existing data and send a UDS response message to the server indicating that erasure of the existing data has been completed. Furthermore, after receiving a UDS request message from the server requesting to start downloading ECU upgrade data, determine whether the package size of the ECU upgrade data is correct and, if so, respond to the server with a UDS response message agreeing to start downloading the ECU upgrade data. The UDS response message carries transmission parameters for the UDS data message used to transmit the ECU upgrade data. The client response unit is further configured to, after receiving the UDS request message from the server requesting to exit the ECU upgrade mode, determine whether the ECU upgrade data has been received, and if so, respond to the server with a UDS response message agreeing to exit the ECU upgrade mode; The client response unit is further configured to activate the ECU upgrade data in a local FBL manner after receiving a UDS request message from the server requesting activation of the ECU upgrade data, and respond to the server with a UDS response message carrying the activation time of the ECU upgrade data.
12. An electronic device comprising: processor; a memory for storing processor-executable instructions; The processor implements the steps of the method according to any one of claims 1 to 9 by running the executable instructions.
13. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Vehicle ECU software upgrading method and system, and microcontroller and SOC end of vehicle-mounted TBOX
CN111930407A
OTA upgrade control method and device, electronic equipment and automatic driving vehicle
CN114064091A