Vehicle diagnosis method, device and equipment and storage medium
By using preset diagnostic verification algorithms in vehicle diagnosis technology to verify the diagnosis requests, ensuring the safe transmission of vehicle failure data, solving the problem of poor vehicle diagnosis safety in the prior art, and realizing the protection of vehicle information data .
Patent Information
- Application Number
- CN202411181864.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-08-23
AI Technical Summary
In the existing vehicle diagnostic technology, there is a lack of protection for the entire diagnostic process, which leads to third-party illegal equipment that can send diagnostic commands to the vehicle electronic control unit, endangering the safety of vehicle information and causing poor safety problems.
Using a preset diagnostic verification algorithm, the first byte verification value and diagnostic message in the diagnostic request are used to verify it, ensuring that the vehicle fault data is transmitted and diagnosed after the verification is passed, and illegal equipment is prevented from being in A diagnostic request is sent during diagnosis.
It effectively protects the security of vehicle information data, prevents illegal equipment from tampering with vehicle configuration data, and improves the overall safety of vehicle diagnosis.
Smart Images

Figure CN119200555A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of vehicle diagnosis technology, and in particular to a vehicle diagnosis method, device, equipment and storage medium. Background Art
[0002] Currently, when using diagnostic equipment to diagnose a vehicle, only each frame of the diagnostic message is verified, and the entire diagnostic process is not protected. In this way, illegal third-party devices can send diagnostic commands to the vehicle's electronic control unit (ECU) during the diagnostic process. This may pose a risk to vehicle information security, such as modifying vehicle configuration data such as VIN code and mileage, resulting in poor security of vehicle diagnosis.
[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0004] The main purpose of this application is to provide a vehicle diagnosis method, device, equipment and storage medium, aiming to solve the technical problem of poor safety of vehicle diagnosis.
[0005] To achieve the above objectives, the present application proposes a vehicle diagnosis method, which is applied to a vehicle electronic control unit and includes:
[0006] Receiving a diagnostic request sent by a diagnostic device, wherein the diagnostic request includes a first byte check value and a diagnostic message;
[0007] Based on a preset diagnostic verification algorithm, a verification is performed according to the diagnostic request and a preset vehicle verification value to obtain a diagnostic verification result;
[0008] When the diagnostic verification result is verification passed, vehicle fault data is obtained according to the diagnostic message, and the vehicle fault data is sent to the diagnostic device so that the diagnostic device can diagnose the vehicle.
[0009] In one embodiment, the diagnostic verification algorithm includes a first verification value calculation algorithm and a second verification value calculation algorithm. The diagnostic verification algorithm based on the preset is verified according to the diagnostic request and the preset vehicle verification value. The step of obtaining the diagnostic verification result includes:
[0010] Performing byte analysis on the diagnostic message to obtain message byte data;
[0011] Based on the first check value calculation algorithm, calculate according to the message byte data to obtain a second byte check value;
[0012] Based on the second check value calculation algorithm, calculate according to the second byte check value and the vehicle check value to obtain a third byte check value;
[0013] Determine whether the first byte check value and the third byte check value are consistent, and obtain the diagnostic check result, wherein when the first byte check value and the third byte check value are consistent, the diagnostic check result is check passed.
[0014] In one embodiment, the step of obtaining vehicle fault data according to the diagnostic message includes:
[0015] Parsing the diagnostic message to obtain the abnormal component name and vehicle fault code data;
[0016] Reading data of the vehicle component corresponding to the abnormal component name to obtain component abnormal parameter data;
[0017] The vehicle fault code data and component abnormality parameter data are integrated to obtain the vehicle fault data.
[0018] In one embodiment, before the step of calculating the check value based on the diagnostic request and the vehicle check value based on a preset check value calculation algorithm to obtain the second byte check value, the step further includes:
[0019] receiving an initial check value sent by the diagnostic device;
[0020] Recording the initial verification value as the vehicle verification value;
[0021] When the diagnostic verification result is a verification pass, the step of obtaining vehicle fault data according to the diagnostic message and sending the vehicle fault data to the diagnostic device for the diagnostic device to diagnose the vehicle further includes:
[0022] The first byte check value is recorded as the vehicle check value.
[0023] In addition, to achieve the above-mentioned purpose, the present application also proposes a vehicle diagnosis method, which is applied to a diagnostic device and includes:
[0024] In response to the vehicle diagnostic instruction, a diagnostic message and an initial verification value are generated, and the initial verification value is sent to the vehicle electronic control unit, so that the vehicle electronic control unit uses the initial verification value as a vehicle verification value for diagnostic verification;
[0025] Based on a preset diagnostic verification algorithm, obtaining a diagnostic request according to the diagnostic message and the initial verification value;
[0026] sending the diagnostic request to the vehicle electronic control unit;
[0027] Receiving vehicle fault data sent by the vehicle electronic control unit;
[0028] The vehicle is diagnosed based on the vehicle fault data to generate a vehicle diagnosis result.
[0029] In one embodiment, the step of obtaining a diagnosis request based on the preset diagnosis verification algorithm and the diagnosis message and the initial verification value includes:
[0030] Using the initial check value as the device check value;
[0031] Based on the diagnostic verification algorithm, a verification value is calculated according to the diagnostic message and the device verification value to obtain a first byte verification value;
[0032] Generate the diagnostic request according to the diagnostic message and the first byte check value;
[0033] After the step of receiving the vehicle fault data sent by the vehicle electronic control unit, the method further includes:
[0034] The first byte check value is used as the device check value.
[0035] In one embodiment, the step of generating a diagnostic message and an initial check value in response to a vehicle diagnostic instruction includes:
[0036] In response to the vehicle diagnostic command, receiving diagnostic function data to be performed;
[0037] generating the diagnostic message according to the diagnostic function data to be executed;
[0038] The initial verification value is generated based on a preset random number generation algorithm.
[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a vehicle diagnostic device, the vehicle diagnostic device comprising:
[0040] A receiving module, used for receiving a diagnostic request sent by a diagnostic device, wherein the diagnostic request includes a first byte check value and a diagnostic message;
[0041] A verification module, configured to perform verification based on a preset diagnostic verification algorithm, according to the diagnostic request and a preset vehicle verification value, and obtain a diagnostic verification result;
[0042] The sending module is used to obtain vehicle fault data according to the diagnostic message when the diagnostic verification result is verification passed, and send the vehicle fault data to the diagnostic device so that the diagnostic device can diagnose the vehicle.
[0043] In addition, to achieve the above objectives, the present application also proposes a vehicle diagnostic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the vehicle diagnostic method described above.
[0044] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the vehicle diagnostic method described above are implemented.
[0045] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the vehicle diagnostic method described above are implemented.
[0046] The present application provides a vehicle diagnostic method, which is based on a preset diagnostic verification algorithm, and performs verification according to a diagnostic request and a preset vehicle verification value. When the verification passes, the vehicle diagnosis is performed, thereby preventing a third-party non-diagnostic device from sending a diagnostic request to the vehicle during the diagnosis period. This solves the problem of poor security of vehicle diagnosis in the prior art and protects the security of vehicle information data. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0049] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the vehicle diagnostic method of the present application;
[0050] Figure 2 A schematic diagram of a flow chart provided for the second embodiment of the vehicle diagnostic method of the present application;
[0051] Figure 3 A schematic diagram of a process flow provided for the third embodiment of the vehicle diagnostic method of the present application;
[0052] Figure 4 This is a schematic diagram of the module structure of the vehicle diagnostic device according to an embodiment of the present application;
[0053] Figure 5Schematic diagram of the device structure of the hardware operating environment involved in the vehicle diagnostic method in the embodiment of the present application.
[0054] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0055] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0056] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0057] The main solutions of the embodiments of this application are:
[0058] Receiving a diagnostic request sent by a diagnostic device, wherein the diagnostic request includes a first byte check value and a diagnostic message;
[0059] Based on a preset diagnostic verification algorithm, a verification is performed according to the diagnostic request and a preset vehicle verification value to obtain a diagnostic verification result;
[0060] When the diagnostic verification result is verification passed, vehicle fault data is obtained according to the diagnostic message, and the vehicle fault data is sent to the diagnostic device so that the diagnostic device can diagnose the vehicle.
[0061] In order to strengthen the security management of automobile data and prevent and resolve the above-mentioned security issues and potential risks, my country has issued a series of laws and regulations to ensure the security of automobile data. In the field of intelligent connected vehicles, the Ministry of Industry and Information Technology and industry associations have also issued a number of national standards. However, from the current reality, solving the security issues of the Internet of Vehicles still needs to start from the technical level, and through strict technical means to ensure the data security of the Internet of Vehicles industry, and promote the healthy development of the Internet of Vehicles industry. In the existing technology, when diagnosing a vehicle, it can receive and reply to diagnostic requests sent by various diagnostic devices, without distinguishing them. In this way, after the formal diagnostic equipment security certification is passed, illegal devices can send diagnostic requests to modify vehicle information, and the security of vehicle diagnosis is poor.
[0062] The present application provides a solution, which is based on a preset diagnostic verification algorithm, and performs verification according to a diagnostic request and a preset vehicle verification value. When the verification passes, vehicle diagnosis is performed, thereby preventing third-party non-diagnostic devices from sending diagnostic requests to the vehicle during the diagnosis period. This solves the problem of poor security of vehicle diagnosis in the prior art and protects the security of vehicle information data.
[0063] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a vehicle diagnostic system, etc. The following takes the vehicle diagnostic system as an example to illustrate this embodiment and the following embodiments, wherein the vehicle diagnostic system includes a diagnostic device and a vehicle electronic control unit.
[0064] Based on this, the embodiment of the present application provides a vehicle diagnosis method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the vehicle diagnostic method of the present application.
[0065] In this embodiment, the vehicle diagnostic method is applied to a vehicle electronic control unit, including steps S10 to S30:
[0066] Step S10, receiving a diagnostic request sent by a diagnostic device, wherein the diagnostic request includes a first byte check value and a diagnostic message;
[0067] It should be noted that the first byte checksum is used to verify the integrity and correctness of the entire diagnostic request. It is usually a simple checksum or the result of other verification algorithms so that the vehicle electronic control unit can quickly verify whether the received data has been tampered with or damaged. The diagnostic message contains detailed diagnostic information, such as fault codes, sensor data, execution commands, etc. It is the main part of the diagnostic request and is used to describe the operations that the diagnostic device wants the vehicle electronic control unit to perform or the vehicle status that needs to be checked.
[0068] Step S20, based on a preset diagnostic verification algorithm, performing verification according to the diagnostic request and a preset vehicle verification value to obtain a diagnostic verification result;
[0069] Step S30, when the diagnosis verification result is verification passed, vehicle fault data is obtained according to the diagnosis message, and the vehicle fault data is sent to the diagnosis device so that the diagnosis device can diagnose the vehicle.
[0070] The vehicle electronic control unit runs a preset diagnostic verification algorithm and performs calculations based on the diagnostic request and the preset vehicle verification value. This may involve inputting all the data of the diagnostic request into the algorithm and generating a verification value or comparing the preset verification value. Based on the output of the algorithm, a diagnostic verification result is obtained. If the calculated verification value matches the first byte verification value, it means that the diagnostic request has passed the verification; otherwise, it may indicate that there is a problem with the request data or it has been interfered with. Then, when the diagnostic verification result is that the verification has passed, according to the diagnostic protocol and the vehicle manufacturer's standards, the vehicle electronic control unit parses the diagnostic message, obtains the vehicle fault data from various sensors, controllers or memories of the vehicle, and sends the vehicle fault data to the diagnostic device for the diagnostic device to diagnose the vehicle.
[0071] It should be noted that the diagnostic verification algorithm is an algorithm pre-set in the vehicle's electronic control unit to verify the validity and integrity of the received diagnostic request. Common algorithms include CRC (cyclic redundancy check), checksum or other fault detection codes.
[0072] In a feasible implementation manner, obtaining vehicle fault data according to the diagnostic message in step S30 may include steps S301 to S303:
[0073] Step S301, parsing the diagnostic message to obtain the abnormal component name and vehicle fault code data;
[0074] Step S302, reading data of the vehicle component corresponding to the abnormal component name to obtain component abnormal parameter data;
[0075] Step S303, integrating the vehicle fault code data and component abnormality parameter data to obtain the vehicle fault data.
[0076] The vehicle electronic control unit parses the basic structure and format of the diagnostic message according to the predefined communication protocol (such as ISO 14229, ISO 15765, etc.), which includes reading the message header information, data length, control bit, etc. The diagnostic message usually contains specific data fields, such as diagnostic service identification code (SID), parameter identification code (PID), fault code, status information, etc. These fields need to be parsed and extracted according to the protocol specification, and the abnormal component name and vehicle fault code data are obtained according to the parsed diagnostic message data, and then the vehicle component corresponding to the abnormal component name is read to obtain the component abnormal parameter data. The component abnormal parameter data may include the temperature, pressure, speed, etc. of the abnormal component. Finally, the vehicle fault code data and the component abnormal parameter data are integrated. This can be achieved by associating the two types of data to ensure that they can complement and support each other, so as to more comprehensively understand the nature and severity of the vehicle problem and obtain the vehicle fault data.
[0077] In this implementation, vehicle fault data is obtained based on the diagnostic message, ensuring that comprehensive and accurate fault information is obtained from the vehicle system, and providing a basis for the diagnostic equipment to perform effective diagnosis and maintenance.
[0078] This embodiment provides a vehicle diagnostic method, which is based on a preset diagnostic verification algorithm and performs verification according to a diagnostic request and a preset vehicle verification value. When the verification passes, the vehicle diagnosis is performed to prevent third-party non-diagnostic devices from sending diagnostic requests to the vehicle during the diagnosis period, thereby solving the problem of poor security of vehicle diagnosis in the prior art and protecting the security of vehicle information data.
[0079] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 2 , the diagnostic verification algorithm includes a first verification value calculation algorithm and a second verification value calculation algorithm, step S20 includes steps S201 to S204:
[0080] Step S201, performing byte analysis on the diagnostic message to obtain message byte data;
[0081] Step S202, based on the first check value calculation algorithm, calculate according to the message byte data to obtain a second byte check value;
[0082] Step S203, based on the second check value calculation algorithm, calculate according to the second byte check value and the vehicle check value to obtain a third byte check value;
[0083] Step S204, determining whether the first byte check value and the third byte check value are consistent, and obtaining the diagnostic check result, wherein when the first byte check value and the third byte check value are consistent, the diagnostic check result is check passed.
[0084] The vehicle electronic control unit analyzes the diagnostic message byte by byte, that is, extracts and records the message data in a byte manner, which includes converting the value or data bit of each byte into a form that can be processed by a computer to obtain the message byte data, and then based on the first check value calculation algorithm, calculates according to the message byte data to obtain the second byte check value. This calculation process usually includes processing each byte one by one, according to specific mathematical or logical operations, such as cyclic redundancy accumulation, cumulative XOR check of each byte, etc., and then based on the second check value calculation algorithm, calculates according to the second byte check value and the vehicle check value to obtain a third byte check value, which may include a hash function, CRC or other checksum algorithms, such as addition / subtraction / multiplication / division / XOR / AND combination operations, and finally determines whether the first byte check value and the third byte check value are consistent to obtain a diagnostic check result, wherein, when the first byte check value and the third byte check value are consistent, the diagnostic check result is a check pass, and if the first byte check value and the third byte check value are inconsistent, the diagnostic check result may vary according to the specific system requirements, which may be a "check failure" or require further processing or feedback of error information.
[0085] In a feasible implementation manner, before step S20, steps S401 to S402 may also be included:
[0086] Step S401, receiving an initial check value sent by the diagnostic device;
[0087] Step S402, recording the initial verification value as the vehicle verification value;
[0088] In addition, step S30 may further include step S403:
[0089] Step S403: record the first byte check value as the vehicle check value.
[0090] The vehicle electronic control unit receives the initial verification value sent by the diagnostic device and records the initial verification value as the vehicle verification value. After step S30, the first byte verification value is recorded as the vehicle verification value, and waits for the next diagnostic verification.
[0091] In this implementation, by using the received initial check value as the vehicle check value and using the first byte check value as the vehicle check value after confirming that the check has passed, a chain check of vehicle diagnosis is implemented to prevent illegal devices from sending diagnostic requests to the vehicle during formal device diagnosis. When the formal diagnostic device sends each frame of diagnostic message, it will generate the check byte of each frame of the message, and will also participate in the calculation of the check byte of the message sent in the previous frame. After receiving it, the ECU will recalculate the check byte. If it is consistent, it means that the diagnostic request is legal, otherwise it will not be processed. This is equivalent to binding the check of each frame of the diagnostic message with the previous frame to form a chain, preventing third-party non-diagnostic devices from sending diagnostic requests to the vehicle during the diagnosis period, and protecting the security of vehicle information data.
[0092] In this embodiment, the diagnostic verification algorithm includes a first verification value calculation algorithm and a second verification value calculation algorithm. Based on the preset diagnostic verification algorithm, the vehicle electronic control unit performs verification according to the diagnostic request and the preset vehicle verification value to obtain a diagnostic verification result, thereby preventing illegal devices from sending diagnostic requests to the vehicle during formal equipment diagnosis, ensuring the integrity and accuracy of the diagnostic message, and by performing multi-level verification of the message byte data, it can be verified whether there are errors or tampering in the message during transmission, and if the verification passes, the reliability of the message is confirmed so that subsequent diagnostic and processing operations can be performed accurately.
[0093] In addition, the present application embodiment provides a vehicle diagnosis method, please refer to Figure 3 , which is a flow chart of the third embodiment of the vehicle diagnostic method of the present application.
[0094] In this embodiment, the vehicle diagnosis method is applied to a diagnostic device, including steps S50 to S90:
[0095] Step S50, generating a diagnostic message and an initial verification value in response to the vehicle diagnostic instruction, and sending the initial verification value to the vehicle electronic control unit, so that the vehicle electronic control unit uses the initial verification value as a vehicle verification value for diagnostic verification;
[0096] Step S60, obtaining a diagnosis request based on the diagnosis message and the initial verification value based on a preset diagnosis verification algorithm;
[0097] Step S70, sending the diagnosis request to the vehicle electronic control unit;
[0098] Step S80, receiving vehicle fault data sent by the vehicle electronic control unit;
[0099] Step S90: diagnose the vehicle according to the vehicle fault data and generate a vehicle diagnosis result.
[0100] When the diagnostic device receives a vehicle diagnostic instruction from an operator or a system, the diagnostic device generates a diagnostic message containing diagnostic information according to the received diagnostic instruction, and calculates and generates an initial check value, which can be based on a specific algorithm, such as CRC (cyclic redundancy check) or other checksum algorithms, and sends the calculated initial check value to the vehicle electronic control unit. The purpose of this verification value is to allow the vehicle electronic control unit to use the initial verification value as the vehicle verification value for diagnostic verification, and then based on the preset diagnostic verification algorithm, obtain a diagnostic request according to the diagnostic message and the initial verification value, and then send the diagnostic request to the vehicle electronic control unit, and then receive the vehicle fault data sent by the vehicle electronic control unit. These data may include fault codes, sensor data, system status, etc. The diagnostic equipment determines possible problems and their severity by analyzing these data. Finally, the diagnostic equipment will perform a detailed analysis of the received vehicle fault data. Based on the analyzed fault data, the diagnostic equipment will try to identify and locate specific problems or faults that may occur in the vehicle, which may involve different vehicle systems, such as the engine, transmission, braking system, etc. Based on the data and analysis results obtained during the diagnostic process, the diagnostic equipment generates a vehicle diagnostic result. This vehicle diagnostic result usually includes the detected fault, possible causes, recommended repair measures, and required repair parts or work.
[0101] In a feasible implementation, step S60 may include steps S601 to S603:
[0102] Step S601, using the initial verification value as a device verification value;
[0103] Step S602, based on the diagnostic verification algorithm, a verification value is calculated according to the diagnostic message and the device verification value to obtain a first byte verification value;
[0104] Step S603: Generate the diagnosis request according to the diagnosis message and the first byte check value.
[0105] In addition, after step S80, step S801 may be further included:
[0106] Step S801: Use the first byte check value as the device check value.
[0107] The diagnostic device uses the initial check value as the device check value, and then calculates the check value based on the diagnostic message and the device check value based on the diagnostic check algorithm to obtain the first byte check value, and then integrates the diagnostic message and the first byte check value into a complete diagnostic request according to the specific communication protocol or the set data format. This request may include information such as the message header, data content, and a check code so that the vehicle electronic control unit can correctly process and respond. After receiving the vehicle fault data sent by the vehicle electronic control unit, that is, after the vehicle electronic control unit confirms that the check is correct, the first byte check value is used as the device check value and waits for the next vehicle diagnostic check.
[0108] In this implementation, by using the received initial check value as the device check value and using the first byte check value as the device check value after receiving the vehicle fault data, the chain check of vehicle diagnosis is realized to prevent illegal devices from sending diagnostic requests to the vehicle during formal device diagnosis. When the formal diagnostic device sends each frame of diagnostic message, it will generate the check byte of each frame message, and will also participate in the calculation of the check byte of the message sent in the previous frame. After receiving it, the ECU will recalculate the check byte. If it is consistent, it means that the diagnostic request is legal, otherwise it will not be processed. This is equivalent to binding the check of each frame of the diagnostic message with the previous frame to form a chain, preventing third-party non-diagnostic devices from sending diagnostic requests to the vehicle during the diagnosis period, and protecting the security of vehicle information data.
[0109] In another feasible implementation, in response to the vehicle diagnostic instruction in step S50, generating a diagnostic message and an initial check value may include steps S501 to S503:
[0110] Step S501, receiving diagnostic function data to be executed in response to the vehicle diagnostic instruction;
[0111] Step S502, generating the diagnostic message according to the diagnostic function data to be executed;
[0112] Step S503: Generate the initial check value based on a preset random number generation algorithm.
[0113] The diagnostic device responds to the vehicle diagnostic instruction and receives the diagnostic function data to be executed. These functions may involve detecting the status of the vehicle system, reading sensor data, obtaining fault codes, etc. Then, according to the specific requirements of the diagnostic function data to be executed, the device encodes these data into messages that comply with a specific protocol or format to obtain a diagnostic message, which may include the sorting of data fields, the big-endian and small-endian byte order, the conversion of data types, etc., wherein the diagnostic message must comply with the predefined communication protocol standards to ensure compatibility with the vehicle electronic control unit. These protocols may include ISO 14229 (UDS), ISO 15765 (CAN), SAE J1939, etc., depending on the vehicle's communication interface and standards, the diagnostic message may need to contain control information, such as the identification code of the diagnostic service, data request or response flag, etc., to ensure that the vehicle control unit can correctly understand and process these messages, and the diagnostic message must ensure the integrity and security of the data, which may include adding a checksum or CRC (cyclic redundancy check) for subsequent data verification, as well as considering the security requirements during data transmission. Different diagnostic functions may require different message structures and contents. For example, diagnostic services that read fault codes and real-time data may require different message formats and data processing methods. Finally, based on the preset random number generation algorithm, an initial check value is generated.
[0114] In this embodiment, the diagnostic device generates a diagnostic message and an initial verification value in response to a vehicle diagnostic instruction. The initial verification value is used to ensure the data integrity and correctness of the diagnostic message. The selection of a random number generation algorithm for generating the initial verification value generally takes into account security and unpredictability to prevent malicious parties from attempting to forge or tamper with the diagnostic data. The diagnostic message and the initial verification value jointly ensure accurate transmission and verification of data during the diagnostic process, providing a basis for subsequent diagnostic operations.
[0115] For example, in another implementation, the process of interactive verification between the diagnostic device and the vehicle electronic control unit is as follows:
[0116] 1. When the diagnostic device needs to diagnose the vehicle, since the check value of each frame message needs to be associated with the check value of the previous frame, and there is no frame before the first frame of the diagnostic message, an initial check value V needs to be generated before sending the first frame of the diagnostic message, which can be randomly generated.
[0117] 2. After the initial verification value V is generated, it is first sent to the vehicle for subsequent verification. The vehicle needs to save the V value for verifying the first frame of the diagnostic message.
[0118] 3. When sending the first frame of diagnostic message, first calculate the check value of each byte in the message according to the agreed method. Common check methods include cyclic redundancy accumulation, cumulative XOR check of each byte, etc., to generate the byte check value C1.
[0119] 4. Then the C1 value and the initial check value V need to be calculated to generate the final frame check value. The calculation method can be customized as long as the diagnostic device and the vehicle use the same calculation method. The calculation method can be a combination of addition / subtraction / multiplication / division / XOR / AND operations to generate the frame check value C2, and fill C2 after the diagnostic message to obtain the diagnostic request and send it to the vehicle.
[0120] 5. After receiving the diagnostic request, the vehicle will calculate the byte check value E1 of the diagnostic message in the same agreed method, and then calculate E2 by combining E1 with the initial check value V. If E2 is inconsistent with C2, an error is returned and the diagnostic message cannot be executed; if they are consistent, the diagnostic message is executed and the vehicle fault data is replied, and the C2 value is saved for the next frame check calculation.
[0121] 6. Starting from the second frame of the diagnostic message, after calculating the byte check value C1 of the message, it is no longer calculated with the initial check value V, but is calculated with C2 of the previous frame. The calculation method is the same. The C2 value of this frame is calculated and filled in the back of this frame message to generate a diagnostic request and send it to the vehicle.
[0122] 7. After the vehicle receives the diagnostic request, it performs calculations in the same way, but no longer calculates with the initial verification value V, but calculates with the verification value C2 of the previous frame saved to compare whether they are consistent.
[0123] In this implementation, the check value of each frame of the diagnostic message is associated with the previous frame, which can prevent third-party illegal devices from sending diagnostic requests to the vehicle to perform diagnostic functions during the diagnosis period.
[0124] In this embodiment, the diagnostic device generates a diagnostic request including a first byte value and a diagnostic message, and receives the vehicle fault data for vehicle diagnosis after the vehicle electronic control unit confirms that the verification has passed, and finally obtains the vehicle diagnosis result. The vehicle electronic control unit verifies according to the diagnostic request and the preset vehicle verification value, and when the verification passes, the diagnostic device is allowed to perform vehicle diagnosis, thereby preventing third-party non-diagnostic devices from sending diagnostic requests to the vehicle during the diagnosis period, solving the problem of poor security of vehicle diagnosis in the prior art and protecting the security of vehicle information data.
[0125] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the vehicle diagnostic method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0126] This application also provides a vehicle diagnostic device, please refer to Figure 4 , the device is applied to a vehicle electronic control unit, and the vehicle diagnostic device comprises:
[0127] The receiving module 10 is used to receive a diagnostic request sent by a diagnostic device, wherein the diagnostic request includes a first byte check value and a diagnostic message;
[0128] The verification module 20 is used to perform verification according to the diagnostic request and the preset vehicle verification value based on a preset diagnostic verification algorithm to obtain a diagnostic verification result;
[0129] The sending module 30 is used to obtain vehicle fault data according to the diagnostic message when the diagnostic verification result is verification passed, and send the vehicle fault data to the diagnostic device so that the diagnostic device can diagnose the vehicle.
[0130] Optionally, the diagnostic verification algorithm includes a first verification value calculation algorithm and a second verification value calculation algorithm, and the verification module 20 is further used to:
[0131] Performing byte analysis on the diagnostic message to obtain message byte data;
[0132] Based on the first check value calculation algorithm, calculate according to the message byte data to obtain a second byte check value;
[0133] Based on the second check value calculation algorithm, calculate according to the second byte check value and the vehicle check value to obtain a third byte check value;
[0134] Determine whether the first byte check value and the third byte check value are consistent, and obtain the diagnostic check result, wherein when the first byte check value and the third byte check value are consistent, the diagnostic check result is check passed.
[0135] Optionally, the sending module 30 is further used for:
[0136] Parsing the diagnostic message to obtain the abnormal component name and vehicle fault code data;
[0137] Reading data of the vehicle component corresponding to the abnormal component name to obtain component abnormal parameter data;
[0138] The vehicle fault code data and component abnormality parameter data are integrated to obtain the vehicle fault data.
[0139] Optionally, before the step of calculating the check value based on the diagnostic request and the vehicle check value based on a preset check value calculation algorithm to obtain the second byte check value, the step further includes:
[0140] receiving an initial check value sent by the diagnostic device;
[0141] Recording the initial verification value as the vehicle verification value;
[0142] When the diagnostic verification result is a verification pass, the step of obtaining vehicle fault data according to the diagnostic message and sending the vehicle fault data to the diagnostic device for the diagnostic device to diagnose the vehicle further includes:
[0143] The first byte check value is recorded as the vehicle check value.
[0144] In addition, to achieve the above-mentioned purpose, the present application also provides a vehicle diagnostic device, which is applied to a diagnostic device, and the device includes:
[0145] A first sending module, for generating a diagnostic message and an initial verification value in response to a vehicle diagnostic instruction, and sending the initial verification value to a vehicle electronic control unit, so that the vehicle electronic control unit uses the initial verification value as a vehicle verification value for diagnostic verification;
[0146] A request obtaining module, configured to obtain a diagnosis request based on a preset diagnosis verification algorithm, according to the diagnosis message and the initial verification value;
[0147] A second sending module, used for sending the diagnostic request to the vehicle electronic control unit;
[0148] A first receiving module, used for receiving vehicle fault data sent by the vehicle electronic control unit;
[0149] The vehicle diagnosis module is used to diagnose the vehicle according to the vehicle fault data and generate a vehicle diagnosis result.
[0150] Optionally, the request obtaining module is further used for:
[0151] Using the initial check value as the device check value;
[0152] Based on the diagnostic verification algorithm, a verification value is calculated according to the diagnostic message and the device verification value to obtain a first byte verification value;
[0153] Generate the diagnostic request according to the diagnostic message and the first byte check value;
[0154] After the step of receiving the vehicle fault data sent by the vehicle electronic control unit, the method further includes:
[0155] The first byte check value is used as the device check value.
[0156] Optionally, the first sending module is further used for:
[0157] In response to the vehicle diagnostic command, receiving diagnostic function data to be performed;
[0158] generating the diagnostic message according to the diagnostic function data to be executed;
[0159] The initial verification value is generated based on a preset random number generation algorithm.
[0160] The vehicle diagnostic device provided by the present application adopts the vehicle diagnostic method in the above embodiment, which can solve the technical problem of poor safety of vehicle diagnosis. Compared with the prior art, the beneficial effects of the vehicle diagnostic device provided by the present application are the same as the beneficial effects of the vehicle diagnostic method provided by the above embodiment, and other technical features in the vehicle diagnostic device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0161] The present application provides a vehicle diagnostic device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the vehicle diagnostic method in the above-mentioned embodiment one.
[0162] Reference below Figure 5 , which shows a schematic diagram of the structure of a vehicle diagnostic device suitable for implementing an embodiment of the present application. The vehicle diagnostic device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The vehicle diagnostic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0163] like Figure 5As shown, the vehicle diagnostic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the vehicle diagnostic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the vehicle diagnostic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a vehicle diagnostic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0164] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0165] The vehicle diagnostic device provided by the present application adopts the vehicle diagnostic method in the above embodiment, which can solve the technical problem of poor safety of vehicle diagnosis. Compared with the prior art, the beneficial effects of the vehicle diagnostic device provided by the present application are the same as the beneficial effects of the vehicle diagnostic method provided by the above embodiment, and the other technical features in the vehicle diagnostic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0166] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0167] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0168] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the vehicle diagnostic method in the above-mentioned embodiment.
[0169] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0170] The computer-readable storage medium may be included in the vehicle diagnostic device; or may exist independently without being assembled into the vehicle diagnostic device.
[0171] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the vehicle diagnostic device, the vehicle diagnostic device:
[0172] Receiving a diagnostic request sent by a diagnostic device, wherein the diagnostic request includes a first byte check value and a diagnostic message;
[0173] Based on a preset diagnostic verification algorithm, a verification is performed according to the diagnostic request and a preset vehicle verification value to obtain a diagnostic verification result;
[0174] When the diagnostic verification result is verification passed, vehicle fault data is obtained according to the diagnostic message, and the vehicle fault data is sent to the diagnostic device so that the diagnostic device can diagnose the vehicle.
[0175] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0176] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0177] The modules involved in the embodiments of the present application may be implemented by software or hardware, wherein the name of the module does not limit the unit itself in some cases.
[0178] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned vehicle diagnostic method, and can solve the technical problem of poor safety of vehicle diagnosis. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the vehicle diagnostic method provided by the above-mentioned embodiment, and will not be repeated here.
[0179] The present application also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the vehicle diagnostic method as described above are implemented.
[0180] The computer program product provided by the present application can solve the technical problem of poor safety of vehicle diagnosis. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the vehicle diagnosis method provided by the above embodiment, which will not be repeated here.
[0181] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A vehicle diagnostic method, characterized in that: The method is applied to a vehicle electronic control unit, and the method comprises: Receiving a diagnostic request sent by a diagnostic device, wherein the diagnostic request includes a first byte check value and a diagnostic message; Based on a preset diagnostic verification algorithm, a verification is performed according to the diagnostic request and a preset vehicle verification value to obtain a diagnostic verification result; When the diagnostic verification result is verification passed, vehicle fault data is obtained according to the diagnostic message, and the vehicle fault data is sent to the diagnostic device so that the diagnostic device can diagnose the vehicle.
2. The method according to claim 1, characterized in that The diagnostic verification algorithm includes a first verification value calculation algorithm and a second verification value calculation algorithm. The diagnostic verification algorithm based on the preset is verified according to the diagnostic request and the preset vehicle verification value. The step of obtaining the diagnostic verification result includes: Performing byte analysis on the diagnostic message to obtain message byte data; Based on the first check value calculation algorithm, calculate according to the message byte data to obtain a second byte check value; Based on the second check value calculation algorithm, calculate according to the second byte check value and the vehicle check value to obtain a third byte check value; Determine whether the first byte check value and the third byte check value are consistent, and obtain the diagnostic check result, wherein when the first byte check value and the third byte check value are consistent, the diagnostic check result is check passed.
3. The method according to claim 1, characterized in that The step of obtaining vehicle fault data according to the diagnostic message comprises: Parsing the diagnostic message to obtain the abnormal component name and vehicle fault code data; Reading data of the vehicle component corresponding to the abnormal component name to obtain component abnormal parameter data; The vehicle fault code data and component abnormality parameter data are integrated to obtain the vehicle fault data.
4. The method according to claim 1, characterized in that Before the step of calculating the check value based on the preset check value calculation algorithm according to the diagnosis request and the vehicle check value to obtain the second byte check value, the method further includes: receiving an initial check value sent by the diagnostic device; Recording the initial verification value as the vehicle verification value; When the diagnostic verification result is a verification pass, the step of obtaining vehicle fault data according to the diagnostic message and sending the vehicle fault data to the diagnostic device for the diagnostic device to diagnose the vehicle further includes: The first byte check value is recorded as the vehicle check value.
5. A vehicle diagnostic method, characterized in that: The method is applied to a diagnostic device, and the method comprises: In response to the vehicle diagnostic instruction, a diagnostic message and an initial verification value are generated, and the initial verification value is sent to the vehicle electronic control unit, so that the vehicle electronic control unit uses the initial verification value as a vehicle verification value for diagnostic verification; Based on a preset diagnostic verification algorithm, obtaining a diagnostic request according to the diagnostic message and the initial verification value; sending the diagnostic request to the vehicle electronic control unit; Receiving vehicle fault data sent by the vehicle electronic control unit; The vehicle is diagnosed based on the vehicle fault data to generate a vehicle diagnosis result.
6. The method according to claim 5, characterized in that The step of obtaining the diagnosis request based on the preset diagnosis verification algorithm and the diagnosis message and the initial verification value comprises: Using the initial check value as the device check value; Based on the diagnostic verification algorithm, a verification value is calculated according to the diagnostic message and the device verification value to obtain a first byte verification value; Generate the diagnostic request according to the diagnostic message and the first byte check value; After the step of receiving the vehicle fault data sent by the vehicle electronic control unit, the method further includes: The first byte check value is used as the device check value.
7. The method according to claim 5, characterized in that The step of generating a diagnostic message and an initial check value in response to the vehicle diagnostic instruction comprises: In response to the vehicle diagnostic command, receiving diagnostic function data to be performed; generating the diagnostic message according to the diagnostic function data to be executed; The initial verification value is generated based on a preset random number generation algorithm.
8. A vehicle diagnostic device, characterized in that: The device comprises: A receiving module, used for receiving a diagnostic request sent by a diagnostic device, wherein the diagnostic request includes a first byte check value and a diagnostic message; A verification module, configured to perform verification based on a preset diagnostic verification algorithm according to the diagnostic request and a preset vehicle verification value to obtain a diagnostic verification result; The sending module is used to obtain vehicle fault data according to the diagnostic message when the diagnostic verification result is verification passed, and send the vehicle fault data to the diagnostic device so that the diagnostic device can diagnose the vehicle.
9. A vehicle diagnostic device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the vehicle diagnosis method according to any one of claims 1 to 7.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the vehicle diagnostic method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Diagnosis system and method based on vehicle body controller
CN108334058A
Message matching method and device
CN112491651A
Vehicle diagnosis method and device and storage medium
CN113960978A
Communication control method for diagnostic apparatus and vehicle and control apparatus therefor
CN117938425A
Apparatus for controlling access of vehicle diagnostic device and method thereof
US20230188518A1
