A vehicle fault diagnosis communication method, device, equipment and storage medium

By using command frame communication and encryption algorithms, the problems of slow speed and low security in existing automotive fault diagnosis communication protocols are solved, achieving efficient and secure data transmission and reducing automotive maintenance costs.

CN115695020BActive Publication Date: 2026-02-03SHENZHEN FCAR TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211368381.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-03
Publication Date
2026-02-03
Estimated Expiration
2042-11-03

AI Technical Summary

Technical Problem

Existing automotive fault diagnosis communication protocols have low communication speeds and low security, making them difficult to adapt to the needs of large-capacity diagnostic data transmission and remote cloud diagnosis, resulting in high automotive repair costs.

Method used

The system adopts a command frame communication method, which includes command name bytes, encryption setting code or encryption verification code and command frame verification bytes. The command frames are sent between the host computer and the slave computer. An encryption algorithm is added to ensure communication security, and single-frame transmission is used in data transmission to improve efficiency.

Benefits of technology

It improves data transmission efficiency and reliability, enhances communication security, adapts to the needs of large-capacity data transmission and remote diagnostics, and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695020B_ABST
    Figure CN115695020B_ABST
Patent Text Reader

Abstract

The application discloses a vehicle fault diagnosis communication method, device and equipment and a storage medium. The application controls communication connection between an upper computer and a lower computer, controls data transmission between the upper computer and the lower computer, and controls storage file verification between the upper computer and the lower computer. The control of the communication connection between the upper computer and the lower computer comprises that communication commands between the upper computer and the lower computer are sent according to instruction frames, each instruction frame comprises a command name byte, an encryption setting code or an encryption verification code, a line number byte and an instruction frame verification byte, and the instruction frame is divided into upper computer instruction frame sending and lower computer instruction frame sending. After the control instruction and the data instruction are effectively separated, single frame is used for data transmission, so that the data transmission efficiency and transmission reliability can be improved, and an encryption algorithm is added in the communication connection stage, and the communication security of the cloud diagnosis service is strengthened.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of automobile fault diagnosis, and in particular to a vehicle fault diagnosis communication method, device, equipment and storage medium. BACKGROUND

[0002] With the increase of internal function modules of the automobile, and the control of these function modules by electronic control unit (ECU), the number of ECUs in the automobile is increasing, and the functions are becoming more and more complex. The ECU needs to read correct data to operate normally. In the process of automobile research and development, production and maintenance, due to the complexity of the function, the amount of data transmitted to the internal ECU will increase. The internal ECU of the produced automobile is not the most perfect function, and the running data of the internal ECU of the automobile needs to be updated and upgraded to improve the performance of the vehicle. There are many types of automobiles in the market, and the running data of the ECUs of different types of automobiles are not the same. Each manufacturer has a special diagnostic writing device, which results in a very high cost for automobile repair shops to repair automobiles.

[0003] The automobile electronic control system is becoming more and more complex, and the amount of maintenance data transmitted by the diagnostic instrument is also increasing, which is as high as 10G or more, requiring a more efficient communication protocol between the upper and lower computers for fault diagnosis. The commonly used upper and lower computer communication protocol is difficult to adapt to large-capacity diagnostic data transmission and remote cloud diagnosis functions due to low communication speed and low safety. Therefore, how to reliably and efficiently solve the communication problem between the upper and lower computers for vehicle fault diagnosis has become a problem to be solved by technical personnel in the field. SUMMARY

[0004] Embodiments of the present application provide a vehicle fault diagnosis communication method, device, equipment and storage medium to solve the problems in the prior art.

[0005] To solve the above technical problems, the embodiments of the present application provide a vehicle fault diagnosis communication method, which comprises:

[0006] controlling the communication connection between the upper computer and the lower computer;

[0007] controlling the data transmission between the upper computer and the lower computer;

[0008] controlling the storage file verification between the upper computer and the lower computer;

[0009] The control of the communication connection between the upper computer and the lower computer comprises:

[0010] The communication command for controlling the communication between the upper computer and the lower computer is sent according to the instruction frame, and each instruction frame comprises a command name byte, an encryption setting code or an encryption verification code, or a line number byte and an instruction frame verification byte.

[0011] The instruction frame is divided into host computer instruction frame sending and lower computer instruction frame sending.

[0012] Preferably, the sending step of the host computer instruction frame sending and the lower computer instruction frame sending comprises:

[0013] The host computer is controlled to continuously send K times of upgrade request instructions to the lower computer in a preset interval, and the communication connection state is displayed according to the reply instruction of the lower computer;

[0014] The host computer is controlled to send an encryption algorithm instruction and a two-byte random number encryption setting code to the lower computer;

[0015] The lower computer is controlled to reply with an encrypted reply and a two-byte encrypted check code after receiving, wherein the two-byte encrypted check code is obtained by encryption calculation verification of the encryption setting code or the encrypted check code or a line number byte;

[0016] The host computer is controlled to perform the same encryption calculation verification after receiving the two-byte encrypted check code, and if the encryption calculation verification results are the same, the verification is passed, and a data transmission instruction is sent to the lower computer;

[0017] The host computer is controlled to send a state query instruction to the lower computer, wherein when the automobile is in a running state, the lower computer is in a running mode and cannot be upgraded, and the host computer terminates the communication connection; when the automobile is in a stationary state, the lower computer is in a non-running mode and can be upgraded;

[0018] The host computer is controlled to send the first row of data of the downloaded storage file, and the lower computer is controlled to prepare to receive the first row of data of the storage file downloaded by the host computer.

[0019] Preferably, the control of the data transmission between the host computer and the lower computer comprises:

[0020] The host computer is controlled to send a data frame, and the storage file data is sent in sequence by row;

[0021] After each row of data is sent, the host computer is controlled to send the instruction frame again;

[0022] The lower computer is controlled to receive the data frame and perform verification, and the verification comprises frame verification and row verification, and the row verification data comprises a check bit of the current row of data and continuity between the upper and lower rows.

[0023] Preferably, the control of the storage file verification between the host computer and the lower computer comprises:

[0024] After the storage file is downloaded, the host computer is controlled to send a verification command to notify the slave computer to start the verification.

[0025] If the internal verification of the lower-level machine fails, a verification failure command is sent to the upper-level machine, and the program jumps to the original user program.

[0026] If the lower-level machine passes the internal verification, it copies the temporary storage data to the formal program data. After completion, it sends an upgrade success command, and the program jumps to the new user program.

[0027] Preferably, the sending steps of sending the host computer command frame and sending the slave computer command frame further include:

[0028] If the encryption calculation verification results are different, the verification fails, and the host computer is controlled to send an error command, resulting in a failed handshake verification.

[0029] Preferably, the method further includes:

[0030] The host computer is an Android tablet, a Windows PC, or a server.

[0031] The lower-level machine is a single-chip microcomputer;

[0032] The host computer and the slave computer communicate via Bluetooth, serial port, or 5G.

[0033] Preferably, the host computer instruction frame includes a program upgrade request instruction, an encryption algorithm instruction, an encryption verification pass instruction, a status query instruction, a line transmission end instruction, and an instruction to notify the slave computer to start verifying the storage file.

[0034] To address the aforementioned technical problems, embodiments of the present invention provide a vehicle fault diagnosis communication device, the device comprising:

[0035] The communication connection module is used to control the communication connection between the host computer and the slave computer;

[0036] The data transmission module is used to control the data transmission between the host computer and the slave computer.

[0037] The verification module is used to control the storage file verification between the host computer and the slave computer.

[0038] The communication connection between the host computer and the slave computer includes:

[0039] The communication commands between the host computer and the slave computer are sent in the form of instruction frames. Each instruction frame includes a command name byte, an encryption setting code or encryption verification code or a line number byte and an instruction frame verification byte.

[0040] The instruction frame is divided into host computer instruction frame transmission and slave computer instruction frame transmission.

[0041] To address the aforementioned technical problems, this invention provides a vehicle fault diagnosis communication device, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory, wherein when the computer program instructions are executed by the processor, the method of the first aspect described above is implemented.

[0042] To address the aforementioned technical problems, embodiments of the present invention provide a storage medium storing computer program instructions, which, when executed by a processor, implement the method of the first aspect described above.

[0043] In summary, this invention provides a vehicle fault diagnosis communication method, apparatus, device, and storage medium. This invention controls the communication connection between a host computer and a slave computer; controls data transmission between the host computer and the slave computer; and controls file verification between the host computer and the slave computer. The control of the communication connection between the host computer and the slave computer includes: communication commands between the host computer and the slave computer are sent in instruction frames. Each instruction frame includes a command name byte, an encryption setting code or encryption verification code or line number byte, and an instruction frame verification byte. The instruction frame is divided into host computer instruction frame transmission and slave computer instruction frame transmission. Therefore, this invention effectively separates control commands and data commands, uses single-frame data transmission, thereby improving data transmission efficiency and reliability, and adds an encryption algorithm during the communication connection stage to enhance the communication security of cloud diagnostic services. Attached Figure Description

[0044] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 This is a flowchart of a vehicle fault diagnosis communication method according to an embodiment of the present invention.

[0046] Figure 2 This is a flowchart of the sending steps of sending the host computer instruction frame and the sending of the slave computer instruction frame according to an embodiment of the present invention.

[0047] Figure 3 This is a flowchart illustrating the process of controlling data transmission between the host computer and the slave computer according to an embodiment of the present invention.

[0048] Figure 4 This is a flowchart illustrating the process of controlling data transmission between the host computer and the slave computer according to an embodiment of the present invention.

[0049] Figure 5 This is a schematic diagram illustrating the principle of a vehicle fault diagnosis communication method according to an embodiment of the present invention.

[0050] Figure 6 This is a schematic diagram of the structure of the vehicle fault diagnosis communication device according to an embodiment of the present invention.

[0051] Figure 7 This is a schematic diagram of the structure of a vehicle fault diagnosis communication device according to an embodiment of the present invention. Detailed Implementation

[0052] The features and exemplary embodiments of various aspects of the present invention will now be described in detail. To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the invention.

[0053] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0054] Please see Figure 1 , Figure 1 The present application provides a vehicle fault diagnosis communication method, which includes the following steps:

[0055] S1. Controls the communication connection between the host computer and the slave computer;

[0056] The communication connection between the host computer and the slave computer includes:

[0057] S11. The communication commands controlling the communication between the host computer and the slave computer are sent in instruction frames. Each instruction frame includes a command name byte, an encryption setting code or encryption verification code or a line number byte and an instruction frame verification byte.

[0058] S12. Command frames are divided into upper-level computer command frame transmission and lower-level computer command frame transmission.

[0059] Specifically, in this embodiment, communication commands are sent according to instruction frames. Each instruction frame has 4 bytes: Byte0, Byte1, Byte2, and Byte3. Byte0 is the command name, Byte1 and Byte2 are the encryption setting code, encryption verification code, or line number, and Byte3 is the instruction frame verification byte. Instruction frames are divided into upper-level computer instruction frame transmission and lower-level computer instruction frame transmission.

[0060] S2. Controls data transmission between the host computer and the slave computer;

[0061] Specifically, data transmission involves the host computer downloading data from the storage file to the slave computer. The data is downloaded in frames, with each frame consisting of 8 bytes. The first byte of the frame, Byte0, contains data frame control parameters, such as 0xDD, which indicates that this frame is for data transmission. The last byte of the frame, Byte7, is the XOR check byte, and the middle 6 bytes contain the storage file data.

[0062] S3. Controls the verification of stored files between the host computer and the slave computer;

[0063] In one preferred embodiment, the host computer instruction frame includes a program upgrade request instruction, an encryption algorithm instruction, an encryption verification pass instruction, a status query instruction, a line transmission end instruction, and an instruction to notify the slave computer to start verifying the storage file.

[0064] Specifically, in this embodiment, the host computer instruction frame transmission includes 6 types of host computer instruction frames, each represented by a different value.

[0065] The meaning of Byte0:

[0066] 1) 0x0F indicates a program upgrade request.

[0067] 2) 0x2F indicates an encryption algorithm instruction.

[0068] 3) 0x3F indicates that the encryption verification passed.

[0069] 4) 0x1F indicates a status query instruction.

[0070] 5) 0x0E indicates the end of line transmission.

[0071] 6) If the value is 0x1E, notify the lower-level machine to start verifying the stored file.

[0072] The meanings of Byte1 and Byte2 are as follows:

[0073] 1): When Byte0 == 0x0E, Byte1 and Byte2 represent the row number N. Byte1 and Byte2 represent the row number that has just been sent; N = byte1 * 256 + Byte2, where Byte1 is the high byte of the row number and Byte2 is the low byte of the row number.

[0074] 2) When Byte0 == 0x2F, Byte1 and Byte2 represent the encryption setting code, which is randomly generated.

[0075] 3) When Byte0 is any other value, Byte1 and Byte2 will be 0.

[0076] Byte3 indicates the frame checksum.

[0077] Specifically, in this embodiment, the lower-level machine instruction frame transmission includes nine types of lower-level machine instruction frames, each represented by a different value.

[0078] The meaning of Byte0:

[0079] 1) 0x4F indicates that the upgrade is possible and that the communication connection is successful.

[0080] 2) 0x6F indicates an encrypted reply.

[0081] 3) 0x7F indicates that the encryption verification passed.

[0082] 4) 0xFF indicates that the encryption verification failed; or the lower-level machine is in operation mode and cannot be upgraded.

[0083] 5) 0x5F indicates that the lower-level machine is in non-operating mode and can be upgraded.

[0084] 6) 0x4E indicates that the host computer is notified to send line data.

[0085] 7) A value of 0xCE indicates that the row data verification failed, and the host computer is notified to stop the upgrade.

[0086] 8) The internal file verification of the 0x5E lower-level machine failed, and the upgrade failed.

[0087] 9) 0x6E indicates a successful upgrade.

[0088] The meanings of Byte1 and Byte2 are as follows:

[0089] 1): When Byte0 == 0x4E, byte1 and byte2 represent the row number requested for the next transmission: N = byte1 * 256 + byte2.

[0090] 2) When Byte0 == 0x6F, Byte1 and Byte2 represent the encryption verification code.

[0091] 3) When Byte0 is any other value, Byte1 and Byte2 will be 0.

[0092] Byte3 indicates the frame checksum.

[0093] In summary, this application provides a communication method for vehicle fault diagnosis. This method controls the communication connection between a host computer and a slave computer; controls data transmission between the host computer and the slave computer; and controls file verification between the host computer and the slave computer. Controlling the communication connection between the host computer and the slave computer includes: sending communication commands between the host computer and the slave computer in instruction frames. Each instruction frame includes a command name byte, an encryption setting code or encryption verification code or line number byte, and an instruction frame verification byte. Instruction frames are divided into host computer instruction frame transmission and slave computer instruction frame transmission. Therefore, this invention effectively separates control commands and data commands, uses single-frame data transmission, thereby improving data transmission efficiency and reliability. Furthermore, the addition of an encryption algorithm during the communication connection stage enhances the communication security of the cloud diagnostic service.

[0094] Based on the above embodiments:

[0095] Please refer to Figure 2 , Figure 2 This application provides a flowchart of the transmission steps for sending host computer command frames and sending slave computer command frames.

[0096] In a preferred embodiment, the steps of sending the host computer command frame and the slave computer command frame include:

[0097] S121. Control the host computer to continuously send K upgrade request commands to the slave computer within a preset interval, and display the communication connection status according to the reply command of the slave computer.

[0098] Specifically, the host computer sends K consecutive upgrade request commands (0x0F) to the slave computer, with a 10ms interval between each request command. The slave computer replies with 0x4F, displays "Communication connection successful," and proceeds to the next step, S122. If the host computer has not received a reply from the slave computer after sending the K request commands, it displays "Communication connection unsuccessful."

[0099] S122, Control the host computer to send the encryption algorithm command and a two-byte random number encryption setting code to the slave computer;

[0100] Specifically, the host computer sends the encryption algorithm instruction 0x2F and two random numbers Byte1 and Byte2 as encryption setting codes to the slave computer, such as: 0x2F 0x12 (Byte1) 0x34 (Byte2).

[0101] S123. After receiving the data, the lower-level control unit will send an encrypted reply and reply with a two-byte encryption verification code. The two-byte encryption verification code is obtained by encryption calculation and verification of the encryption setting code, encryption verification code, or row number byte.

[0102] Specifically, after receiving the data, the lower-level device replies with 0x6F and two encrypted checksums, ByteA and ByteB. The values ​​of ByteA and ByteB are calculated by encrypting Byte1 and Byte2.

[0103] When the hexadecimal value of Byte1 is less than the hexadecimal number 0x80, ByteA shifts Byte1 left by 1 bit (filling the highest bit with 0 and the lowest bit with excess) and adds the hexadecimal number 0x01; otherwise, ByteA shifts Byte1 right by 1 bit (filling the lowest bit with 0 and the highest bit with excess) and adds the hexadecimal number 0x80.

[0104] When the hexadecimal value of Byte2 is less than the hexadecimal number 0x80, ByteB shifts Byte2 left by 1 bit (filling the highest bit with 0 and the lowest bit with excess) and adds the hexadecimal number 0x01; otherwise, ByteB shifts Byte2 right by 1 bit (filling the lowest bit with 0 and the highest bit with excess) and adds the hexadecimal number 0x80.

[0105] S124. After receiving the two bytes of encryption verification code, the host computer performs the same encryption calculation verification. If the encryption calculation verification results are the same, the verification is successful, and a data transmission instruction is sent to the slave computer.

[0106] Specifically, after receiving the ByteA and ByteB values, the host computer performs the same encryption calculation verification as in step S122. If they are the same, the verification passes, and a data transmission command 0x3F is sent to the slave computer. The slave computer replies with a 0x7F response, and proceeds to the next step S125. If they are different, the verification fails, an error command 0xFF is sent, and the handshake verification fails.

[0107] S125. Control the host computer to send a status query command 0x1F to the slave computer. When the car is in motion, the slave computer is in running mode and cannot be upgraded, and the host computer terminates the communication connection. When the car is stationary, the slave computer is in non-running mode and can be upgraded.

[0108] S126. Control the host computer to send the first line of data of the downloaded storage file and control the slave computer to prepare to receive the first line of data of the downloaded storage file from the host computer.

[0109] Specifically, the host computer sends a status query command 0x1F to the slave computer. When the car is moving (speed > 0), the slave computer is in running mode and cannot upgrade, so the slave computer replies with 0xFF, and the host computer terminates the communication connection. When the car is stationary (speed = 0), the slave computer is in non-running mode and can upgrade, so the slave computer replies with 0x5F. Upon receiving 0x5F, the host computer prepares to send the first line of data of the downloaded storage file, and the slave computer prepares to receive the first line of data of the downloaded storage file from the host computer.

[0110] Please refer to Figure 3 , Figure 3 This application provides a flowchart for controlling data transmission between a host computer and a slave computer.

[0111] In one preferred embodiment, controlling data transmission between the host computer and the slave computer includes:

[0112] S21. Control the host computer to send data frames, and send the stored file data line by line in sequence;

[0113] Specifically, the host computer sends data frames, sequentially sending the stored file data line by line. Each line of data is sent continuously as a frame, and each frame contains 8 bytes. The first byte, Byte0, is 0xDD and contains control parameters. The last byte, Byte7, is the frame checksum (verified using XOR). The middle 6 bytes contain the stored file data. The transmission interval between each frame is >3ms. When the transmitted line of data is <6 bytes, it is padded with 0s to reach 6 bytes, thus achieving a full frame.

[0114] S22. After each line of data is sent, the host computer will send another instruction frame.

[0115] Specifically, after each line of data is sent, the host computer sends a command frame: 0x0E 0xn1 0xn2, where 0xn1 and 0xn2 are the line number N. The calculation method for N is N = 0xn1 * 256 + 0xn2, and the line number starts from 1.

[0116] S23. Control the lower-level machine to receive data frames and perform verification. The verification includes frame verification and line verification. The line verification data includes the check bit of the current line data and the continuity between the uplink and downlink.

[0117] Specifically, the lower-level machine receives and verifies the data. It stores the file data in a temporary space and performs verification, including frame verification and line verification. The line verification data includes the check bit of the current line and the continuity between the preceding and following lines.

[0118] Specifically, 0xN1 and 0xN2 represent the row number N of the next line, where N equals the row number of the previous line plus 1. The host computer sends the Nth line of data based on the received row number (N = 0xN1 * 256 + 0xN2).

[0119] If the lower-level machine fails a single verification, or fails to receive data from the upper-level machine for more than 200ms, it sends the command 0x4E 0xN1 0xN2 to notify the upper-level machine to resend the data for that line. Here, 0xN1 and 0xN2 represent the line number N of the previous line, where N = 0xN1 * 256 + 0xN2. If five consecutive single-line data verifications fail, the lower-level machine sends the command frame 0xCE to notify the upper-level machine to stop the upgrade. This process is repeated until all stored files have been sent.

[0120] Specifically, in this embodiment, the last byte frame checksum of the instruction frame and data frame used in the communication between the host computer and the slave computer is determined using an XOR checksum, and the calculation methods are as follows:

[0121] Instruction frame: Byte3 = byte0^byte1^byte2^byte3; The logical operator "^" performs bitwise XOR verification.

[0122] Data frame: Byte7 = byte0^byte1^byte2^byte3^byte4^byte5^byte6; The logical operator "^" performs bitwise XOR verification.

[0123] Please refer to Figure 4 , Figure 4 This application provides a flowchart for controlling data transmission between a host computer and a slave computer.

[0124] As a preferred embodiment, controlling the storage file verification between the host computer and the slave computer includes:

[0125] S31. After the storage file is downloaded, control the host computer to send a verification command to notify the slave computer to start the verification.

[0126] Specifically, after the storage file is downloaded, the host computer sends 0x1 E to notify the slave computer to start verification.

[0127] S32. If the internal verification of the lower-level machine fails, a verification failure command is sent to the upper-level machine, and the program jumps to the original user program.

[0128] Specifically, if the lower-level machine fails the internal verification, it sends 0x5E to the upper-level machine, indicating that the upgrade has failed and the program jumps back to the original user program.

[0129] S33. If the internal verification of the lower-level machine passes, the temporary storage data is copied to the formal program data. After completion, an upgrade success command is sent, and the program jumps to the new user program.

[0130] Specifically, after the lower-level machine passes the internal verification, it copies the temporary storage data to the formal program data. Once completed, it sends 0x6E to indicate that the upgrade is successful, and the program jumps to the new user program.

[0131] In a preferred embodiment, the steps of sending the host computer command frame and the slave computer command frame further include:

[0132] If the encryption calculation verification results are different, the verification fails, the host computer sends an error command, and the handshake verification fails.

[0133] Please refer to Figure 5 , Figure 5 This is a schematic diagram of a vehicle fault diagnosis communication method provided in this application.

[0134] In a preferred embodiment, the method further includes:

[0135] The host computer can be an Android tablet, a Windows PC, or a server.

[0136] The lower-level machine is a single-chip microcomputer;

[0137] The host computer and the slave computer communicate via Bluetooth, serial port or 5G.

[0138] Specifically, in this embodiment, the lower-level machine has a running mode and a non-running mode. The upper-level machine does not distinguish between modes.

[0139] Specifically, the line data format of the storage file is as follows: Each line in the storage format file is called a record, and each record consists of five parts: record type, record length, storage address, data, and checksum.

[0140] Each record type occupies 1 byte and is used to describe the type of record. There are 8 record types in total, F0-F7:

[0141] F0: The first record in the storage format file, representing the filename (including path). The storage address portion is unused and is set to 0000. This record indicates the start of a record and does not need to be downloaded to the lower-level machine.

[0142] F1: Record with an address of 2 bytes (4 characters).

[0143] F2: Record with a 3-byte address.

[0144] F3: Record with a 4-byte address.

[0145] F4: Marks the number of records 01, 02, and 03 in this file (this record is not required for a storage file).

[0146] F5: The address is 4 bytes, indicating the start address of the program. The data part is not used. This line indicates the end of the program and there is no need to download it to the lower-level machine.

[0147] F6: The address is 3 bytes, indicating the start address of the program. The data part is not used. This line indicates the end of the program and there is no need to download it to the lower-level machine.

[0148] F7: The address is 2 bytes, indicating the start address of the program. The data part is not used. This line indicates the end of the program and there is no need to download it to the lower-level machine.

[0149] The record length occupies 1 byte and is displayed as the number of bytes remaining in the record. That is:

[0150] Record length = number of bytes of storage address + number of bytes of data + number of bytes of checksum;

[0151] The storage address occupies 2, 3, or 4 bytes (depending on the record type) and is used to indicate the starting address where the data should be loaded.

[0152] The data occupies 0-32 bytes, representing the data that needs to be downloaded to the lower-level device.

[0153] The checksum occupies 1 byte. The checksum data is calculated as follows:

[0154] Checksum = 0Xff – (record length + storage address + data)

[0155] This checksum is not a character checksum, but a checksum of the actual binary number.

[0156] Each record ends with an EOL (End Of Line) marker.

[0157] Specifically, for example:

[0158] F01F0000443A5C50726F6A6563745F335C62696E5C50726F6A6563742E616273 71

[0159] 92

[0160] F2 18 FE8020 F2FEC013EC31270BED31180A30700434F920F10A 0B

[0161] F9 030000FC

[0162] The first line: F0 indicates the start of the F19 file format; 1F is the number of remaining bytes; 0000 is unused; 443A5C50726F6A6563745F335C62696E5C50726F6A6563742E616273 is the ASCII code for D: / Project_3 / bin / Project_3.abs; 71 is the checksum.

[0163] The second line: F1 indicates that the storage address length of this record is 2 bytes; 23 (note that this is hexadecimal) is the number of remaining bytes; C000 indicates the starting address; and 92 indicates the checksum. That is, this line indicates that CF2100C6055B134A800BFE4A8000FE0000C015C03100000000000000000000000 will be downloaded sequentially to a continuous address range starting from address C000.

[0164] The third line: F2 indicates that the storage address length of this record is 3 bytes, 18 (hexadecimal number) indicates the number of remaining bytes, FE8020 indicates the starting address, and 0B is the checksum.

[0165] Checksum calculation: Taking record F2 as an example,

[0166] Checksum = 0xFF – (0xFE + 0x80 + 0x20 + 0Xf2 + … + 0x0A).

[0167] Please see Figure 6 This invention provides a vehicle fault diagnosis communication device, the device comprising:

[0168] Communication connection module 1 is used to control the communication connection between the host computer and the slave computer;

[0169] Data transmission module 2 is used to control data transmission between the host computer and the slave computer;

[0170] Verification module 3 is used to control the verification of stored files between the host computer and the slave computer;

[0171] The communication connection between the host computer and the slave computer includes:

[0172] The communication commands between the host computer and the slave computer are sent in order of instruction frames. Each instruction frame includes a command name byte, an encryption setting code or encryption verification code or a line number byte and an instruction frame verification byte.

[0173] Command frames are divided into upper-level computer command frame transmission and lower-level computer command frame transmission.

[0174] In addition, combinedFigure 1 The vehicle fault diagnosis communication method described in this embodiment of the invention can be implemented by a vehicle fault diagnosis communication device. Figure 7 A schematic diagram of the hardware structure of the vehicle fault diagnosis communication device provided in an embodiment of the present invention is shown.

[0175] The vehicle fault diagnosis communication device may include a processor 401 and a memory 402 storing computer program instructions.

[0176] Specifically, the processor 401 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.

[0177] Memory 402 may include mass storage for data or instructions. For example, and not limitingly, memory 402 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 402 may include removable or non-removable (or fixed) media. Where appropriate, memory 402 may be internal or external to a data processing device. In a particular embodiment, memory 402 is a non-volatile solid-state memory. In a particular embodiment, memory 402 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.

[0178] The processor 401 reads and executes computer program instructions stored in the memory 402 to implement any of the vehicle fault diagnosis communication methods in the above embodiments.

[0179] In one example, the vehicle fault diagnosis communication device may further include a communication interface 403 and a bus 410. Wherein, as Figure 7 As shown, the processor 401, memory 402, and communication interface 403 are connected through bus 410 and complete communication with each other.

[0180] The communication interface 403 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of the present invention.

[0181] Bus 410 includes hardware, software, or both, that couples components of an automotive diagnostic communication device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 410 may include one or more buses. While specific buses are described and illustrated in embodiments of the invention, the invention contemplates any suitable bus or interconnect.

[0182] Furthermore, in conjunction with the vehicle fault diagnosis communication method described in the above embodiments, this invention can be implemented using a computer-readable storage medium. This computer-readable storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the vehicle fault diagnosis communication methods described in the above embodiments.

[0183] It should also be noted that the exemplary embodiments mentioned in this invention describe methods or systems based on a series of steps or apparatus. However, this invention is not limited to the order of the steps described above; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0184] In summary, the upper / lower-level communication protocol of this invention is designed for automotive fault diagnosis. The protocol format is simple and efficient, effectively separating control commands and data commands and using single-frame data transmission, thereby improving data transmission efficiency and reliability. Furthermore, an encryption algorithm is added during the communication connection phase to enhance the communication security of the cloud diagnostic service. This invention's communication protocol boasts high reliability, high performance, and outstanding real-time capabilities, effectively meeting the needs of automobiles for large-capacity data exchange with fewer wiring harnesses. This invention uses C language for programming, calling data files to transmit data from a single diagnostic device to various ECUs of different vehicle models, exhibiting good compatibility, applicability, and stability.

[0185] The above description is merely a specific embodiment of the present invention. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the protection scope of the present invention.

Claims

1. A vehicle fault diagnosis communication method, characterized in that, The method includes: Controls the communication connection between the host computer and the slave computer; Control the data transmission between the host computer and the slave computer; Control the storage file verification between the host computer and the slave computer; The communication connection between the host computer and the slave computer includes: The communication commands controlling the communication between the host computer and the slave computer are sent in order of instruction frames. Each instruction frame includes a command name byte, an encryption setting code or encryption verification code or a line number byte and an instruction frame verification byte. The instruction frame is divided into host computer instruction frame transmission and slave computer instruction frame transmission, including; The host computer is controlled to continuously send K upgrade request commands to the slave computer within a preset interval, and the communication connection status is displayed according to the reply command of the slave computer. The host computer is controlled to send an encryption algorithm instruction and a two-byte random number encryption setting code to the slave computer. After receiving the data, the lower-level machine sends an encrypted reply and sends back a two-byte encryption verification code. The two-byte encryption verification code is obtained by encryption calculation and verification of the encryption setting code, encryption verification code, or row number byte. After receiving two bytes of encryption verification code, the host computer performs the same encryption calculation verification. If the encryption calculation verification results are the same, the verification is successful, and a data transmission instruction is sent to the slave computer. The host computer sends a status query command to the slave computer. When the car is in motion, the slave computer is in running mode and cannot be upgraded, and the host computer terminates the communication connection. When the car is stationary, the slave computer is in non-running mode and can be upgraded. The host computer is controlled to send the first line of data of the downloaded storage file, and the slave computer is controlled to prepare to receive the first line of data of the downloaded storage file from the host computer.

2. The vehicle fault diagnosis communication method according to claim 1, characterized in that, The control of data transmission between the host computer and the slave computer includes: The host computer is controlled to send data frames, and the stored file data is sent line by line in sequence. After each line of data is sent, the host computer is controlled to send the instruction frame again. The lower-level machine is controlled to receive the data frame and perform verification. The verification includes frame verification and line verification. The line verification data includes the check bit of the current line data and the continuity between the upstream and downstream lines.

3. The vehicle fault diagnosis communication method according to claim 1, characterized in that, The process of controlling the storage file verification between the host computer and the slave computer includes: After the storage file is downloaded, the host computer is controlled to send a verification command to notify the slave computer to start the verification. If the internal verification of the lower-level machine fails, a verification failure command is sent to the upper-level machine, and the program jumps to the original user program. If the lower-level machine passes the internal verification, it copies the temporary storage data to the formal program data. After completion, it sends an upgrade success command, and the program jumps to the new user program.

4. The vehicle fault diagnosis communication method according to claim 3, characterized in that, The sending steps of the host computer command frame and the slave computer command frame also include: If the encryption calculation verification results are different, the verification fails, and the host computer is controlled to send an error command, resulting in a failed handshake verification.

5. The vehicle fault diagnosis communication method according to claim 4, characterized in that, The method further includes: The host computer is an Android tablet, a Windows PC, or a server. The lower-level machine is a single-chip microcomputer; The host computer and the slave computer communicate via Bluetooth, serial port, or 5G.

6. The vehicle fault diagnosis communication method according to claim 1, characterized in that, The host computer instruction frame includes a program upgrade request instruction, an encryption algorithm instruction, an encryption verification pass instruction, a status query instruction, a line transmission end instruction, and an instruction to notify the slave computer to start verifying the storage file.

7. A vehicle fault diagnosis communication device, used to implement the vehicle fault diagnosis communication method as described in any one of claims 1-6, characterized in that, The device includes: The communication connection module is used to control the communication connection between the host computer and the slave computer; The data transmission module is used to control the data transmission between the host computer and the slave computer. The verification module is used to control the storage file verification between the host computer and the slave computer. The communication connection between the host computer and the slave computer includes: The communication commands between the host computer and the slave computer are sent in the form of instruction frames. Each instruction frame includes a command name byte, an encryption setting code or encryption verification code or a line number byte and an instruction frame verification byte. The instruction frame is divided into host computer instruction frame transmission and slave computer instruction frame transmission.

8. A vehicle fault diagnosis communication device, characterized in that, include: At least one processor, at least one memory, and computer program instructions stored in the memory, which, when executed by the processor, implement the method as described in any one of claims 1-6.

9. A storage medium storing computer program instructions thereon, characterized in that, The method as described in any one of claims 1-6 is implemented when the computer program instructions are executed by the processor.

Citation Information

Patent Citations

  • Frequency converter control system program upgrading method

    CN106227572A

  • Software upgrading system and method of ETC (Electronic Toll Collection) electronic tag and storage medium

    CN114417354A