Diagnostic device, control method, storage medium and program product
By integrating a security module and a communication module into the diagnostic interface chip, the program information of the MCU is verified and the communication module is enabled or disabled, thus solving the vehicle safety problem caused by MCU program tampering and achieving high security for the diagnostic equipment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LAUNCH TECH CO LTD
- Filing Date
- 2025-01-10
- Publication Date
- 2026-05-05
AI Technical Summary
Malicious tampering with the microcontroller unit (MCU) program of existing diagnostic equipment can affect vehicle safety and lead to potential safety hazards.
The diagnostic interface chip integrates a security module and a communication module. The security module is used to verify the target program information of the MCU and allows communication when the verification is successful and prohibits communication when it fails. The communication module can be enabled or disabled by controlling the switch module.
This improves the operational safety of diagnostic equipment, prevents vehicle safety hazards caused by MCU program tampering, and ensures vehicle safety.
Smart Images

Figure CN119882567B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a diagnostic device, control method, storage medium, and program product. Background Technology
[0002] With the continuous development of technology, the use of diagnostic equipment to diagnose vehicles has become widespread. Diagnostic equipment includes microcontroller units (MCUs), which can acquire vehicle operating data and fault information to perform vehicle diagnostics. However, if the program in the MCU is maliciously tampered with, it can affect vehicle safety. Therefore, how to avoid vehicle safety problems caused by diagnostic equipment is a pressing issue that needs to be addressed. Summary of the Invention
[0003] This application provides a diagnostic device, control method, storage medium, and program product that can improve vehicle safety. The technical solution is as follows:
[0004] In a first aspect, a diagnostic device is provided, the diagnostic device comprising: a microcontroller unit (MCU) and a diagnostic interface chip;
[0005] The diagnostic interface chip includes a communication module and a security module. The communication module is used to enable communication between the MCU and the vehicle, and the security module is used to enable or disable the communication module.
[0006] The security module is used to obtain target program information from the MCU, verify the target program information, and run in a first mode if the target program information passes the verification, and run in a second mode if the target program information fails the verification. In the first mode, the MCU is allowed to use the communication module, and in the second mode, the MCU is prohibited from using the communication module.
[0007] In this application, the diagnostic interface chip integrates both a security module and a communication module. The security module can directly enable or disable the communication module within the diagnostic interface chip, without being affected by external commands, thus ensuring high operational security. When the program data in the MCU is tampered with, the security module in the diagnostic interface chip can restrict the use of diagnostic equipment by disabling the MCU's use of the communication module, thereby improving vehicle safety.
[0008] Optionally, the connection interface between the MCU and the security module includes a Joint Test Working Group (JTAG) interface, and the security module is used to obtain the target program information from the MCU through the JTAG interface;
[0009] And / or,
[0010] The connection interface between the MCU and the safety module includes a communication interface. When the diagnostic device is connected to the vehicle, the MCU is used to send control commands to the safety module through the communication interface. The control commands are used to instruct the communication module to be enabled.
[0011] Optionally, the communication module includes a first switch module, a transceiver module, and a second switch module. The first switch module includes n first switches, the transceiver module includes n transceivers, and the second switch module includes n second switches, where n is a positive integer.
[0012] The first terminals of the n first switches are connected to the MCU, the second terminals of the n first switches are connected to the first terminals of the n transceivers, the second terminals of the n transceivers are connected to the first terminals of the n second switches, and the second terminals of the n second switches are used to connect to the vehicle; the control terminals of the n first switches, the control terminals of the n transceivers, and the control terminals of the n second switches are connected to the safety module.
[0013] The safety module is used to control the first switches among the n first switches to be turned on or off, and to control the transceivers among the n transceivers to be powered on or off, and to control the second switches among the n second switches to be turned on or off.
[0014] In a second aspect, a diagnostic device control method is provided, applied to the diagnostic device described in the first aspect above, the method comprising:
[0015] The security module obtains the target program information from the MCU;
[0016] The security module verifies the target program information;
[0017] The security module operates in a first mode if the target program information verification passes, and in a second mode if the target program information verification fails. In the first mode, the MCU is allowed to use the communication module, and in the second mode, the MCU is prohibited from using the communication module.
[0018] In this application, the diagnostic interface chip integrates both a security module and a communication module. The security module can directly enable or disable the communication module within the diagnostic interface chip, without being affected by external commands, thus ensuring high operational security. When the program data in the MCU is tampered with, the security module in the diagnostic interface chip can restrict the use of diagnostic equipment by disabling the MCU's use of the communication module, thereby improving vehicle safety.
[0019] Optionally, the security module verifies the target program information, including:
[0020] When the target program information includes program data and digital signature, the security module performs a hash operation on the program data to obtain a first message digest.
[0021] The security module uses the public key stored in the security module to decrypt the digital signature to obtain a second message digest;
[0022] If the first message digest is the same as the second message digest, then the security module determines that the target program information verification has passed;
[0023] If the first message digest is different from the second message digest, the security module determines that the target program information verification has failed.
[0024] Optionally, the method further includes:
[0025] When the diagnostic device is connected to the vehicle, the MCU sends a control command to the safety module, the control command being used to instruct the communication module to be enabled;
[0026] After receiving the control command, the security module enables the communication module according to the control command when it is in the first mode; when it is in the second mode, it discards the control command to keep the communication module in a disabled state.
[0027] Optionally, the communication module includes a first switch module, a transceiver module, and a second switch module. The security module activates the communication module according to the control command, including:
[0028] The safety module controls a first switch in the first switch module to turn on, controls a transceiver in the transceiver module to power on, and controls a second switch in the second switch module to turn on, according to the control command.
[0029] Thirdly, a computer device is provided, the computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the diagnostic device control method described in the second aspect above.
[0030] Fourthly, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program, which, when executed by a processor, implements the diagnostic device control method described in the second aspect above.
[0031] Fifthly, a computer program product is provided that, when the computer program product is run on a computer device, causes the computer device to execute the diagnostic device control method described in the second aspect above.
[0032] It is understandable that the beneficial effects of the third, fourth, and fifth aspects mentioned above can be found in the relevant descriptions in the first aspect above, and will not be repeated here. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 This is a schematic diagram of the structure of a diagnostic device provided in an embodiment of this application;
[0035] Figure 2 This is a schematic diagram of the structure of another diagnostic device provided in an embodiment of this application;
[0036] Figure 3 This is a flowchart of a diagnostic equipment control method provided in an embodiment of this application;
[0037] Figure 4 This is a schematic diagram of the structure of another diagnostic device provided in an embodiment of this application;
[0038] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0039] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0040] It should be understood that "multiple" as mentioned in this application refers to two or more. In the description of this application, unless otherwise stated, " / " indicates "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist, for example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, to facilitate a clear description of the technical solutions of this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., do not necessarily imply differences.
[0041] The terms "one embodiment" or "some embodiments" used in this application mean that one or more embodiments of this application include the specific features, structures, or characteristics described in that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this application do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. Furthermore, the terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0042] The application scenarios of the embodiments of this application are described below.
[0043] This application embodiment is applied to a scenario where the program data in the MCU of the diagnostic device is verified after the diagnostic device is powered on, so as to determine whether the diagnostic device is safe before the diagnostic device communicates with the vehicle, thereby ensuring vehicle safety.
[0044] Normally, when diagnostic equipment diagnoses a vehicle, the MCU (Microcontroller Unit) acquires the vehicle's operating condition data and fault information to diagnose the vehicle. However, if the program in the MCU is maliciously tampered with, then communication between the diagnostic equipment and the vehicle will compromise vehicle safety.
[0045] Therefore, this application provides a diagnostic device that can verify the program data in the MCU. If the verification fails, communication between the MCU and the vehicle is prohibited to ensure vehicle safety.
[0046] The diagnostic equipment provided in the embodiments of this application will be described below.
[0047] Figure 1 This is a schematic diagram of the structure of a diagnostic device provided in an embodiment of this application. See also... Figure 1 The diagnostic device 10 may include an MCU 101 and a diagnostic interface chip 102, wherein the diagnostic interface chip 102 may include a communication module 1021 and a security module 1022.
[0048] MCU101 can communicate with diagnostic interface chip 102 via wired or wireless connection.
[0049] Specifically, MCU 101 can communicate with the communication module 1021 in the diagnostic interface chip 102 via a wired or wireless connection. MCU 101 can also communicate with the security module 1022 in the diagnostic interface chip 102 via a wired or wireless connection.
[0050] Optionally, such as Figure 2 As shown, the connection interface between MCU101 and security module 1022 may include a joint test action group (JTAG) interface. In this case, MCU101 and security module 1022 can communicate via wired connection through the JTAG interface.
[0051] Optionally, such as Figure 2 As shown, the connection interface between MCU101 and security module 1022 may also include a communication interface.
[0052] For example, the communication interface can be a serial peripheral interface (SPI), a universal asynchronous receiver / transmitter (UART), or a universal serial bus (USB), etc., and this application embodiment is not limited to this. In this case, the MCU 101 and the security module 1022 can communicate via wired or wireless communication through this communication interface.
[0053] When the diagnostic device 10 is connected to the vehicle, the MCU 101 is used to send control commands to the safety module 101 through the communication interface. The control commands are used to instruct the communication module 1021 to be enabled.
[0054] MCU101 is also used to send communication data to communication module 1021 when communication module 1021 is enabled, so as to communicate with the vehicle through communication module 1021.
[0055] The communication module 1021 is used to realize communication between the MCU 101 and the vehicle. Specifically, the communication module 1021 can receive communication data sent by the MCU 101, convert the format of the communication data into a format that the vehicle can recognize, and then send it to the vehicle; and it can also receive communication data sent by the vehicle, convert the format of the communication data into a format that the MCU 101 can recognize, and then send it to the MCU 101, so as to realize communication between the MCU 101 and the vehicle.
[0056] Security module 1022 is a module used to implement the security functions of diagnostic device 10. For example, security module 1022 can be used for encryption, decryption, signing, signature verification, enabling or disabling communication module 1021, etc., but this application embodiment does not limit this.
[0057] The security module 1022 can also be called an encryption module. For example, the security module 1022 can be a secure element (SE) chip, or other modules that can implement security functions. This application embodiment does not limit this.
[0058] In this embodiment, the security module 1022 and the communication module 1021 are integrated into the diagnostic interface chip 102. Therefore, the security module 1022 can directly enable or disable the communication module 1021 within the diagnostic interface chip 102 without being affected by external commands. This improves the operational security of the diagnostic interface chip 102.
[0059] The diagnostic equipment control method provided in the embodiments of this application will be explained in detail below.
[0060] Figure 3 This is a flowchart illustrating a diagnostic device control method provided in an embodiment of this application. The diagnostic device can be as described above. Figure 1 or Figure 2 Diagnostic equipment in the field. See also Figure 3 The method includes the following steps:
[0061] Step 301: Security module 1022 obtains target program information from MCU 101.
[0062] In some embodiments, the security module 1022 can obtain target program information from the MCU 101 after power-on.
[0063] The communication module 1021 is in a disabled state after the security module 1022 is powered on.
[0064] It should be noted that the communication module 1021 can be disabled after the safety module 1022 is powered on, in order to prevent the MCU 101 from communicating with the vehicle without verification or without passing verification, which would affect vehicle safety.
[0065] For example, the communication module 1021 can be disabled by the safety module 1022 after the safety module 1022 is powered on, or the communication module 1021 can be disabled when the diagnostic device 10 is powered on.
[0066] The target program information is the program information in MCU101 that needs to be verified.
[0067] When the safety module 1022 is powered on, it means that the diagnostic device 10 has just started, that is, the diagnostic device 10 has not yet communicated with the vehicle. Therefore, the safety module 1022 can obtain the target program information from the MCU 101 to verify the MCU 101.
[0068] Optionally, the security module 1022 can obtain target program information from the MCU 101 via the JTAG interface.
[0069] For example, the security module 1022 can send a program retrieval request to the JTAG interface; after receiving the program retrieval request, the JTAG interface can read the target program information from the MCU 101 and then send the target program information to the security module 1022.
[0070] In some embodiments, target program information may include program data and a digital signature.
[0071] This program data can be program data from the MCU101. For example, this program data can be program code from the MCU101.
[0072] The digital signature can be obtained by encrypting the hash value of the program data using the private key of security module 1022.
[0073] For example, during the manufacturing phase of the diagnostic device 10, for program data in the MCU 101 that needs to be verified during use, the hash value of the program data can be encrypted using the private key stored in the security module 1022 to obtain a digital signature, and this digital signature can be stored in the MCU 101. Thus, after the diagnostic device 10 leaves the factory, the program data in the MCU 101 can be verified based on this digital signature during subsequent use.
[0074] In some embodiments, the security module 1022 may store a preset storage address, which is the storage address in the MCU 101 where the target program information is stored. The security module 1022 can obtain the target program information from the preset storage address in the MCU 101.
[0075] For example, the preset storage address may be set in the security module 1022 during the production phase of the diagnostic device 10.
[0076] For example, the security module 1022 can send a program retrieval request carrying a preset memory address to the JTAG interface; after receiving the program retrieval request, the JTAG interface can read the target program information from the preset memory address in the MCU 101, and then send the target program information to the security module 1022.
[0077] For example, the preset storage address may include a first storage address and a second storage address, where the first storage address is used to store program data and the second storage address is used to store digital signatures.
[0078] In this case, if the target program information obtained by the security module 1022 includes the program data and the digital signature, it means that the complete target program information has been obtained, and step 302 can be executed to verify the target program information. If the target program information obtained by the security module 1022 does not include the program data and / or the digital signature, it means that the complete target program information has not been obtained, that is, the target program information in the MCU 101 has been tampered with, so it can be directly determined that the target program information verification has failed.
[0079] Step 302: Security module 1022 verifies the target program information.
[0080] Since the target program information includes a digital signature that can prove whether the program data in MCU101 has been tampered with, the security module 1022 can verify the target program information to determine whether MCU101 is currently secure.
[0081] In some embodiments, step 302 may be performed as follows: when the target program information includes program data and a digital signature, the security module 1022 performs a hash operation on the program data to obtain a first message digest; the public key stored in the security module 1022 is used to decrypt the digital signature to obtain a second message digest; if the first message digest and the second message digest are the same, the target program information is determined to have passed verification; if the first message digest and the second message digest are different, the target program information is determined to have failed verification.
[0082] It should be noted that if the security module 1022 fails to decrypt the digital signature using the public key stored in the security module 1022, it indicates that the digital signature has been tampered with, and it can be directly determined that the target program information verification has failed.
[0083] If the security module 1022 successfully decrypts the digital signature using the public key stored in the security module 1022 and obtains the second message digest, then the second message digest is the hash value of the program data set in the MCU 101 during the production stage of the diagnostic device 10. In other words, the second message digest is the hash value of the correct program data that the MCU 101 should store.
[0084] In this case, if the first message digest is different from the second message digest, it means that the program data in MCU101 has been tampered with, so it can be determined that the target program information verification has failed; if the first message digest is the same as the second message digest, it means that the program data in MCU101 has not been tampered with, so it can be determined that the target program information verification has passed.
[0085] Step 303: Security module 1022 runs in the first mode if the target program information verification passes, and runs in the second mode if the target program information verification fails.
[0086] The first mode is the mode that allows MCU101 to use communication module 1021.
[0087] The second mode is a mode that disables MCU101 from using communication module 1021.
[0088] If the target program information verification passes, it means that the program data in MCU101 has not been tampered with. Therefore, when MCU101 communicates with the vehicle, it will not pose a safety hazard to the vehicle. Thus, security module 1022 can allow MCU101 to use communication module 1021. If the target program information verification fails, it means that the program data in MCU101 has been tampered with. Therefore, when MCU101 communicates with the vehicle, it may pose a safety hazard to the vehicle. Thus, security module 1022 can prohibit MCU101 from using communication module 1021 to ensure vehicle safety.
[0089] In some embodiments, when the security module 1022 operates in a first mode, it can perform operations such as encryption, decryption, signing, signature verification, and enabling or disabling the communication module 1021 to ensure the normal use of the diagnostic device 10. When the security module 1022 operates in a second mode, it can restrict the use of the diagnostic device 10 by disabling the MCU 101 from using the communication module 1021.
[0090] In this embodiment, the security module 1022 can acquire the target program information in the MCU 101 after power-on and verify the target program information. If the target program information verification passes, the MCU 101 is allowed to use the communication module 1021; if the target program information verification fails, the MCU 101 is prohibited from using the communication module 1021. Thus, if the program data in the MCU 101 is tampered with, the security module 1022 can restrict the use of the diagnostic device 10 before it communicates with the vehicle, thereby improving vehicle safety.
[0091] In some embodiments, the security module 1022 enabling the MCU 101 to use the communication module 1021 can be achieved by the security module 1022 responding to a control command sent by the MCU 101 to enable the communication module 1021, thereby enabling the communication module 1021. Conversely, the security module 1022 disabling the MCU 101 from using the communication module 1021 can be achieved by the security module 1022 not responding to a control command sent by the MCU 101 to enable the communication module 1021, i.e., not enabling the communication module 1021.
[0092] As an example, when the diagnostic device 10 is connected to the vehicle, the MCU 101 can send a control command to the safety module 1022 to instruct the safety module 1022 to enable the communication module 1021. After receiving the control command, the safety module 1022 can enable the communication module 1021 according to the control command in the first mode; in the second mode, the control command can be discarded to keep the communication module 1021 in a disabled state.
[0093] In some embodiments, such as Figure 4 As shown, the communication module 1021 may include a first switch module, a transceiver module, and a second switch module.
[0094] The first switch module may include n first switches, the transceiver module may include n transceivers, and the second switch module may include n second switches, where n is a positive integer.
[0095] The first terminals of n first switches are connected to MCU101, the second terminals of n first switches are connected to the first terminals of n transceivers, the second terminals of n transceivers are connected to the first terminals of n second switches, and the second terminals of n second switches are used to connect to the vehicle; the control terminals of the n first switches, the control terminals of the n transceivers, and the control terminals of the n second switches are connected to safety module 1022.
[0096] The first switch module is used to control the on or off of the communication line between the MCU101 and the transceiver module. For example, the first switch module can be a general-purpose input / output (GPIO) switch circuit. Of course, the first switch module can also be other switch modules, and this application embodiment does not limit this.
[0097] Each of the n first switches can control the opening or closing of the communication line between the MCU101 and one of the n transceivers.
[0098] The second switch module is used to control the connection or disconnection of the communication line between the transceiver module and the vehicle. For example, the second switch module can be an on-board diagnostics data link connector (OBD DLC) switch circuit. Of course, the second switch module can also be other switch modules, and this application embodiment does not limit this.
[0099] Each of the n second switches can control the opening or closing of the communication line between one of the n transceivers and the vehicle.
[0100] This transceiver module is used to convert the communication data format between the MCU101 and the vehicle.
[0101] The communication protocols supported by different transceivers among n transceivers can be different.
[0102] For example, the n transceivers may include one or more of the following: Controller Area Network Bus (CANBUS) transceivers, K-line transceivers, Serial Communication Interface (SCI) transceivers, Society of Automotive Engineers (SAE) transceivers, single-wire (SW) CAN transceivers, etc. For example, the SAE transceivers may include one or more of the following: SAE J1708 transceivers, SAE J1850 transceivers, etc.
[0103] The safety module 1022 is used to control the first switches among the n first switches to be turned on or off, and to control the transceivers among the n transceivers to be powered on or off, and to control the second switches among the n second switches to be turned on or off.
[0104] In some embodiments, the operation of the safety module 1022 enabling the communication module 1021 according to the control command can be as follows: the safety module 1022 controls a first switch in the first switch module to be turned on, controls a transceiver in the transceiver module to be powered on, and controls a second switch in the second switch module to be turned on, according to the control command. In this way, the MCU 101 can communicate with the vehicle through the turned-on first switch, the powered-on transceiver, and the turned-on second switch.
[0105] In some embodiments, the operation of the security module 1022 to disable the communication module 1021 can be as follows: the security module 1022 controls all the first switches in the first switch module to turn off, and / or controls all the transceivers in the transceiver module to power down, and / or controls all the second switches in the second switch module to turn off.
[0106] It should be noted that since the transceiver module in the diagnostic device 10 can integrate multiple different types of transceivers, compared to a diagnostic device that only includes one type of transceiver, the diagnostic device 10 provided in this application embodiment can support the diagnosis of vehicles with different communication protocol types, thus improving the ease of use of the diagnostic device 10. Furthermore, compared to purchasing multiple diagnostic devices to diagnose different vehicles separately, the diagnostic device 10 provided in this application embodiment can also reduce diagnostic costs.
[0107] In this embodiment, the diagnostic device 10 includes an MCU 101 and a diagnostic interface chip 102. The diagnostic interface chip 102 includes a communication module 1021 and a security module 1022. The communication module 1021 is used to enable communication between the MCU 101 and the vehicle. The security module 1022 can obtain target program information from the MCU 101, verify the target program information, and allow the MCU 101 to use the communication module 1021 if the target program information verification passes, and prohibit the MCU 101 from using the communication module 1021 if the target program information verification fails. Since the diagnostic interface chip 102 integrates both the security module 1022 and the communication module 1021, the security module 1022 can directly enable or disable the communication module 1021 within the diagnostic interface chip 102, without being affected by external commands. Therefore, the diagnostic interface chip 102 has high operational security. In this situation, when the program data in the MCU101 is tampered with by the security module 1022 in the diagnostic interface chip 102, the use of the diagnostic device 10 can be restricted by prohibiting the MCU101 from using the communication module 1021 in the diagnostic interface chip 102, thereby improving vehicle safety.
[0108] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 5 As shown, the computer device 5 includes a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50. When the processor 50 executes the computer program 52, it implements the steps in the diagnostic device control method in the above embodiments.
[0109] Computer device 5 can be a general-purpose computer device or a special-purpose computer device. In specific implementations, computer device 5 can be a desktop computer, portable computer, network server, handheld computer, mobile phone, tablet computer, wireless terminal device, communication device, or embedded device. This application embodiment does not limit the type of computer device 5. Those skilled in the art will understand that... Figure 5 The computer device 5 is merely an example and does not constitute a limitation on the computer device 5. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0110] Processor 50 can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0111] In some embodiments, memory 51 may be an internal storage unit of the computer device 5, such as a hard disk or memory of the computer device 5. In other embodiments, memory 51 may be an external storage device of the computer device 5, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device 5. Furthermore, memory 51 may include both internal storage units and external storage devices of the computer device 5. Memory 51 is used to store the operating system, applications, boot loader, data, and other programs. Memory 51 may also be used to temporarily store data that has been output or will be output.
[0112] This application also provides a computer device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the steps in any of the above method embodiments.
[0113] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the various method embodiments described above.
[0114] This application provides a computer program product that, when run on a computer, causes the computer to perform the steps described in the various method embodiments above.
[0115] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above method embodiments of this application can be implemented by a computer program instructing related hardware. This computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate form. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a photographing device / terminal device, a recording medium, a computer memory, ROM (read-only memory), RAM (random access memory), CD-ROM (compact disc read-only memory), magnetic tape, floppy disk, and optical data storage devices. The computer-readable storage medium mentioned in this application can be a non-volatile storage medium; in other words, it can be a non-transient storage medium.
[0116] It should be understood that all or part of the steps of the above embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented in whole or in part as a computer program product. The computer program product includes one or more computer instructions. The computer instructions can be stored in the above-described computer-readable storage medium.
[0117] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0118] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0119] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0120] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0121] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A diagnostic device, characterized in that, The diagnostic device includes: a microcontroller unit (MCU) and a diagnostic interface chip; The diagnostic interface chip includes a communication module and a security module. The communication module includes a first switch module, a transceiver module, and a second switch module. The first switch module includes n first switches, the transceiver module includes n transceivers, and the second switch module includes n second switches. The first terminals of the n first switches are connected to the MCU. The second terminals of the n first switches are connected to the first terminals of the n transceivers, and the second terminals of the n transceivers are connected to the first terminals of the n second switches. The second terminals of the n second switches are used to connect to the vehicle. The control terminals of the n first switches, the n transceivers, and the n second switches are connected to the security module. The communication module enables communication between the MCU and the vehicle. The security module enables or disables the communication module. The security module controls the first switches to be turned on or off, controls the transceivers to be powered on or off, and controls the second switches to be turned on or off, where n is a positive integer. The security module is used to obtain target program information from the MCU, verify the target program information, and run in a first mode if the target program information passes the verification, and run in a second mode if the target program information fails the verification. In the first mode, the MCU is allowed to use the communication module, and in the second mode, the MCU is prohibited from using the communication module.
2. The diagnostic device as described in claim 1, characterized in that, The connection interface between the MCU and the security module includes a Joint Test Working Group (JTAG) interface, and the security module is used to obtain the target program information from the MCU through the JTAG interface. And / or, The connection interface between the MCU and the safety module includes a communication interface. When the diagnostic device is connected to the vehicle, the MCU is used to send control commands to the safety module through the communication interface. The control commands are used to instruct the communication module to be enabled.
3. A method for controlling a diagnostic device, characterized in that, The method, applied to the diagnostic device according to any one of claims 1 to 2, comprises: The security module obtains the target program information from the MCU; The security module verifies the target program information; The security module operates in a first mode if the target program information verification passes, and in a second mode if the target program information verification fails. In the first mode, the MCU is allowed to use the communication module, and in the second mode, the MCU is prohibited from using the communication module.
4. The method as described in claim 3, characterized in that, The security module obtains target program information from the MCU, including: The security module obtains target program information from the MCU after power-on; wherein, the communication module is in a disabled state after the security module is powered on.
5. The method as described in claim 3, characterized in that, The security module verifies the target program information, including: When the target program information includes program data and digital signature, the security module performs a hash operation on the program data to obtain a first message digest. The security module uses the public key stored in the security module to decrypt the digital signature to obtain a second message digest; If the first message digest is the same as the second message digest, then the security module determines that the target program information verification has passed; If the first message digest is different from the second message digest, the security module determines that the target program information verification has failed.
6. The method as described in any one of claims 3 to 5, characterized in that, The method further includes: When the diagnostic device is connected to the vehicle, the MCU sends a control command to the safety module, the control command being used to instruct the communication module to be enabled; After receiving the control command, the security module enables the communication module according to the control command when it is in the first mode; when it is in the second mode, it discards the control command to keep the communication module in a disabled state.
7. The method as described in claim 6, characterized in that, The communication module includes a first switch module, a transceiver module, and a second switch module. The security module activates the communication module according to the control command, including: The safety module controls a first switch in the first switch module to turn on, controls a transceiver in the transceiver module to power on, and controls a second switch in the second switch module to turn on, according to the control command.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 3 to 7.
9. A computer program product, characterized in that, When the computer program product is run on a computer device, the computer device causes the computer device to perform the method as described in any one of claims 3 to 7.
Citation Information
Patent Citations
Communication method of vehicle diagnosis equipment and vehicle diagnosis equipment
CN110011809A
Authentication method and device of vehicle diagnosis equipment, electronic equipment and medium
CN114513310A