Diagnostic equipment control methods, storage media and program products
By introducing a security chip into the diagnostic equipment for MCU authentication and target program verification, the problems of unauthorized MCUs and tampered programs are solved, ensuring the security and functional integrity of the vehicle diagnostic equipment.
Patent Information
- Application Number
- CN202510223875.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-02-27
AI Technical Summary
Unauthorized microcontroller units (MCUs) may compromise the security of diagnostic equipment and the integrity of target programs, leading to malfunctions in vehicle diagnostic functions.
By introducing a security chip into the diagnostic equipment, the MCU is authenticated using public and private keys, and the target program information is verified. The activation or deactivation of the integrated circuit is controlled to ensure that only authorized MCUs and untampered programs can communicate with the vehicle.
This improves the security of diagnostic equipment, prevents uncertified MCUs and tampered programs from affecting vehicle safety, and ensures the normal operation of vehicle diagnostic functions.
Smart Images

Figure CN119937428B_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 acquire vehicle operating data and fault information to perform vehicle diagnostics. However, using unauthorized MCUs, which have not been tested by the diagnostic equipment manufacturer, can compromise the security of the equipment. Furthermore, unauthorized MCUs may tamper with the target program within them. Therefore, preventing the use of unauthorized MCUs and ensuring that diagnostic equipment executes the correct target program is a pressing issue that needs to be addressed. Summary of the Invention
[0003] This application provides a diagnostic equipment control method, storage medium, and program product, which can improve the safety of using diagnostic equipment. The technical solution is as follows:
[0004] A first aspect provides a diagnostic device control method. The diagnostic device includes a microcontroller unit (MCU), a security chip, and an integrated circuit. The integrated circuit enables communication between the MCU and a vehicle. The security chip controls the MCU to use the integrated circuit. The MCU stores a public key, and the security chip stores a private key. The method includes: the security chip generating first data, which is a random number; the security chip sending the first data to the MCU and receiving second data returned by the MCU, the second data being encrypted by the MCU using the public key; the security chip decrypting the second data using the private key to obtain third data; the security chip verifying the first data and the third data; the security chip obtaining target program information from the MCU; the security chip verifying the target program information; and the security chip operating in a first mode if the target program information verification passes and the first data and the third data verification pass, and operating in a second mode if the target program information verification fails or the first data and the third data verification fails. In the first mode, the MCU is allowed to use the integrated circuit, and in the second mode, the MCU is prohibited from using the integrated circuit.
[0005] In conjunction with the first aspect, the security chip generates the first data, including: after the security chip is powered on and communication is established with the MCU, the security chip receives a verification instruction sent by the MCU and generates the first data.
[0006] In conjunction with the first aspect, in some embodiments provided in the first aspect, the public key includes an asymmetric encryption algorithm public key, the private key includes an asymmetric encryption algorithm private key, and the security chip verifies the first data and the third data, including: the security chip comparing the first data and the third data; if the first data and the third data are the same, the security chip determines that the verification of the first data and the third data has passed; if the first data and the third data are different, the security chip determines that the verification of the first data and the third data has failed.
[0007] In conjunction with the first aspect, in some embodiments provided in the first aspect, the security chip obtains target program information from the MCU, including: the security chip obtains target program information from the MCU after power-on; wherein the integrated circuit is in a disabled state after the security chip is powered on.
[0008] In conjunction with the first aspect, in some embodiments provided in the first aspect, the security chip verifies the target program information, including: when the target program information includes program data and a digital signature, the security chip performs encryption operations on the program data to obtain a first message digest; the security chip verifies the digital signature against the first message digest; if the digital signature and the first message digest pass the verification, the security chip determines that the target program information has passed the verification; if the digital signature and the first message digest fail the verification, the security chip determines that the target program information has failed the verification.
[0009] In conjunction with the first aspect, in some embodiments provided in the first aspect, the method further includes: when the diagnostic device is connected to the vehicle, the MCU sends a control command to the security chip, the control command being used to instruct the integrated circuit to be enabled; after receiving the control command, the security chip enables the integrated circuit according to the control command when in the first mode; and when in the second mode, discards the control command to keep the integrated circuit in a disabled state.
[0010] In conjunction with the first aspect, in some embodiments provided in the first aspect, the integrated circuit includes a first switch module, a transceiver module, and a second switch module. The security chip enables the integrated circuit according to the control instruction, including: the security chip 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.
[0011] It should be noted that, in the absence of conflict, the features in the various embodiments of the first aspect can be combined with each other, and any combination of features in different embodiments is also within the protection scope of this application. That is to say, the various embodiments described above can also be arbitrarily combined according to actual needs.
[0012] Secondly, a diagnostic device control method is provided. The diagnostic device includes a microcontroller unit (MCU), a security chip, and an integrated circuit. The integrated circuit is used to enable communication between the MCU and a vehicle. The security chip is used to control the MCU to use the integrated circuit. The MCU stores a public key, and the security chip stores a private key. The method includes: the security chip generating first data, which is a random number; the security chip sending the first data to the MCU and obtaining second data returned by the MCU, which is obtained by the MCU encrypting the first data using the public key; the security chip decrypting the second data using the private key to obtain third data; the security chip verifying the first data and the third data; and the security chip operating in a first mode if the verification between the first data and the third data passes, and operating in a second mode if the verification fails. In the first mode, the MCU is allowed to use the integrated circuit, and in the second mode, the MCU is prohibited from using the integrated circuit.
[0013] Thirdly, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the method of the first aspect or any embodiment of the first aspect or the second aspect described above.
[0014] Fourthly, a computer device is provided, including a memory, a processor, and a computer program stored in the memory, the processor executing the computer program to implement the method of the first aspect or any embodiment of the first aspect or the second aspect.
[0015] Fifthly, a chip is provided for use in an electronic device, the chip including one or more processors, the processors being configured to invoke computer instructions to cause the electronic device to perform the methods described in the first aspect or any embodiment of the first aspect or the second aspect. Attached Figure Description
[0016] Figure 1 This is a flowchart of a diagnostic equipment control method provided in an embodiment of this application;
[0017] Figure 2 This is a schematic diagram of a diagnostic device module provided in an embodiment of this application;
[0018] Figure 3 This is a schematic diagram of the structure of a diagnostic device provided in an embodiment of this application;
[0019] Figure 4 This is a flowchart of an MCU control method provided in an embodiment of this application;
[0020] Figure 5 This is a schematic diagram of an MCU unit provided in an embodiment of this application;
[0021] Figure 6 This is a flowchart of a diagnostic interface chip control method provided in an embodiment of this application;
[0022] Figure 7 This is a schematic diagram of a diagnostic interface chip unit provided in an embodiment of this application;
[0023] Figure 8 This is a flowchart of another diagnostic device control method provided in an embodiment of this application;
[0024] Figure 9 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0025] 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.
[0026] 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.
[0027] 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.
[0028] The application scenarios of the embodiments of this application are described below.
[0029] This application embodiment is applied to a scenario where the MCU in 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.
[0030] Typically, 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 MCU is not certified by the diagnostic equipment manufacturer, using this uncertified MCU to communicate with the vehicle can compromise vehicle safety. For example, an uncertified MCU might tamper with the diagnostic equipment manufacturer's preset target program, affecting the vehicle's normal diagnostic functions.
[0031] Therefore, this application provides a diagnostic device control method that can verify and control the diagnostic device. The diagnostic device includes an MCU and a diagnostic interface chip. The diagnostic interface chip includes an integrated circuit and a security chip. The integrated circuit provides communication between the MCU and the vehicle, and the security module controls the activation and deactivation of the integrated circuit. The security module can control the activation and deactivation of the integrated circuit based on the MCU verification results and the target program verification results.
[0032] The method for verifying the MCU by the security module includes: the MCU communicates with the security chip, the security chip sends first data, the MCU encrypts the first data with the public key to obtain second data, the MCU sends the second data, the security chip decrypts the second data with the private key to obtain third data, and the MCU is verified by comparing whether the first data and the third data are consistent.
[0033] The method for the security module to verify the target program includes: the security chip obtains the target program information in the MCU, the target program information includes program data and digital signature, the security chip generates a first message digest based on the program data, and compares whether the digital signature and the first message digest are consistent to verify the target program.
[0034] If both the MCU and the target program pass verification, the safety module enables the integrated circuit, allowing the MCU to communicate with the vehicle. If either the MCU or the target program fails verification, the safety module disables the integrated circuit, prohibiting the MCU from communicating with the vehicle to ensure vehicle safety.
[0035] The following four embodiments illustrate the diagnostic device control method, storage medium, and program product. Embodiments 1 to 3 describe one control method for a diagnostic device, and Embodiment 4 describes another control method for a diagnostic device. Embodiment 1 describes the complete flow of the diagnostic device executing the control method, Embodiment 2 describes the complete flow of the MCU executing the control method, and Embodiment 3 describes the complete flow of the diagnostic interface chip executing the control method.
[0036] Example 1
[0037] Figure 1 This is a flowchart of a diagnostic device control method provided in an embodiment of this application. Figure 1 As shown, the method includes the following steps:
[0038] S101. After the diagnostic interface chip and MCU are powered on, the diagnostic interface chip and MCU communicate through the first communication interface.
[0039] In this embodiment, the diagnostic interface chip includes a security chip and an integrated circuit. After power-on, the security chip is enabled, and the integrated circuit is disabled.
[0040] It should be noted that the integrated circuit can be in a disabled state after the security chip is powered on, in order to prevent the MCU from communicating with the vehicle without verification or without passing verification, which would affect vehicle safety.
[0041] For example, the integrated circuit can be disabled by the security chip after the security chip is powered on, or the integrated circuit can be disabled by not powering on the diagnostic device when it is powered on.
[0042] In this embodiment of the application, the first communication interface includes a joint test action group (JTAG) interface, a serial peripheral interface (SPI), and a universal asynchronous receiver / transmitter (UART).
[0043] When the safety chip powers on, it means that the diagnostic equipment has just started up, meaning that the diagnostic equipment has not yet communicated with the vehicle. Therefore, the safety chip can establish a connection with the MCU in order to verify the MCU through this connection.
[0044] Alternatively, the security chip can communicate with the MCU via an SPI or UART interface.
[0045] For example, the security chip can send a communication request to the SPI (or UART) interface. After receiving the communication request, the SPI (or UART) interface can send the communication request to the MCU, and then the MCU returns the response to the communication request to the security chip.
[0046] In other embodiments, the MCU can send a communication request to the SPI or UART interface, send the communication request to the security chip through the corresponding communication interface, and receive the response returned by the security chip.
[0047] Among them, SPI and UART are wired connections. The security chip and / or MCU can first detect whether there are wires connected to the SPI and UART interfaces, and then communicate through the SPI or UART interface with the wires connected.
[0048] In some embodiments, the configuration of SPI and UART communication can be preset in the security chip and MCU.
[0049] For example, if the security chip detects that the SPI interface is connected to the MCU by a wire, it will send a preset communication request to the SPI interface. When the MCU receives the communication request, it can determine the response from the preset SPI communication settings in the MCU, and then send the response to the security chip.
[0050] In this embodiment, the security chip receives a response from the MCU via the first communication interface, indicating that a communication connection has been established between the security chip and the MCU. The security chip can then send and receive data with the MCU through this communication connection.
[0051] S102. The MCU sends a command to the security chip, and the security chip generates the first data.
[0052] In this embodiment, the MCU can send a verification instruction to the security chip, which instructs the security chip to start a verification program for the MCU.
[0053] In this embodiment, after generating the first data, the security chip sends the first data to the MCU through the communication connection established in step S101. Simultaneously, the security chip stores the first data for use in executing the verification method for the two data points in subsequent step S105.
[0054] The security chip generates a random number as the first data, which prevents the MCU from knowing the first data in advance and ensures the authenticity of the verification.
[0055] S103. The security chip sends the first data to the MCU. The MCU encrypts the first data using the public key to obtain the second data. The security chip then obtains the second data returned by the MCU.
[0056] In this embodiment, the security chip sends the first data to the MCU through a first communication interface.
[0057] In other embodiments, the security chip sends a verification command to the MCU, instructing the MCU to receive the first data generated by the security chip. After receiving a response from the MCU, the security chip sends the first data back to the MCU.
[0058] In this embodiment, the public key stored in the MCU is an asymmetric encryption algorithm public key. Data encrypted with the asymmetric encryption algorithm public key requires decryption with the corresponding asymmetric encryption algorithm private key to be retrieved.
[0059] Optionally, asymmetric encryption algorithms include the RSA encryption algorithm (RSA for short) and the SM2 encryption algorithm (SM2 for short).
[0060] For example, the MCU receives the first data sent by the security chip, and encrypts the first data with the RSA public key to obtain the second data.
[0061] The second data needs to be decrypted using the RSA private key corresponding to the RSA public key in order to obtain the first data. If the RSA private key used to decrypt the second data does not correspond to the encrypted RSA public key, then decrypting the second data will yield other data that is different from the first data.
[0062] In this embodiment of the application, the MCU returns second data to the security chip through the first communication interface. The second data is used to verify whether the public key stored in the MCU corresponds to the private key stored in the security chip.
[0063] For example, the public key can be preset in the MCU's storage space, and the private key can be preset in the security chip. If the MCU is an original chip in the diagnostic device (such as an MCU pre-configured by the diagnostic device manufacturer), the public key stored in the MCU corresponds to the private key stored in the security chip, and the security chip can obtain the first data by decrypting the second data.
[0064] S104. The security chip decrypts the second data using a private key to obtain the third data.
[0065] In this embodiment, the security chip decrypts the second data using a private key to obtain the third data.
[0066] For example, the security chip uses an RSA private key to decrypt the second data to obtain the third data.
[0067] The third piece of data, decrypted using the private key, can be referred to as plaintext data. The security chip needs to compare the plaintext data with the random number generated in step S102 and perform steps such as S105 to verify the MCU.
[0068] S105. The security chip verifies the MCU based on the first and third data.
[0069] In this embodiment, if the first data and the third data are consistent, it indicates that the public key in the MCU corresponds to the private key in the security chip, and the verification of the MCU passes. Conversely, if the first data and the third data are inconsistent, it indicates that the public key in the MCU does not correspond to the private key in the security chip, and the verification of the MCU fails.
[0070] It should be noted that if the security chip fails to decrypt the second data using the private key stored in the security chip, it means that the public key in the MCU has been tampered with, and it can be directly determined that the MCU verification has failed.
[0071] If the security chip successfully decrypts the second data using the private key stored in the security chip, it obtains the third data. In this case, if the first data and the third data are different, it means that the MCU has tampered with the first data, so it can be determined that the MCU's verification has failed; if the first data and the third data are the same, it means that the MCU has not been tampered with, so it can be determined that the MCU's verification has passed.
[0072] S106. The security chip obtains target program information from the MCU.
[0073] For example, the integrated circuit can be disabled by the security chip after the security chip is powered on, or the integrated circuit can be disabled by not powering on the diagnostic device when it is powered on.
[0074] The target program information is the program information in the MCU that needs to be verified.
[0075] When the security chip is powered on, it means that the diagnostic equipment has just started up, that is, the diagnostic equipment has not yet communicated with the vehicle. Therefore, the security chip can obtain target program information from the MCU to verify the MCU.
[0076] Optionally, the security chip can obtain target program information from the MCU through the first communication interface.
[0077] For example, the security chip can send a program acquisition request to the first communication interface; after receiving the program acquisition request, the first communication interface can read the target program information from the MCU and then send the target program information to the security chip.
[0078] In some embodiments, target program information may include program data and a digital signature.
[0079] This program data can be program data from the MCU. For example, this program data can be program code from the MCU.
[0080] The digital signature can be obtained by encrypting the hash value of the program's data.
[0081] For example, during the manufacturing phase of a diagnostic device, for program data in the MCU that needs to be verified during use, a security chip can be used to encrypt the hash value of the program data, obtaining a digital signature, which is then stored in the MCU. Thus, after the diagnostic device leaves the factory, the program data in the MCU can be verified based on this digital signature during subsequent use.
[0082] In some embodiments, the security chip may store a preset memory address, which is the memory address in the MCU where the target program information is stored. The security chip can obtain the target program information from the preset memory address in the MCU.
[0083] For example, the preset storage address may be set in the security chip during the manufacturing stage of the diagnostic device.
[0084] For example, the security chip can send a program retrieval request carrying a preset memory address to the first communication interface; after receiving the program retrieval request, the first communication interface can read the target program information from the preset memory address in the MCU, and then send the target program information to the security chip.
[0085] 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.
[0086] In this case, if the target program information obtained by the security chip includes the program data and the digital signature, it means that the complete target program information has been obtained, and the subsequent step S107 can be executed to verify the target program information; if the target program information obtained by the security chip 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 has been tampered with, so it can be directly determined that the target program information verification has failed.
[0087] S107. The security chip verifies the target program information.
[0088] Because the target program information includes a digital signature that can prove whether the program data in the MCU has been tampered with, the security chip can verify the target program information to determine whether the MCU is currently secure.
[0089] In some embodiments, step S107 can be performed as follows: When the target program information includes program data and a digital signature, the security chip performs encryption operations on the program data to obtain a first message digest. The security chip verifies the digital signature against the first message digest, for example, by decrypting the digital signature using an asymmetric encryption key and then comparing it with the first message digest. If the verification between the digital signature and the first message digest passes, the target program information is determined to have passed verification; if the verification fails, the target program information is determined to have failed verification.
[0090] If the digital signature fails to verify the first message digest, it means that the program data in the MCU has been tampered with, so it can be determined that the target program information verification has failed; if the digital signature passes the verification of the first message digest, it means that the program data in the MCU has not been tampered with, so it can be determined that the target program information verification has passed.
[0091] In this embodiment, the security chip does not restrict the order of verifying the MCU and the target program information, that is, steps S106-S107 can be executed after step S101. In this embodiment, the specific execution order of steps S102-S105 and steps S106-S107 is not restricted.
[0092] S108. The security chip operates in the first mode when the target program information verification is successful and the first data and the third data verification are successful, and operates in the second mode when the target program information verification fails or the first data and the third data verification fails.
[0093] In the embodiments of this application, the first mode is a mode that allows the MCU to control the integrated circuit, and the second mode is a mode that disables the MCU from controlling the integrated circuit.
[0094] If the MCU verification passes, it means that the program data in the MCU has not been tampered with; if the MCU verification fails, it means that the MCU is not the original MCU of the diagnostic device, or that it is an unauthorized MCU.
[0095] If the target program information verification passes, it means that the MCU is the original MCU of the diagnostic equipment; if the target program information verification fails, it means that the program data in the MCU has been tampered with.
[0096] If the MCU verification passes and the target program information verification passes, then when the MCU communicates with the vehicle, it will not pose a safety hazard to the vehicle. Therefore, the security chip allows the MCU to use integrated circuits.
[0097] If the MCU verification fails, or the target program information verification fails, then when the MCU communicates with the vehicle, it may pose a safety hazard to the vehicle. Therefore, the security chip can prevent the MCU from using integrated circuits to ensure vehicle safety.
[0098] In some embodiments, when the security chip operates in a first mode, it can perform operations such as encryption, decryption, signing, signature verification, and enabling or disabling integrated circuits to ensure the normal use of the diagnostic device. When the security chip operates in a second mode, it can restrict the use of the diagnostic device by disabling the MCU from using integrated circuits.
[0099] In this embodiment, after power-on, the security chip can send first data to the MCU, receive second data returned by the MCU, and verify the third data decrypted from the second data. The security chip can also obtain target program information from the MCU and verify the target program information. The security chip allows the MCU to use the integrated circuit if both the MCU verification and the target program verification pass; otherwise, it prohibits the MCU from using the integrated circuit if either the MCU verification or the target program verification fails.
[0100] Based on the above method, when the MCU in the diagnostic device is unauthorized and / or the target program in the diagnostic device is tampered with, the security chip can restrict the use of the diagnostic device before the MCU communicates with the vehicle, thereby improving vehicle safety.
[0101] In some embodiments, allowing the MCU to use the integrated circuit can be achieved by the security chip responding to a control command sent by the MCU to enable the integrated circuit, thereby enabling the integrated circuit. Conversely, disabling the MCU from using the integrated circuit can be achieved by the security chip not responding to the control command sent by the MCU to enable the integrated circuit, i.e., not enabling the integrated circuit.
[0102] For example, when the diagnostic device is connected to the vehicle, the MCU can send a control command to the security chip to instruct the security chip to enable the integrated circuit. After receiving the control command, the security chip can enable the integrated circuit according to the control command in the first mode; in the second mode, it can discard the control command to keep the integrated circuit in a disabled state.
[0103] Figure 2 This is a schematic diagram of a diagnostic device module provided in an embodiment of this application.
[0104] like Figure 2 As shown, the diagnostic device 10 may include an MCU 101 and a diagnostic interface chip 102, wherein the diagnostic interface chip 102 may include an integrated circuit 1021 and a security module 1022.
[0105] In this embodiment of the application, the security module 1022 may include the aforementioned Figure 1 The described security chip performs the aforementioned Figure 1 The execution scheme of the security chip in steps S101-S108. MCU101 can belong to the aforementioned... Figure 1 The MCU described above executes the aforementioned Figure 1 The execution scheme of the MCU in steps S101-S108. Integrated circuit 1021 can belong to the aforementioned... Figure 1 The integrated circuit described in [the document] performs the aforementioned [function]. Figure 1The execution scheme of integrated circuits in steps S101-S108.
[0106] like Figure 2 As shown, MCU101 communicates independently with integrated circuit 1021, and also independently with security module 1022. Security module 1022 can receive data returned by MCU101 and control the communication of integrated circuit 1021. Integrated circuit 1021 can communicate with MCU101 through an internal interface and with the vehicle through an external interface. When integrated circuit 1021 is enabled, both the internal and external interfaces are open, allowing MCU101 to communicate with the vehicle.
[0107] For example, MCU101 communicates with integrated circuit 1021 using a second communication interface (such as a general-purpose input / output (GPIO) interface), and MCU101 communicates with security module 1022 using a first communication interface (such as an SPI interface and a UART interface). Integrated circuit 1021 communicates with the vehicle using an on-board diagnostics (OBD) interface.
[0108] In this case, MCU101 and integrated circuit 1021 can communicate via wired interface through GPIO interface, and MCU101 and security module 1022 can communicate via wired interface through SPI interface and / or UART interface.
[0109] Optionally, the connection interface between MCU101 and security module 1022 may also include other communication interfaces. For example, these other communication interfaces may be JTAG interfaces, universal serial buses (USB), etc., and this application embodiment does not limit them.
[0110] Specifically, MCU101 can communicate with the security module 1022 in the diagnostic interface chip 102 via a wired or wireless connection. For example, MCU101 can be wired to the security module 1022 via an SPI interface and / or a UART interface.
[0111] Specifically, MCU101 can communicate with integrated circuit 1021 in diagnostic interface chip 102 via wired or wireless connection. For example, MCU101 can be wired to integrated circuit 1021 via GPIO interface.
[0112] In this embodiment of the application, the diagnostic device 10 can communicate with the vehicle via a wired or wireless connection.
[0113] The MCU 101 can communicate with the vehicle under the control of the diagnostic interface chip 102. The integrated circuit 1021 in the diagnostic interface chip 102 provides a transceiver interface for communication between the MCU 101 and the vehicle, and is controlled by the safety module 1022. The safety module 1022 controls the switching of the transceiver in the integrated circuit 1021, thereby controlling the communication between the MCU 101 and the vehicle, which is equivalent to controlling the communication between the diagnostic device 10 and the vehicle.
[0114] Integrated circuit 1021 is used to realize communication between MCU 101 and the vehicle. Specifically, integrated circuit 1021 can receive communication data sent by 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 MCU 101 can recognize, and then send it to MCU 101, so as to realize communication between MCU 101 and the vehicle.
[0115] 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 integrated circuit 1021, etc., but this application embodiment does not limit this.
[0116] 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.
[0117] In this embodiment, the security module 1022 and the integrated circuit 1021 are integrated into the diagnostic interface chip 102. Therefore, the security module 1022 can directly enable or disable the integrated circuit 1021 inside the diagnostic interface chip 102 without being interfered with by external instructions. This can improve the operational security of the diagnostic interface chip 102.
[0118] Figure 3 This is a schematic diagram of the structure of a diagnostic device provided in an embodiment of this application.
[0119] In the embodiments of this application, such as Figure 3 As shown, the integrated circuit may include a first switch module, a transceiver module, and a second switch module.
[0120] 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.
[0121] The first terminals of n first switches are connected to the MCU, 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 n transceivers, and the n second switches are connected to the security chip.
[0122] The first switch module is used to control the on or off of the communication line between the MCU and the transceiver module. For example, the first switch module can be a GPIO switch circuit; however, it can also be other switch modules, and this application embodiment does not limit this.
[0123] Each of the n first switches can control the opening or closing of the communication line between the MCU and one of the n transceivers.
[0124] 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.
[0125] 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.
[0126] This transceiver module is used to convert the communication data format between the MCU and the vehicle.
[0127] The communication protocols supported by different transceivers among n transceivers can be different.
[0128] 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.
[0129] The security chip is used to control the on or off of each of the n first switches, to control the power on or off of each of the n transceivers, and to control the on or off of each of the n second switches.
[0130] In some embodiments, the operation of the security chip enabling the integrated circuit according to the control command can be as follows: the security chip 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. In this way, the MCU can communicate with the vehicle through the turned-on first switch, the powered-on transceiver, and the turned-on second switch.
[0131] In some embodiments, the operation of the security chip to disable the integrated circuit can be: the security chip 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.
[0132] It should be noted that, since the transceiver module in the diagnostic device can integrate multiple different types of transceivers, compared to a diagnostic device that only includes one type of transceiver, the diagnostic device 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. Furthermore, compared to purchasing multiple diagnostic devices to diagnose different vehicles separately, the diagnostic device provided in this application embodiment can also reduce diagnostic costs.
[0133] In this embodiment, the diagnostic device includes an MCU and a diagnostic interface chip. The diagnostic interface chip includes an integrated circuit and a security chip. The integrated circuit enables communication between the MCU and the vehicle. The security chip can generate first data and send it to the MCU. The MCU encrypts the first data using a public key to obtain second data and returns it to the security chip. The security chip decrypts the second data using a private key to obtain third data, and compares the first data with the third data to verify the MCU. The security chip can also obtain target program information from the MCU, including program data and a digital signature. The security chip can obtain a first message digest based on the program data and verify the target program information by verifying the digital signature against the first message digest.
[0134] The MCU is allowed to use the integrated circuit if both MCU verification and target program information verification pass; otherwise, the MCU is prohibited from using the integrated circuit. Because the diagnostic interface chip integrates both a security chip and the integrated circuit, the security chip can directly enable or disable the integrated circuit within the diagnostic interface chip itself, without interference from external commands, thus ensuring high operational security. In this scenario, the security chip within the diagnostic interface chip can restrict the use of diagnostic equipment by disabling the MCU's use of the integrated circuit when the MCU is tampered with (i.e., not a manufacturer's original MCU) or when the program data in the MCU is altered, thereby improving vehicle safety.
[0135] It should be noted that the security chip can obtain the first message digest through encryption operations. The encryption operations may include Message-Digest Algorithm 5 (MD5), SM2 and hash encryption, etc., and the embodiments of this application do not limit this.
[0136] It should be noted that the MCU can encrypt the first data using an encryption algorithm, and the security chip can decrypt the second data using the same encryption algorithm. For example, the encryption algorithm may include asymmetric encryption algorithms, such as RSA, SM2, etc., but this application embodiment does not limit this.
[0137] Example 2
[0138] Figure 4 This is a flowchart of an MCU control method provided in an embodiment of this application. Figure 4 As shown, the method includes the following steps:
[0139] S201. The MCU powers on and establishes a communication connection with the diagnostic interface chip.
[0140] In this embodiment, the method for establishing communication between the MCU and the diagnostic interface chip device after power-on can be referred to the foregoing. Figure 1 The steps in S101 will not be repeated here.
[0141] S202. The MCU sends a command to the security chip to obtain the first data.
[0142] In this embodiment, the MCU sends a verification command to the security chip in the diagnostic device via a first communication interface, and the security chip generates first data. The execution method of the security chip can be referred to the foregoing. Figure 1 Step S102 will not be repeated here.
[0143] In this embodiment, the MCU can automatically send a verification command after establishing a communication connection with the security chip, or the MCU can send a verification command after receiving a user's operation.
[0144] For example, when a diagnostic device receives a user's verification operation on the diagnostic device, it instructs the MCU to send a verification command to the security chip.
[0145] In some implementations, the MCU stores verification instructions. The MCU can directly retrieve the verification instructions from the storage unit, or the MCU can generate verification instructions together with the verification-related program.
[0146] Optionally, the MCU stores the acquired first data in the MCU's memory unit.
[0147] The S203.MCU encrypts the first data using the public key to obtain the second data, and then sends the second data to the security chip.
[0148] For a detailed description of how the MCU encrypts the first data to obtain the second data in this embodiment, please refer to the foregoing. Figure 1 Step S103 will not be repeated here.
[0149] The second data is the encrypted version of the first data, and a corresponding decryption method is required to restore the encrypted first data.
[0150] For example, if the second data is ciphertext data encrypted with a public key in an asymmetric encryption algorithm, then the first data can only be obtained by decryption with the private key corresponding to the public key. The public key and the private key may belong to different devices or components, and the device or component possessing the public key and the private key can be identified as an authentication device (i.e., an authorized device) or an authentication component (i.e., an authorized component).
[0151] Optionally, the MCU can store the acquired second data in the MCU's memory unit, and the MCU can also store the encryption algorithm for the first data in the MCU's memory unit.
[0152] In this embodiment, the MCU can return second data to the security chip through the first communication interface as a response to the security chip sending the first data.
[0153] The security chip receives the second data, decrypts it using its stored private key to obtain the third data, compares the third data with the first data, and obtains the verification result. The specific method by which the security chip obtains the third data can be found in the preceding text. Figure 1 For the specific method of verifying the MCU using the security chip in step S104, please refer to the aforementioned documentation. Figure 1 The steps in S105 will not be repeated here.
[0154] S204. The MCU receives a request from the security chip to obtain target program information and sends the target program information to the security chip.
[0155] In this embodiment, the MCU stores target program information, and the specific execution method of the MCU can be referred to the foregoing. Figure 1 Step S106 will not be repeated here.
[0156] In this embodiment, after the MCU establishes a communication connection with the security chip, it can receive a request from the security chip to obtain target program information. That is, step S204 can be executed after step S201. This embodiment does not restrict the specific execution order of steps S202-S203 and step S204.
[0157] S205.MCU obtains the verification result of the security chip and executes the scheme corresponding to the detection result.
[0158] In this embodiment, the security chip can send the verification result to the MCU. Depending on the mode the security chip is in, the MCU executes different methods.
[0159] Specifically, the security chip determines the MCU's operating mode based on the verification results. If the security chip enters the first mode, the MCU is allowed to control the integrated circuit; if the security chip enters the second mode, the MCU is prohibited from controlling the integrated circuit. For details on the specific verification method of the security chip, please refer to the aforementioned... Figure 1 The steps in S108 will not be repeated here.
[0160] Figure 5 This is a schematic diagram of an MCU unit provided in an embodiment of this application. See also... Figure 5 The MCU may include an encryption unit 201, a first storage unit 202, and a first communication unit 203.
[0161] Specifically, the encryption unit 201 is used to encrypt the first data acquired by the MCU. The encryption unit 201 can encrypt the first data based on an asymmetric encryption algorithm.
[0162] For example, the MCU obtains the first data generated by the security chip, and the encryption unit 201 encrypts the first data using the RSA algorithm public key to obtain the second data.
[0163] The first storage unit 202 is used to store data from the MCU. This data includes first data, second data, target program information, and encryption algorithms within the MCU.
[0164] The first communication unit 203 is used to communicate with the diagnostic interface chip.
[0165] Specifically, the first communication unit 203 communicates with the security chip in the diagnostic interface chip through a first communication interface, and with the integrated circuit in the diagnostic interface chip through a second communication interface. The first communication interface includes wired and wireless communication, and the second communication interface includes both wired and wireless communication.
[0166] For example, the first communication interface includes wired communication interfaces such as SPI and UART, and the MCU can use SPI or UART to communicate with the security chip via wired communication in the first communication unit 203. The second communication interface includes a GPIO wired communication interface, and the MCU can use GPIO to communicate with the integrated circuit via wired communication in the first communication unit 203. This application embodiment does not limit the specific communication method of the first communication unit 203.
[0167] In some embodiments, the MCU may further include an execution module, the execution module being based on, for example, Figure 4 The verification result obtained in step S205 is used to execute the corresponding method. For example, if the security chip verification indicates the first mode, the integrated circuit is connected, and the MCU can communicate with the vehicle through the integrated circuit; if the security chip verification indicates the second mode, the integrated circuit is interrupted, and the MCU cannot communicate with the vehicle.
[0168] The specific implementation methods of the corresponding steps described above will not be repeated in this application.
[0169] It is understood that the functional division between the various units illustrated in the embodiments of this application is merely illustrative and does not constitute a limitation on the function of the MCU. In other embodiments of this application, the MCU may also employ different units than those in the above embodiments, or a combination of multiple units, to implement the functions of the MCU.
[0170] Example 3
[0171] Figure 6 This is a flowchart of a diagnostic interface chip control method provided in an embodiment of this application. Figure 6 As shown, the method includes the following steps:
[0172] S301. The diagnostic interface chip powers on and establishes a communication connection with the MCU.
[0173] In this embodiment, the communication between the diagnostic interface chip and the MCU after power-on can be referred to the foregoing. Figure 1 The steps in S101 will not be repeated here.
[0174] The S302 diagnostic interface chip receives the instruction sent by the MCU and sends the generated first data to the MCU.
[0175] In this embodiment, the security chip in the diagnostic interface chip receives a verification command sent by the MCU and generates first data. For the specific method of the security chip receiving the MCU's verification command and generating the first data, please refer to the foregoing... Figure 1 Step S102 will not be repeated here.
[0176] The MCU encrypts the received first data to obtain the second data, and then executes the process as described above. Figure 1 Step S103 will not be repeated here.
[0177] The S303 diagnostic interface chip receives the second data returned by the MCU and decrypts it using the private key to obtain the third data.
[0178] In this embodiment, the security chip stores the decryption algorithm corresponding to the MCU encryption algorithm. The security chip can decrypt the second data using a private key. The specific method for obtaining the third data by decrypting the security chip using the private key can be found in the foregoing. Figure 1 Step S104 will not be repeated here.
[0179] The S304 diagnostic interface chip verifies the MCU based on the first and third data.
[0180] In this embodiment, the security chip verifies the MCU based on the first data and the third data, as detailed above. Figure 1 The steps in S105 will not be repeated here.
[0181] The S305 diagnostic interface chip obtains target program information from the MCU and verifies the target program information.
[0182] In this embodiment, the security chip obtains target program information from the MCU and verifies the target program information. For details, please refer to the foregoing. Figure 1 Steps S106-S107 will not be repeated here.
[0183] In this embodiment, the diagnostic interface chip does not restrict the order of verifying the MCU and the target program information, that is, steps S304-S305 can be executed after step S301. In this embodiment, the specific execution order of steps S302-S303 and steps S304-S305 is not restricted.
[0184] S306. The diagnostic interface chip operates in the first mode when the target program information verification is successful and the first data and the third data verification are successful; the diagnostic interface chip operates in the second mode when the target program information verification fails or the first data and the third data verification fails.
[0185] In this embodiment, the security chip verifies the MCU and target program information, and instructs the security chip and MCU to execute different schemes under different verification results, as detailed above. Figure 1 The steps in S108 will not be repeated here.
[0186] Figure 7 This is a schematic diagram of a diagnostic interface chip unit provided in an embodiment of this application. See also... Figure 7 The diagnostic interface chip may include a decryption unit 301, a verification unit 302, an integrated circuit unit 303, a second storage unit 304, and a second communication unit 305.
[0187] Specifically, the decryption unit 301 is used to decrypt the second data obtained by the diagnostic interface chip.
[0188] Verification unit 302 is used to verify the MCU. By verifying the data before encryption and the data after decryption in the diagnostic interface chip, it verifies whether the data before encryption and the data after decryption are consistent, thereby determining whether the MCU that encrypted the data is an authorized MCU. Verification unit 302 is also used to verify the target program information. It calculates a first information digest for the program data in the target program information and verifies the first information digest against the digital signature in the target program information, thereby determining whether the target program information in the MCU has been tampered with.
[0189] The integrated circuit unit 303 is used to communicate with the MCU and is controlled by the verification result of the verification unit 302. If the verification result of the verification unit 302 is that the MCU passes the verification (i.e., the MCU belongs to the authorized MCU) and the target program information has not been tampered with, the integrated circuit unit 303 is enabled and the MCU can communicate with the vehicle through the integrated circuit unit; if the verification result of the verification unit 302 is that the MCU fails the verification or the target program information has been tampered with, the integrated circuit unit 303 is disabled.
[0190] The second storage unit 304 is used to store data generated, received, and acquired by the diagnostic interface chip, including random numbers generated by the diagnostic interface chip (first data), encrypted data received by the diagnostic interface chip (second data), and data decrypted and acquired by the diagnostic interface chip (third data). It is also used to store target program information acquired from the MCU. Furthermore, it is used to store the algorithms for generating the first data, decrypting the second data, and verifying the target program information, etc.
[0191] The second communication unit 305 is used to communicate with the MCU and also with the vehicle.
[0192] The second communication unit 305 includes a first communication interface and a second communication interface. The security chip in the diagnostic interface chip communicates with the MCU through the first communication interface, and the integrated circuit in the diagnostic interface chip communicates with the MCU through the second communication interface. The first communication interface includes wired and wireless communication, and the second communication interface includes both wired and wireless communication.
[0193] For example, the first communication interface includes wired communication such as SPI and UART, and the security chip can use SPI or UART to communicate with the security chip via wired communication in the second communication unit 305. The second communication interface includes GPIO wired communication, and the integrated circuit can use GPIO to communicate with the MCU via wired communication in the second communication unit 305. This application embodiment does not limit the specific communication method of the second communication unit 305.
[0194] The second communication unit 305 also includes an interface for communicating with the vehicle, such as an OBD interface.
[0195] In some embodiments, the diagnostic interface chip may further include an execution module, the execution module being based on, for example, Figure 6 The verification result obtained in step S306 is used to execute the corresponding method. For example, if the MCU verification passes, the diagnostic interface chip can enable the integrated circuit through the security chip, allowing the MCU to communicate with the vehicle via the integrated circuit; if the MCU verification fails, the diagnostic interface chip can interrupt the integrated circuit through the security chip, preventing the MCU from communicating with the vehicle.
[0196] The specific implementation methods of the corresponding steps described above will not be repeated in this application.
[0197] It is understood that the functional division between the various units illustrated in the embodiments of this application is merely illustrative and does not constitute a limitation on the function of the diagnostic interface chip. In other embodiments of this application, the diagnostic interface chip may also employ different units or combinations of multiple units to implement the function of the diagnostic interface chip compared to the above embodiments.
[0198] Example 4
[0199] Figure 8 This is a flowchart of another diagnostic device control method provided in an embodiment of this application. Figure 8 As shown, the method includes the following steps:
[0200] S401. After the diagnostic interface chip and MCU are powered on, the diagnostic interface chip and MCU communicate through the first communication interface.
[0201] In this embodiment, the diagnostic interface chip includes a security chip and an integrated circuit. After the diagnostic interface chip is powered on, the security chip is enabled, and the integrated circuit is disabled. For a detailed description of the diagnostic interface chip, please refer to the aforementioned S101 step, which will not be repeated here.
[0202] The S402 MCU sends a command, and the security chip generates the first data.
[0203] The specific description of the MCU instructing the security chip to generate the first data can be found in step S102 above, and will not be repeated here.
[0204] S403. The security chip sends the first data to the MCU. The MCU encrypts the first data using the public key to obtain the second data. The security chip then retrieves the second data returned by the MCU.
[0205] The specific description of how the MCU encrypts the first data to obtain the second data can be found in step S103 above, and will not be repeated here.
[0206] The S404 security chip decrypts the second data using a private key to obtain the third data.
[0207] The specific description of decrypting the second data of the security chip to obtain the third data can be found in step S104 above, and will not be repeated here.
[0208] S405. The security chip compares the first data with the third data to see if they match: if they match, the integrated circuit is enabled, and the security chip and MCU enter the first mode; if they do not match, the integrated circuit is disabled, and the security chip and MCU enter the second mode.
[0209] In the embodiments of this application, the first mode is a mode that allows the MCU to control the integrated circuit, and the second mode is a mode that disables the MCU from controlling the integrated circuit.
[0210] In this embodiment, if the first data and the third data are consistent, it indicates that the public key in the MCU corresponds to the private key in the security chip, and the verification of the MCU passes. Conversely, if the first data and the third data are inconsistent, it indicates that the public key in the MCU does not correspond to the private key in the security chip, and the verification of the MCU fails.
[0211] If the MCU verification passes, it means that the MCU is the original MCU of the diagnostic equipment or an authorized MCU. In this case, when the MCU communicates with the vehicle, it will not pose a safety hazard to the vehicle. Therefore, the security chip can allow the MCU to use integrated circuits. If the MCU verification fails, it means that the MCU is not the original MCU of the diagnostic equipment or an unauthorized MCU. In this case, when the MCU communicates with the vehicle, it may pose a safety hazard to the vehicle. Therefore, the security chip can prohibit the MCU from using integrated circuits to ensure vehicle safety.
[0212] In some embodiments, when the security chip operates in a first mode, it can perform operations such as encryption, decryption, signing, signature verification, and enabling or disabling integrated circuits to ensure the normal use of the diagnostic device. When the security chip operates in a second mode, it can restrict the use of the diagnostic device by disabling the MCU from using integrated circuits.
[0213] In this embodiment, after power-on, the security chip can send first data to the MCU, receive second data returned by the MCU, and verify the third data decrypted from the second data. If the verification passes, the security chip allows the MCU to use the integrated circuit; if the verification fails, it prohibits the MCU from using the integrated circuit.
[0214] Based on the above method, when the MCU in the diagnostic equipment is unauthorized, the security chip can restrict the use of the diagnostic equipment before the MCU communicates with the vehicle, thereby improving vehicle safety.
[0215] In some embodiments, allowing the MCU to use the integrated circuit can be achieved by the security chip responding to a control command sent by the MCU to enable the integrated circuit, thereby enabling the integrated circuit. Conversely, disabling the MCU from using the integrated circuit can be achieved by the security chip not responding to the control command sent by the MCU to enable the integrated circuit, i.e., not enabling the integrated circuit.
[0216] For example, when the diagnostic device is connected to the vehicle, the MCU can send a control command to the security chip to instruct the security chip to enable the integrated circuit. After receiving the control command, the security chip can enable the integrated circuit according to the control command in the first mode; in the second mode, it can discard the control command to keep the integrated circuit in a disabled state.
[0217] Figure 9This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 900 includes: a processor 901, a memory 902, a communication module 904, and a computer program 903 stored in the memory 902 and executable on the processor 901. When the processor 901 executes the computer program 903, it implements the steps described in the vehicle ECU flashing method embodiment.
[0218] For example, the computer program 903 described above can be divided into one or more units / modules, and the one or more units / modules are stored in the memory 902 and executed by the processor 901 to complete this application.
[0219] The aforementioned one or more units / modules may be a series of computer program instruction segments capable of performing specific functions. These instruction segments describe the execution process of the aforementioned computer program 903 in the aforementioned computer device 900. For example, the aforementioned computer program 903 may be used to generate random numbers in a diagnostic interface chip, obtain and encrypt the random numbers through the MCU, decrypt them through the diagnostic interface chip, compare the data before and after encryption to determine whether the MCU is an authorized MCU, etc. It may also be used to verify target program information. The specific functions or mechanisms have been described in the above embodiments and will not be repeated here.
[0220] Those skilled in the art will understand that Figure 9 This is merely an example of computer device 900 and does not constitute a limitation on computer device 900. It may include more or fewer components than shown, or combine certain components, or different components. For example, the computer device 900 described above may also include input / output devices, network access devices, buses, etc.
[0221] The processor 901 described above can be a central processing unit (CPU), or 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. The general-purpose processor can be a microprocessor or any conventional processor.
[0222] In some embodiments, the processor 901 may include one or more interfaces. Interfaces may include inter-integrated circuit (I2C) interfaces, UART interfaces, GPIO interfaces, and / or USB interfaces, etc.
[0223] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the computer device 900. In other embodiments of this application, the computer device 900 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0224] In some embodiments, the computer device 900 can connect to internal devices and modules through one or more interfaces. For example, the computer device 900 can connect a security chip to an MCU via an SPI and / or UART interface, and can also connect an integrated circuit to an MCU via a GPIO interface. The integrated circuit can convert the MCU's GPIO interface type to other interface types, serving as an interface converter for connecting external devices to the MCU.
[0225] The aforementioned memory 902 may be an internal storage unit of the computer device 900, such as a hard disk or RAM of the computer device 900. The aforementioned memory 902 may also include both internal storage units of the computer device 900 and external storage devices.
[0226] The aforementioned memory 902 is used to store the aforementioned computer program and other programs and data required by the aforementioned computer device 900. The aforementioned memory 902 can also be used to temporarily store data that has been output or will be output. For example, the aforementioned memory 902 can store first data generated by the diagnostic interface chip, second data obtained by encrypting the first data by the MCU, third data obtained by decrypting the second data by the diagnostic interface chip, target program information stored in the MCU, etc. It can also store the algorithm used by the diagnostic interface device to generate the first data, and the encryption algorithm used for asymmetric encryption between the diagnostic interface device and the MCU.
[0227] The communication module 904 can provide solutions for wireless communication applications on computer equipment 900, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc.
[0228] The communication module 904 may be one or more devices that integrate at least one communication processing module. The communication module 904 receives electromagnetic waves via an antenna, demodulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 901.
[0229] The communication module 904 can also receive the signal to be transmitted from the processor 901, frequency modulate it, amplify it, and then convert it into electromagnetic waves for radiation via the antenna.
[0230] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above equipment can be divided into different functional units or modules to complete all or part of the functions described above.
[0231] The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of software functional units.
[0232] In the embodiments of this application, the specific names of each functional unit and module are only for the purpose of distinguishing them from each other, and are not intended to limit the scope of protection of this application.
[0233] It should be understood that the steps in the above-described method embodiments provided in this application can be implemented by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
[0234] This application also provides a computer program product, which includes a computer program (also referred to as code or instructions) that, when run, causes a computer to execute the method performed by the vehicle inspection equipment in the above embodiments.
[0235] This application also provides a computer-readable storage medium storing a computer program (also referred to as code or instructions). When the computer program is run, it causes the computer to perform the method executed by the electronic device in any of the foregoing embodiments.
[0236] The various embodiments of this application can be combined arbitrarily to achieve different technical effects.
[0237] In the foregoing embodiments, implementation can be achieved, in whole or in part, through 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.
[0238] The computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0239] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0240] The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives).
[0241] Those skilled in the art will understand that implementing all or part of the processes in the foregoing embodiments can be accomplished by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the foregoing method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0242] In summary, the above description is merely an embodiment of the technical solution of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made according to the disclosure of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for controlling a diagnostic device, characterized in that, The diagnostic device includes a microcontroller unit (MCU), a security chip, and an integrated circuit. The integrated circuit enables communication between the MCU and the vehicle. The security chip controls the MCU to use the integrated circuit. The MCU stores a public key, and the security chip stores a private key. The method includes: The security chip generates first data, which is a random number. The security chip sends the first data to the MCU and obtains the second data returned by the MCU. The second data is obtained by the MCU encrypting the first data using the public key. The security chip decrypts the second data using the private key to obtain the third data; The security chip verifies the first data and the third data; The security chip obtains the target program information from the MCU; The security chip verifies the target program information; The security chip operates in a first mode when the target program information verification passes and the first data and the third data verification pass, and operates in a second mode when the target program information verification fails or the first data and the third data verification fails. In the first mode, the MCU is allowed to use the integrated circuit, and in the second mode, the MCU is prohibited from using the integrated circuit.
2. The method as described in claim 1, characterized in that, The security chip generates first data, including: After the security chip and the MCU are powered on and communication is established, the security chip receives the verification command sent by the MCU and generates the first data.
3. The method as described in claim 1, characterized in that, The public key includes an asymmetric encryption algorithm public key, the private key includes an asymmetric encryption algorithm private key, and the security chip verifies the first data and the third data, including: The security chip compares the first data with the third data; If the first data is the same as the third data, the security chip determines that the verification between the first data and the third data is successful. If the first data is different from the third data, the security chip determines that the verification between the first data and the third data has failed.
4. The method as described in claim 1, characterized in that, The security chip obtains target program information from the MCU, including: The security chip obtains target program information from the MCU after power-on; wherein, the integrated circuit is in a disabled state after the security chip is powered on.
5. The method as described in claim 4, characterized in that, The security chip verifies the target program information, including: When the target program information includes program data and digital signature, the security chip performs encryption operations on the program data to obtain a first message digest. The security chip verifies the digital signature against the first message digest; If the digital signature passes the verification with the first message digest, the security chip determines that the target program information has passed the verification. If the digital signature fails to verify the first message digest, the security chip determines that the target program information has failed to verify.
6. The method according to any one of claims 1-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 security chip, the control command being used to instruct the integrated circuit to be enabled; After receiving the control command, the security chip enables the integrated circuit 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 integrated circuit in a disabled state.
7. The method as described in claim 6, characterized in that, The integrated circuit includes a first switch module, a transceiver module, and a second switch module. The security chip enables the integrated circuit according to the control command, including: The security chip 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 method for controlling a diagnostic device, characterized in that, The diagnostic device includes a microcontroller unit (MCU), a security chip, and an integrated circuit. The integrated circuit enables communication between the MCU and the vehicle. The security chip controls the MCU to use the integrated circuit. The MCU stores a public key, and the security chip stores a private key. The method includes: The security chip generates first data, which is a random number. The security chip sends the first data to the MCU and obtains the second data returned by the MCU. The second data is obtained by the MCU encrypting the first data using the public key. The security chip decrypts the second data using the private key to obtain the third data; The security chip verifies the first data and the third data; The security chip operates in a first mode if the first data and the third data pass the verification, and operates in a second mode if the first data and the third data fail the verification. In the first mode, the MCU is allowed to use the integrated circuit, and in the second mode, the MCU is prohibited from using the integrated circuit.
9. A computer-readable storage medium storing computer instructions thereon, characterized in that, When executed by a processor, the computer instructions implement the method of any one of claims 1 to 7 or claim 8.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the method of any one of claims 1 to 7 or 8.
Citation Information
Patent Citations
Vehicle-mounted diagnostic system firmware protection method and system
CN113138775A
Remote diagnosis control system, method and device and electric vehicle
CN114675616A