In-vehicle gateway online identity authentication method, device and equipment and storage medium

By obtaining the serial number of the diagnostic tool and using the gateway and T-BOX to obtain the authentication key, the gateway, diagnostic tool, and electronic control unit are authenticated. This solves the problem of unencrypted vehicle authentication communication and identical communication keys, improving the level of communication security and authentication efficiency, and ensuring the safety of the driver and passengers.

CN118944956APending Publication Date: 2024-11-12DONGFENG MOTOR GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411184966.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

Existing vehicle authentication methods suffer from issues such as unencrypted communication, identical communication keys, and low security levels, threatening the lives and safety of drivers and passengers.

Method used

By obtaining the serial number of the diagnostic instrument, the gateway and T-BOX are used to obtain the authentication key from the TSP platform. The gateway, diagnostic instrument and electronic control unit are authenticated. Random number generation and HMAC function are used for data verification, and a session key is generated to protect communication.

Benefits of technology

It improves the security level of vehicle communication, enhances vehicle driving safety, ensures the safety of drivers and passengers, and increases the speed and efficiency of online identity authentication by the in-vehicle gateway.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118944956A_ABST
    Figure CN118944956A_ABST
Patent Text Reader

Abstract

The invention discloses an in-vehicle gateway online identity authentication method, device and equipment and a storage medium, and the method comprises the steps: obtaining a diagnostic instrument serial number of a diagnostic instrument, and obtaining an authentication key of the diagnostic instrument from a TSP platform through a gateway based on the diagnostic instrument serial number through T-BOX; authenticating the gateway and the diagnostic instrument according to the authentication key; performing identity authentication on the gateway and an electronic control unit (ECU) according to the authentication key; identity authentication between the gateway and the external device and between the gateway and the in-vehicle node can be completed, the communication safety level is improved, the vehicle driving safety is improved, the life safety of a driver and passengers is guaranteed, and the in-vehicle gateway online identity authentication speed and efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent networked vehicles, and in particular to an in-vehicle gateway online identity authentication method, device, equipment and storage medium. Background Art

[0002] With the popularization of smart connected cars, vehicle information security has received increasing attention. Hackers can tamper with system files in the controller without physically contacting the vehicle, thereby affecting the vehicle's driving and threatening the lives of the driver and passengers.

[0003] The existing vehicle identity authentication method is a UDS27 service authentication mechanism based on a session challenge, which has the defects of unencrypted communication and the same key for each communication, which has a low security level. Summary of the invention

[0004] The main purpose of the present invention is to provide an in-vehicle gateway online identity authentication method, device, equipment and storage medium, aiming to solve the technical problems in the prior art that vehicle identity authentication communication is not encrypted, the communication keys are the same, and the security level is not high.

[0005] In a first aspect, the present invention provides an in-vehicle gateway online identity authentication method, the in-vehicle gateway online identity authentication method comprising the following steps:

[0006] Obtain the diagnostic instrument serial number of the diagnostic instrument, and obtain the authentication key of the diagnostic instrument from the TSP platform through the gateway through the T-BOX based on the diagnostic instrument serial number;

[0007] Authenticating the gateway and the diagnostic instrument according to the authentication key;

[0008] The gateway and the electronic control unit ECU are authenticated according to the authentication key.

[0009] Optionally, the step of obtaining a diagnostic instrument serial number of the diagnostic instrument, and obtaining an authentication key of the diagnostic instrument from a TSP platform through a gateway via a T-BOX based on the diagnostic instrument serial number, includes:

[0010] After receiving the authentication application initiated by the diagnostic instrument, receiving the diagnostic instrument serial number sent by the diagnostic instrument through the gateway;

[0011] determining whether the gateway has saved the current authentication key of the diagnostic instrument;

[0012] When the gateway has saved the current authentication key, entering an authentication challenge mode;

[0013] When the gateway does not store the current authentication key, the gateway obtains the authentication key of the diagnostic instrument from the TSP platform through the T-BOX based on the serial number of the diagnostic instrument.

[0014] Optionally, when the gateway does not save the current authentication key, obtaining the authentication key of the diagnostic instrument from the TSP platform through the gateway via the T-BOX based on the diagnostic instrument serial number includes:

[0015] When the gateway does not store the current authentication key, obtaining the gateway serial number of the gateway, and sending the gateway serial number and the diagnostic instrument serial number to the TSP platform via T-BOX;

[0016] Determine, through the TSP platform, whether the gateway has the authority to obtain the key;

[0017] When the gateway has permission, the authentication key of the diagnostic instrument is obtained through the TSP platform, and the authentication key is sent to the gateway.

[0018] Optionally, authenticating the gateway and the diagnostic instrument according to the authentication key includes:

[0019] When the gateway has saved the authentication key, sending an authentication request instruction through the diagnostic instrument, and generating a first random number and sending it to the gateway;

[0020] generating a second random number by the grid in response to the authentication request instruction, and feeding back the second random number to the diagnostic instrument;

[0021] After the diagnostic instrument receives the second random number, it generates first authentication data using an algorithm in a security authentication module, and sends the first authentication data to the gateway;

[0022] After the gateway receives the first authentication data, the first authentication data is verified by the gateway, a preset authentication algorithm in the security authentication module is used to generate second authentication data, and the authentication identifier, the second authentication data and a third random number ciphertext are fed back to the diagnostic instrument;

[0023] Verifying the second authentication data by the diagnostic instrument, and decrypting the third random number ciphertext after verification to obtain the third random number;

[0024] The grid and the diagnostic instrument use the third random number as a session key, protect the communication message by the session key, and take the high 2 bytes of the first random number and the second random number as a calculator;

[0025] The diagnostic instrument periodically sends a session state maintenance message, performs MAC calculation on the session state maintenance message, wherein the message content of the session state maintenance message includes a counter, and each time a message is sent, the counter increases by 1;

[0026] When the gateway receives the session state maintenance message, the third random number is used to verify the MAC value, and the current session is stopped after the verification fails.

[0027] Optionally, the performing identity authentication on the gateway and the electronic control unit ECU according to the authentication key includes:

[0028] Two key matrices are randomly generated by the gateway, and the key matrices are subjected to a preset derivation algorithm to generate a target session key;

[0029] After receiving the response from the CAN node, the gateway performs data verification according to the target session key, and performs identity authentication with the electronic control unit ECU through the gateway according to the authentication key.

[0030] Optionally, the randomly generating two key matrices by the gateway and applying a preset derivation algorithm to the key matrices to generate a target session key includes:

[0031] Acquiring a security level of an electronic control unit ECU, randomly generating two key matrices with different security levels through the gateway according to the security level, and storing the key matrices during a working cycle;

[0032] The key matrix is ​​subjected to a preset derivation algorithm to generate a target session key.

[0033] Optionally, after receiving the response from the CAN node, performing data verification by the gateway according to the target session key, and performing identity authentication with an electronic control unit ECU by the gateway according to the authentication key, comprises:

[0034] Acquire a unique node identifier of a frame data segment of a broadcast frame, and determine a CAN node according to the unique node identifier;

[0035] Generate a challenge ciphertext corresponding to the CAN node, and after receiving the challenge ciphertext, the CAN node decrypts the challenge ciphertext to obtain a target random number;

[0036] Processing the target random number according to the HMAC function and the symmetric encryption algorithm function to obtain a response frame corresponding to the target session key;

[0037] The response frame is sent to the gateway through the CAN node, and after the gateway receives the response frame, the corresponding verification data is generated according to the HMAC function;

[0038] Verify the consistency of the response frame and the verification data, and if the verification passes, determine that the two-way authentication process between the current CAN node and the gateway is successful;

[0039] The CAN node sends an authentication completion confirmation frame to the gateway node, and after the gateway receives the confirmation frames from all key nodes, it sends a communication start broadcast frame.

[0040] In a second aspect, in order to achieve the above-mentioned purpose, the present invention further proposes an in-vehicle gateway online identity authentication device, the in-vehicle gateway online identity authentication device comprising:

[0041] A key acquisition module, used to obtain the diagnostic instrument serial number of the diagnostic instrument, and obtain the authentication key of the diagnostic instrument from the TSP platform through the gateway through the T-BOX based on the diagnostic instrument serial number;

[0042] A diagnostic instrument authentication module, used for authenticating the gateway and the diagnostic instrument according to the authentication key;

[0043] The ECU authentication module is used to perform identity authentication on the gateway and the electronic control unit ECU according to the authentication key.

[0044] In the third aspect, in order to achieve the above-mentioned purpose, the present invention also proposes an in-vehicle gateway online identity authentication device, which includes: a memory, a processor, and an in-vehicle gateway online identity authentication program stored in the memory and executable on the processor, and the in-vehicle gateway online identity authentication program is configured to implement the steps of the in-vehicle gateway online identity authentication method as described above.

[0045] In a fourth aspect, in order to achieve the above-mentioned purpose, the present invention also proposes a storage medium, on which an in-vehicle gateway online identity authentication program is stored. When the in-vehicle gateway online identity authentication program is executed by a processor, the steps of the in-vehicle gateway online identity authentication method as described above are implemented.

[0046] The in-vehicle gateway online identity authentication method proposed in the present invention obtains the diagnostic instrument serial number of the diagnostic instrument, and obtains the authentication key of the diagnostic instrument from the TSP platform through the gateway through the T-BOX based on the diagnostic instrument serial number; authenticates the gateway and the diagnostic instrument according to the authentication key; authenticates the gateway and the electronic control unit ECU according to the authentication key; can complete the identity authentication of the gateway and the external device, the gateway and the in-vehicle node, improves the communication security level, enhances the safety of vehicle driving, ensures the life safety of the driver and passengers, and improves the speed and efficiency of the in-vehicle gateway online identity authentication. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;

[0048] Figure 2 It is a flowchart of the first embodiment of the in-vehicle gateway online identity authentication method of the present invention;

[0049] Figure 3 It is a flow chart of a second embodiment of the in-vehicle gateway online identity authentication method of the present invention;

[0050] Figure 4 It is a flowchart of a third embodiment of the in-vehicle gateway online identity authentication method of the present invention;

[0051] Figure 5 It is a flowchart of a fourth embodiment of the in-vehicle gateway online identity authentication method of the present invention;

[0052] Figure 6 It is a schematic diagram of the diagnostic instrument gateway authentication process in the in-vehicle gateway online identity authentication method of the present invention;

[0053] Figure 7 It is a flowchart of a fifth embodiment of the in-vehicle gateway online identity authentication method of the present invention;

[0054] Figure 8 It is a schematic diagram of the ECU authentication process based on the gateway in the in-vehicle gateway online identity authentication method of the present invention;

[0055] Fig. 9 This is a functional module diagram of the first embodiment of the in-vehicle gateway online identity authentication device of the present invention.

[0056] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0057] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0058] The solution of the embodiment of the present invention is mainly: by obtaining the diagnostic instrument serial number of the diagnostic instrument, the gateway obtains the authentication key of the diagnostic instrument from the TSP platform through the T-BOX based on the diagnostic instrument serial number; the gateway and the diagnostic instrument are authenticated according to the authentication key; the gateway and the electronic control unit ECU are authenticated according to the authentication key; the identity authentication of the gateway and the external device, the gateway and the in-vehicle node can be completed, the communication security level is improved, the vehicle driving safety is improved, the life safety of the driver and passengers is ensured, the speed and efficiency of the in-vehicle gateway online identity authentication is improved, and the technical problems in the prior art that the vehicle identity authentication communication is not encrypted, the communication key is the same, and the security level is not high.

[0059] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.

[0060] like Figure 1 As shown, the device may include: a processor 1001, such as a CPU, a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (Non-Volatile Memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0061] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0062] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating device, a network communication module, a user interface module, and an in-vehicle gateway online identity authentication program.

[0063] The device of the present invention calls the in-vehicle gateway online identity authentication program stored in the memory 1005 through the processor 1001, and performs the following operations:

[0064] Obtain the diagnostic instrument serial number of the diagnostic instrument, and obtain the authentication key of the diagnostic instrument from the TSP platform through the gateway through the T-BOX based on the diagnostic instrument serial number;

[0065] Authenticating the gateway and the diagnostic instrument according to the authentication key;

[0066] The gateway and the electronic control unit ECU are authenticated according to the authentication key.

[0067] The device of the present invention calls the in-vehicle gateway online identity authentication program stored in the memory 1005 through the processor 1001, and also performs the following operations:

[0068] After receiving the authentication application initiated by the diagnostic instrument, receiving the diagnostic instrument serial number sent by the diagnostic instrument through the gateway;

[0069] determining whether the gateway has saved the current authentication key of the diagnostic instrument;

[0070] When the gateway has saved the current authentication key, entering an authentication challenge mode;

[0071] When the gateway does not store the current authentication key, the gateway obtains the authentication key of the diagnostic instrument from the TSP platform through the T-BOX based on the serial number of the diagnostic instrument.

[0072] The device of the present invention calls the in-vehicle gateway online identity authentication program stored in the memory 1005 through the processor 1001, and also performs the following operations:

[0073] When the gateway does not store the current authentication key, obtaining the gateway serial number of the gateway, and sending the gateway serial number and the diagnostic instrument serial number to the TSP platform via T-BOX;

[0074] Determine, through the TSP platform, whether the gateway has the authority to obtain the key;

[0075] When the gateway has permission, the authentication key of the diagnostic instrument is obtained through the TSP platform, and the authentication key is sent to the gateway.

[0076] The device of the present invention calls the in-vehicle gateway online identity authentication program stored in the memory 1005 through the processor 1001, and also performs the following operations:

[0077] When the gateway has saved the authentication key, sending an authentication request instruction through the diagnostic instrument, and generating a first random number and sending it to the gateway;

[0078] generating a second random number by the grid in response to the authentication request instruction, and feeding back the second random number to the diagnostic instrument;

[0079] After the diagnostic instrument receives the second random number, it generates first authentication data using an algorithm in a security authentication module, and sends the first authentication data to the gateway;

[0080] After the gateway receives the first authentication data, the first authentication data is verified by the gateway, a preset authentication algorithm in the security authentication module is used to generate second authentication data, and the authentication identifier, the second authentication data and a third random number ciphertext are fed back to the diagnostic instrument;

[0081] Verifying the second authentication data by the diagnostic instrument, and decrypting the third random number ciphertext after verification to obtain the third random number;

[0082] The grid and the diagnostic instrument use the third random number as a session key, protect the communication message by the session key, and take the high 2 bytes of the first random number and the second random number as a calculator;

[0083] The diagnostic instrument periodically sends a session state maintenance message, performs MAC calculation on the session state maintenance message, wherein the message content of the session state maintenance message includes a counter, and each time a message is sent, the counter increases by 1;

[0084] When the gateway receives the session state maintenance message, the third random number is used to verify the MAC value, and the current session is stopped after the verification fails.

[0085] The device of the present invention calls the in-vehicle gateway online identity authentication program stored in the memory 1005 through the processor 1001, and also performs the following operations:

[0086] Two key matrices are randomly generated by the gateway, and the key matrices are subjected to a preset derivation algorithm to generate a target session key;

[0087] After receiving the response from the CAN node, the gateway performs data verification according to the target session key, and performs identity authentication with the electronic control unit ECU through the gateway according to the authentication key.

[0088] The device of the present invention calls the in-vehicle gateway online identity authentication program stored in the memory 1005 through the processor 1001, and also performs the following operations:

[0089] Acquiring a security level of an electronic control unit ECU, randomly generating two key matrices with different security levels through the gateway according to the security level, and storing the key matrices during a working cycle;

[0090] The key matrix is ​​subjected to a preset derivation algorithm to generate a target session key.

[0091] The device of the present invention calls the in-vehicle gateway online identity authentication program stored in the memory 1005 through the processor 1001, and also performs the following operations:

[0092] Acquire a unique node identifier of a frame data segment of a broadcast frame, and determine a CAN node according to the unique node identifier;

[0093] Generate a challenge ciphertext corresponding to the CAN node, and after receiving the challenge ciphertext, the CAN node decrypts the challenge ciphertext to obtain a target random number;

[0094] Processing the target random number according to the HMAC function and the symmetric encryption algorithm function to obtain a response frame corresponding to the target session key;

[0095] The response frame is sent to the gateway through the CAN node, and after the gateway receives the response frame, the corresponding verification data is generated according to the HMAC function;

[0096] Verify the consistency of the response frame and the verification data, and if the verification passes, determine that the two-way authentication process between the current CAN node and the gateway is successful;

[0097] The CAN node sends an authentication completion confirmation frame to the gateway node, and after the gateway receives the confirmation frames from all key nodes, it sends a communication start broadcast frame.

[0098] This embodiment adopts the above scheme, by obtaining the diagnostic instrument serial number of the diagnostic instrument, and obtaining the authentication key of the diagnostic instrument from the TSP platform through the gateway through T-BOX based on the diagnostic instrument serial number; the gateway and the diagnostic instrument are authenticated according to the authentication key; the gateway and the electronic control unit ECU are authenticated according to the authentication key; the identity authentication between the gateway and the external device, and the gateway and the in-vehicle node can be completed, thereby improving the communication security level, enhancing the safety of vehicle driving, ensuring the life safety of the driver and passengers, and improving the speed and efficiency of the in-vehicle gateway online identity authentication.

[0099] Based on the above hardware structure, an embodiment of the in-vehicle gateway online identity authentication method of the present invention is proposed.

[0100] Reference Figure 2 , Figure 2 This is a flow chart of the first embodiment of the in-vehicle gateway online identity authentication method of the present invention.

[0101] In a first embodiment, the in-vehicle gateway online identity authentication method comprises the following steps:

[0102] Step S10: Obtain the diagnostic instrument serial number of the diagnostic instrument, and obtain the authentication key of the diagnostic instrument from the TSP platform through the gateway via the T-BOX based on the diagnostic instrument serial number.

[0103] It should be noted that after obtaining the diagnostic instrument serial number of the diagnostic instrument, the gateway can obtain the authentication key of the diagnostic instrument through the telematics service provider (TSP) platform based on the diagnostic serial number.

[0104] In the specific implementation, the diagnostic instrument initiates an authentication application and sends its own serial number to the gateway; based on the serial number of the diagnostic instrument, the gateway obtains the authentication key of the diagnostic instrument from the TSP platform through the intelligent vehicle terminal (TelematicBOX, T-BOX).

[0105] Step S20: authenticating the gateway and the diagnostic instrument according to the authentication key.

[0106] It should be understood that the gateway and the diagnostic instrument can be authenticated according to the authentication key.

[0107] Step S30: authenticating the gateway and the electronic control unit ECU according to the authentication key.

[0108] It can be understood that the gateway and the electronic control unit (ECU) can be authenticated according to the authentication key.

[0109] This embodiment adopts the above scheme, by obtaining the diagnostic instrument serial number of the diagnostic instrument, and obtaining the authentication key of the diagnostic instrument from the TSP platform through the gateway through T-BOX based on the diagnostic instrument serial number; the gateway and the diagnostic instrument are authenticated according to the authentication key; the gateway and the electronic control unit ECU are authenticated according to the authentication key; the identity authentication between the gateway and the external device, and the gateway and the in-vehicle node can be completed, thereby improving the communication security level, enhancing the safety of vehicle driving, ensuring the life safety of the driver and passengers, and improving the speed and efficiency of the in-vehicle gateway online identity authentication.

[0110] Further, Figure 3 FIG. 1 is a flow chart of a second embodiment of the in-vehicle gateway online identity authentication method of the present invention. Figure 3 As shown, a second embodiment of the in-vehicle gateway online identity authentication method of the present invention is proposed based on the first embodiment. In this embodiment, the step S10 specifically includes the following steps:

[0111] Step S11: After receiving the authentication application initiated by the diagnostic instrument, receiving the diagnostic instrument serial number sent by the diagnostic instrument through the gateway.

[0112] It should be noted that after receiving the authentication application initiated by the diagnostic instrument, the serial number of the diagnostic instrument itself can be sent to the gateway, that is, the diagnostic instrument serial number sent by the diagnostic instrument is received through the gateway.

[0113] Step S12: determine whether the gateway has saved the current authentication key of the diagnostic instrument.

[0114] It is understandable that it is determined whether the gateway has saved the current authentication key of the diagnostic instrument.

[0115] Step S13: When the gateway has saved the current authentication key, enter the authentication challenge mode.

[0116] It should be understood that the gateway checks whether the authentication key of the diagnostic instrument is saved. If not, it applies for the authentication key of the diagnostic instrument. If so, it enters the authentication challenge mode.

[0117] Step S14: when the gateway does not save the current authentication key, the gateway obtains the authentication key of the diagnostic instrument from the TSP platform through the T-BOX based on the serial number of the diagnostic instrument.

[0118] It is understandable that when the gateway does not save the current authentication key, the gateway can obtain the authentication key of the diagnostic instrument from the TSP platform through the T-BOX based on the serial number of the diagnostic instrument.

[0119] Through the above scheme, this embodiment receives the diagnostic instrument serial number sent by the diagnostic instrument through the gateway after receiving the authentication application initiated by the diagnostic instrument; determines whether the gateway has saved the current authentication key of the diagnostic instrument; enters the authentication challenge mode when the gateway has saved the current authentication key; and obtains the authentication key of the diagnostic instrument from the TSP platform through the gateway through the T-BOX based on the diagnostic instrument serial number when the gateway has not saved the current authentication key, thereby completing the identity authentication between the gateway and the external device, and between the gateway and the node in the vehicle, thereby improving the communication security level.

[0120] Further, Figure 4 FIG. 1 is a flow chart of a third embodiment of the in-vehicle gateway online identity authentication method of the present invention. Figure 4 As shown, a third embodiment of the in-vehicle gateway online identity authentication method of the present invention is proposed based on the second embodiment. In this embodiment, the step S14 specifically includes the following steps:

[0121] Step S141: when the gateway does not save the current authentication key, obtain the gateway serial number of the gateway, and send the gateway serial number and the diagnostic instrument serial number to the TSP platform via T-BOX.

[0122] It should be noted that when the gateway does not save the current authentication key, the gateway serial number of the gateway can be obtained, and the gateway serial number and the diagnostic instrument serial number can be sent to the TSP platform through T-BOX.

[0123] Step S142: Determine, through the TSP platform, whether the gateway has the authority to obtain the key.

[0124] It is understandable that whether the gateway has the authority to obtain the key can be determined through the TSP platform.

[0125] In the specific implementation, the gateway applies for the authentication key of the diagnostic instrument by initiating a request to the TSP to obtain the authentication key of the diagnostic instrument, sending the serial number of the gateway and the diagnostic instrument to the TSP, and the TSP inquires whether the gateway has the authority to obtain the authentication key of the diagnostic instrument.

[0126] Step S143: when the gateway has permission, obtain the authentication key of the diagnostic instrument through the TSP platform, and send the authentication key to the gateway.

[0127] It should be understood that when the gateway has permission, the authentication key of the diagnostic instrument can be obtained through the TSP platform, and the authentication key can be sent to the gateway.

[0128] In the specific implementation, if there is permission, the corresponding authentication key is queried and sent to the gateway; the gateway determines the returned result, and if the returned result is successful, the authentication key is saved; the gateway and the external diagnostic instrument enter the identity authentication process.

[0129] This embodiment adopts the above scheme, by obtaining the gateway serial number of the gateway when the gateway does not save the current authentication key, and sending the gateway serial number and the diagnostic instrument serial number to the TSP platform through T-BOX; judging by the TSP platform whether the gateway has the authority to obtain the key; when the gateway has the authority, obtaining the authentication key of the diagnostic instrument through the TSP platform, and sending the authentication key to the gateway, and obtaining the authentication key of the diagnostic instrument from the TSP platform through T-BOX based on the diagnostic instrument serial number by the gateway, thereby improving the speed and efficiency of the online identity authentication of the in-vehicle gateway.

[0130] Further, Figure 5 FIG. 4 is a flow chart of a fourth embodiment of an in-vehicle gateway online identity authentication method according to the present invention. Figure 5As shown, a fourth embodiment of the in-vehicle gateway online identity authentication method of the present invention is proposed based on the first embodiment. In this embodiment, the step S20 specifically includes the following steps:

[0131] Step S21: When the gateway has saved the authentication key, send an authentication request instruction through the diagnostic instrument, and generate a first random number and send it to the gateway.

[0132] It should be noted that when the gateway has saved the authentication key, the diagnostic instrument sends an authentication request instruction and generates a first random number and sends it to the gateway, that is, the external device (diagnostic instrument) sends an authentication request instruction and generates a random number R1 and sends it to the gateway.

[0133] Step S22: generating a second random number through the grid in response to the authentication request instruction, and feeding back the second random number to the diagnostic instrument.

[0134] It is understandable that after receiving the request, the gateway generates a random number R2 and feeds back the random number R2 to the external device, that is, the grid responds to the request authentication instruction to generate a second random number and feeds back the second random number to the diagnostic instrument.

[0135] Step S23: After the diagnostic instrument receives the second random number, it generates first authentication data using an algorithm in a security authentication module, and sends the first authentication data to the gateway.

[0136] It should be understood that after the external device receives the random number R2, it can use the algorithm in the security authentication module to generate authentication data A1, and send the authentication data A1 to the gateway. That is, after the diagnostic instrument receives the second random number, it uses the algorithm in the security authentication module to generate the first authentication data, and sends the first authentication data to the gateway.

[0137] Step S24: After the gateway receives the first authentication data, the gateway verifies the first authentication data, generates second authentication data using a preset authentication algorithm in the security authentication module, and feeds back the authentication identifier, the second authentication data and a third random number ciphertext to the diagnostic instrument.

[0138] It can be understood that after receiving the message, the gateway performs verification A1, uses the algorithm in the security authentication module to generate authentication data A2, and then feeds back the authentication identifier, authentication data A2, and random number R3 ciphertext to the external device. That is, after the gateway receives the first authentication data, the first authentication data can be verified by the gateway, and the second authentication data can be generated using the preset authentication algorithm in the security authentication module, and the authentication identifier, the second authentication data and the third random number ciphertext are fed back to the diagnostic instrument.

[0139] Step S25: verify the second authentication data through the diagnostic instrument, and decrypt the third random number ciphertext after the verification is passed to obtain the third random number.

[0140] It should be understood that after receiving the message, the external device performs verification A2, and decrypts the ciphertext after the verification is passed, that is, the second authentication data is verified by the diagnostic instrument, and the third random number ciphertext is decrypted after the verification is passed to obtain the third random number.

[0141] Step S26: the grid and the diagnostic instrument use the third random number as a session key, protect the communication message through the session key, and take the high 2 bytes of the first random number and the second random number as a calculator.

[0142] It can be understood that after the random number R3 is verified, the gateway and the diagnostic instrument use the random number R3 as the session key to protect subsequent communication messages, and the high 2 bytes of R1|R2 are used as counters, that is, the grid and the diagnostic instrument use the third random number as the session key, protect the communication messages through the session key, and take the high 2 bytes of the first random number and the second random number as counters.

[0143] Step S27: Periodically send session state maintenance messages through the diagnostic instrument, perform MAC calculation on the session state maintenance messages, the message content of the session state maintenance messages includes a counter, and the counter increases by 1 each time a message is sent.

[0144] It should be understood that the external device periodically sends session state maintenance messages and performs MAC calculation on the messages. The key is a random number R3. The message content includes a counter. Each time a message is sent, the counter increases by 1. That is, the diagnostic instrument periodically sends session state maintenance messages, performs MAC calculation on the session state maintenance messages, and the message content of the session state maintenance messages includes a counter. Each time a message is sent, the counter increases by 1.

[0145] Step S28: When the gateway receives the session state maintenance message, the third random number is used to verify the MAC value, and the current session is stopped if the verification fails.

[0146] It can be understood that when the gateway receives the state maintenance message, it uses the random number R3 to verify the MAC value, and stops the session if it fails. That is, when the gateway receives the session state maintenance message, it uses the third random number to verify the MAC value, and stops the current session after the verification fails.

[0147] In the specific implementation, the message data encryption algorithm can be replaced according to the actual development situation. In response to the inspection of the national standard vehicle management office, a white list is specially set up to not perform authentication, encryption, verification and other operations on message data such as 7E0, 7E8, and 7DF.

[0148] See also Figure 6 , Figure 6 FIG. 1 is a schematic diagram of the diagnostic instrument gateway authentication process in the in-vehicle gateway online identity authentication method of the present invention, such as Figure 6 As shown, 1) the external device sends a request authentication instruction and generates a random number R1 and sends it to the gateway;

[0149] 2) After receiving the request, the gateway generates a random number R2 and feeds back the random number R2 to the external device.

[0150] 3) After receiving the random number R2, the external device generates authentication data A1 using the algorithm in the security authentication module and sends the authentication data A1 to the gateway.

[0151] 4) After receiving the message, the gateway performs verification A1, uses the algorithm in the security authentication module to generate authentication data A2, and then feeds back the authentication identifier, authentication data A2, and random number R3 ciphertext to the external device.

[0152] 5) After receiving the message, the external device performs verification A2. After the verification is passed, the ciphertext is decrypted to obtain the random number R3. After the verification is passed, the gateway and the diagnostic instrument use the random number R3 as the session key to protect subsequent communication messages, and R1|R2 takes the high 2 bytes as the counter.

[0153] 6) The external device periodically sends a session state maintenance message and performs MAC calculation on the message. The key is a random number R3. The message content contains a counter. Each time a message is sent, the counter increases by 1.

[0154] 7) The gateway receives the state maintenance message and uses the random number R3 to verify the MAC value. If it fails, the session is terminated.

[0155] Note: The message data encryption algorithm can be changed according to the actual development situation; in response to the inspection of the national standard vehicle management office, a white list is specially set up, and no authentication, encryption, verification and other operations are performed on message data such as 7E0, 7E8, and 7DF.

[0156] 8) Before authentication, the gateway obtains the authentication password of the diagnostic instrument from the TSP platform through T-BOX based on the serial number of the diagnostic instrument. In order to ensure the security of the authentication key, the authentication key of the diagnostic instrument adopts a one-car-one-key method; the identity authentication process between the diagnostic instrument and the gateway is basically the same as that of the ECU. The main difference is that the authentication is initiated by the diagnostic instrument. After the authentication is completed, the gateway sends the key matrix and TripCounter of the corresponding level to the diagnostic instrument. The diagnostic instrument realizes secure communication with the ECU based on this key matrix.

[0157] This embodiment adopts the above scheme, when the gateway has saved the authentication key, sends a request authentication instruction through the diagnostic instrument, generates a first random number and sends it to the gateway; generates a second random number through the grid in response to the request authentication instruction, and feeds back the second random number to the diagnostic instrument; after the diagnostic instrument receives the second random number, it generates first authentication data using the algorithm in the security authentication module, and sends the first authentication data to the gateway; after the gateway receives the first authentication data, it verifies the first authentication data through the gateway, generates second authentication data using the preset authentication algorithm in the security authentication module, and feeds back the authentication identifier, the second authentication data and the third random number ciphertext to the diagnostic instrument; the diagnostic instrument verifies the second authentication data through the gateway, generates the second authentication data using the preset authentication algorithm in the security authentication module, and feeds back the authentication identifier, the second authentication data and the third random number ciphertext to the diagnostic instrument; The data is verified, and after the verification is passed, the third random number ciphertext is decrypted to obtain the third random number; the grid and the diagnostic instrument use the third random number as a session key, and protect the communication message through the session key, and take the high 2 bytes of the first random number and the second random number as a calculator; the diagnostic instrument periodically sends a session state maintenance message, and performs MAC calculation on the session state maintenance message. The message content of the session state maintenance message includes a counter, and the calculator increases by 1 each time a message is sent; when the gateway receives the session state maintenance message, the third random number is used to verify the MAC value, and the current session is stopped after the verification fails, which can complete the identity authentication between the gateway and the external device, and the gateway and the node in the vehicle, thereby improving the communication security level.

[0158] Further, Figure 7 FIG. 5 is a flow chart of a fifth embodiment of an in-vehicle gateway online identity authentication method according to the present invention. Figure 7 As shown, a fifth embodiment of the in-vehicle gateway online identity authentication method of the present invention is proposed based on the first embodiment. In this embodiment, the step S30 specifically includes the following steps:

[0159] Step S31: two key matrices are randomly generated by the gateway, and the key matrices are subjected to a preset derivation algorithm to generate a target session key.

[0160] It should be noted that two key matrices are randomly generated by the gateway, and the key matrices can be used to generate a target session key through a preset derivation algorithm.

[0161] Step S32: after receiving the response from the CAN node, the gateway performs data verification according to the target session key, and performs identity authentication with the electronic control unit ECU through the gateway according to the authentication key.

[0162] It should be understood that after receiving a response from a controller area network (CAN) node, data verification can be performed through the gateway according to the target session key, and identity authentication can be performed between the gateway and the electronic control unit ECU according to the authentication key.

[0163] Furthermore, the step S31 specifically includes the following steps:

[0164] Acquiring a security level of an electronic control unit ECU, randomly generating two key matrices with different security levels through the gateway according to the security level, and storing the key matrices during a working cycle;

[0165] The key matrix is ​​subjected to a preset derivation algorithm to generate a target session key.

[0166] It can be understood that after obtaining the security level of the electronic control unit ECU, two key matrices with different security levels can be randomly generated through the gateway according to the security level, and the key matrices can be saved during a working cycle; the key matrices can be used to generate the target session key through a pre-set preset derivation algorithm.

[0167] Further, after receiving the response from the CAN node, the step performs data verification through the gateway according to the target session key, and performs identity authentication with the electronic control unit ECU through the gateway according to the authentication key, specifically including the following steps:

[0168] Acquire a unique node identifier of a frame data segment of a broadcast frame, and determine a CAN node according to the unique node identifier;

[0169] Generate a challenge ciphertext corresponding to the CAN node, and after receiving the challenge ciphertext, the CAN node decrypts the challenge ciphertext to obtain a target random number;

[0170] Processing the target random number according to the HMAC function and the symmetric encryption algorithm function to obtain a response frame corresponding to the target session key;

[0171] The response frame is sent to the gateway through the CAN node, and after the gateway receives the response frame, the corresponding verification data is generated according to the HMAC function;

[0172] Verify the consistency of the response frame and the verification data, and if the verification passes, determine that the two-way authentication process between the current CAN node and the gateway is successful;

[0173] The CAN node sends an authentication completion confirmation frame to the gateway node, and after the gateway receives the confirmation frames from all key nodes, it sends a communication start broadcast frame.

[0174] In the specific implementation, see Figure 8 , Figure 8 FIG. 1 is a schematic diagram of the ECU authentication process based on the gateway in the in-vehicle gateway online identity authentication method of the present invention, as shown in FIG. Figure 8 As shown, this process implements ECU identity authentication based on the authentication key and negotiates a communication key matrix at the same time.

[0175] The key matrix generates a session key through a derivation algorithm, which is used for secure data transmission between ECUs when the car is running; the key matrix is ​​divided into a high security level matrix (KeyMatr1xH) and a normal security level matrix (KeyMatr1xL) based on the ECU security level, both of which are randomly generated by the gateway. During a working cycle (from car startup to shutdown), the gateway needs to save the generated key matrix.

[0176] Among them, HM(x) is the HMAC function, and E(x) is the symmetric encryption algorithm function. At the beginning of startup, the gateway first randomly generates two key matrices, which are used to derive the session key. First, the CAN gateway sends a broadcast frame with frame ID1. The frame data segment contains the unique node identification Node1 of the CAN gateway. This frame is the startup frame for notifying the authentication process, telling the physical nodes in the network that the gateway authentication is ready and can start authentication; after each node receives frame ID1, it saves the node identification data Node1 of the gateway, and then sends an authentication request to the gateway. The data segment in the request frame is the unique node representation Node2 of the physical node; after the gateway receives the node's request frame, it requests to save the node identification Node2, and immediately generates a random number R1, and uses the authentication key KeyA corresponding to the node Node2 to encrypt R1 to generate a challenge ciphertext, and sends it to the requesting node for challenge; after the node receives the challenge frame from the gateway, it first performs Decryption obtains the random number R1, and then uses the pre-agreed HMAC function H(x) to process the data (R1||Node2) to generate a response frame, and returns it to the gateway node for response; then the node generates a random number R2, encrypts R2 with the authentication key KeyA to generate a reverse challenge frame, and sends it to the CAN gateway for reverse challenge; after the gateway receives the node's response frame, it first generates verification data through the HMAC function, and then verifies the consistency of the response frame and the verification data result. If the verification passes, the gateway receives the node's reverse challenge, and generates a reverse response frame for the data (R2||Node1) according to the pre-agreed HMAC function, and performs a reverse response to the node, otherwise the verification fails, the authentication process is terminated, and the abnormal information is recorded.

[0177] If the node receives a response frame from the gateway, it means that the one-way authentication of the gateway has passed, and then it starts to process the response frame of the gateway. Similarly, the node first generates verification data according to the HMAC function, and then verifies the consistency of the response frame of the gateway and the verification data. If the verification passes, it means that the two-way authentication process between the node and the CAN gateway is successfully completed. At this time, the node sends an authentication completion confirmation frame to the gateway node; after the gateway receives the confirmation frame from the node, it randomly generates a key matrix, combines the key matrix with TripCounter, and encrypts it with KeyA+R1+R2 as the key and sends it to the node. The node decrypts and saves TripCounter; when the gateway receives the confirmation frames of all key nodes and the negotiation process with all nodes is completed, the gateway node sends a communication start broadcast frame to tell all nodes in the network that the authentication process has ended and normal communication has begun.

[0178] Through the above scheme, this embodiment obtains the unique node identifier of the frame data segment of the broadcast frame, and determines the CAN node according to the unique node identifier; generates a challenge ciphertext corresponding to the CAN node, and after the CAN node receives the challenge ciphertext, decrypts the challenge ciphertext to obtain a target random number; processes the target random number according to the HMAC function and the symmetric encryption algorithm function to obtain a response frame corresponding to the target session key; sends the response frame to the gateway through the CAN node, and after the gateway receives the response frame, generates the corresponding verification data according to the HMAC function; verifies the consistency of the response frame and the verification data, and determines that the two-way authentication process between the current CAN node and the gateway is successful if the verification passes; the CAN node sends an authentication completion confirmation frame to the gateway node, and after the gateway receives the confirmation frames of all key nodes, it sends a communication start broadcast frame; can complete the identity authentication between the gateway and the external device, and the gateway and the in-vehicle node, improve the communication security level, improve the safety of vehicle driving, ensure the life safety of the driver and passengers, and improve the speed and efficiency of the in-vehicle gateway online identity authentication.

[0179] Correspondingly, the present invention further provides an in-vehicle gateway online identity authentication device.

[0180] Reference Fig. 9 , Fig. 9 This is a functional module diagram of the first embodiment of the in-vehicle gateway online identity authentication device of the present invention.

[0181] In the first embodiment of the in-vehicle gateway online identity authentication device of the present invention, the in-vehicle gateway online identity authentication device includes:

[0182] The key acquisition module 10 is used to obtain the diagnostic instrument serial number of the diagnostic instrument, and obtain the authentication key of the diagnostic instrument from the TSP platform through the gateway via the T-BOX based on the diagnostic instrument serial number.

[0183] The diagnostic instrument authentication module 20 is used to authenticate the gateway and the diagnostic instrument according to the authentication key.

[0184] The ECU authentication module 30 is used to perform identity authentication on the gateway and the electronic control unit ECU according to the authentication key.

[0185] The key acquisition module 10 is also used to receive the diagnostic instrument serial number sent by the diagnostic instrument through the gateway after receiving the authentication application initiated by the diagnostic instrument; determine whether the gateway has saved the current authentication key of the diagnostic instrument; when the gateway has saved the current authentication key, enter the authentication challenge mode; when the gateway has not saved the current authentication key, obtain the authentication key of the diagnostic instrument from the TSP platform through the gateway through the T-BOX based on the diagnostic instrument serial number.

[0186] The key acquisition module 10 is also used to obtain the gateway serial number of the gateway when the gateway does not save the current authentication key, and send the gateway serial number and the diagnostic instrument serial number to the TSP platform through T-BOX; determine through the TSP platform whether the gateway has the authority to obtain the key; when the gateway has the authority, obtain the authentication key of the diagnostic instrument through the TSP platform, and send the authentication key to the gateway.

[0187] The diagnostic instrument authentication module 20 is also used to send a request authentication instruction through the diagnostic instrument when the gateway has saved the authentication key, and generate a first random number and send it to the gateway; generate a second random number through the grid in response to the request authentication instruction, and feed back the second random number to the diagnostic instrument; after the diagnostic instrument receives the second random number, generate first authentication data using the algorithm in the security authentication module, and send the first authentication data to the gateway; after the gateway receives the first authentication data, verify the first authentication data through the gateway, generate second authentication data using the preset authentication algorithm in the security authentication module, and feed back the authentication identifier, the second authentication data and the third random number ciphertext to the diagnostic instrument. The diagnostic instrument is used to verify the second authentication data, and after the verification is passed, the third random number ciphertext is decrypted to obtain the third random number; the grid and the diagnostic instrument use the third random number as a session key, and protect the communication message through the session key, and take the high 2 bytes of the first random number and the second random number as a calculator; the diagnostic instrument periodically sends a session state maintenance message, and performs MAC calculation on the session state maintenance message. The message content of the session state maintenance message includes a counter, and the calculator increases by 1 each time a message is sent; when the gateway receives the session state maintenance message, the MAC value is verified using the third random number, and the current session is stopped after the verification fails.

[0188] The ECU authentication module 30 is also used to randomly generate two key matrices through the gateway, and generate a target session key from the key matrix through a preset derivation algorithm; after receiving a response from the CAN node, the gateway performs data verification according to the target session key, and performs identity authentication with the electronic control unit ECU through the gateway according to the authentication key.

[0189] The ECU authentication module 30 is also used to obtain the security level of the electronic control unit ECU, randomly generate two key matrices with different security levels through the gateway according to the security level, save the key matrices during a working cycle; and generate a target session key by using a preset derivation algorithm for the key matrix.

[0190] The ECU authentication module 30 is also used to obtain a unique node identifier of a frame data segment of a broadcast frame, and determine a CAN node according to the unique node identifier; generate a challenge ciphertext corresponding to the CAN node, and after the CAN node receives the challenge ciphertext, decrypt the challenge ciphertext to obtain a target random number; process the target random number according to an HMAC function and a symmetric encryption algorithm function to obtain a response frame corresponding to the target session key; send the response frame to the gateway through the CAN node, and after the gateway receives the response frame, generate the corresponding verification data according to the HMAC function; verify the consistency of the response frame and the verification data, and if the verification passes, determine that the two-way authentication process between the current CAN node and the gateway is successful; the CAN node sends an authentication completion confirmation frame to the gateway node, and after the gateway receives the confirmation frames of all key nodes, sends a communication start broadcast frame.

[0191] Among them, the steps implemented by each functional module of the in-vehicle gateway online identity authentication device can refer to the various embodiments of the in-vehicle gateway online identity authentication method of the present invention, and will not be repeated here.

[0192] In addition, an embodiment of the present invention further provides a storage medium, on which an in-vehicle gateway online identity authentication program is stored. When the in-vehicle gateway online identity authentication program is executed by a processor, the following operations are implemented:

[0193] Obtain the diagnostic instrument serial number of the diagnostic instrument, and obtain the authentication key of the diagnostic instrument from the TSP platform through the gateway through the T-BOX based on the diagnostic instrument serial number;

[0194] Authenticating the gateway and the diagnostic instrument according to the authentication key;

[0195] The gateway and the electronic control unit ECU are authenticated according to the authentication key.

[0196] Furthermore, when the in-vehicle gateway online identity authentication program is executed by the processor, the following operations are also implemented:

[0197] After receiving the authentication application initiated by the diagnostic instrument, receiving the diagnostic instrument serial number sent by the diagnostic instrument through the gateway;

[0198] determining whether the gateway has saved the current authentication key of the diagnostic instrument;

[0199] When the gateway has saved the current authentication key, entering an authentication challenge mode;

[0200] When the gateway does not store the current authentication key, the gateway obtains the authentication key of the diagnostic instrument from the TSP platform through the T-BOX based on the serial number of the diagnostic instrument.

[0201] Furthermore, when the in-vehicle gateway online identity authentication program is executed by the processor, the following operations are also implemented:

[0202] When the gateway does not store the current authentication key, obtaining the gateway serial number of the gateway, and sending the gateway serial number and the diagnostic instrument serial number to the TSP platform via T-BOX;

[0203] Determine, through the TSP platform, whether the gateway has the authority to obtain the key;

[0204] When the gateway has permission, the authentication key of the diagnostic instrument is obtained through the TSP platform, and the authentication key is sent to the gateway.

[0205] Furthermore, when the in-vehicle gateway online identity authentication program is executed by the processor, the following operations are also implemented:

[0206] When the gateway has saved the authentication key, sending an authentication request instruction through the diagnostic instrument, and generating a first random number and sending it to the gateway;

[0207] generating a second random number by the grid in response to the authentication request instruction, and feeding back the second random number to the diagnostic instrument;

[0208] After the diagnostic instrument receives the second random number, it generates first authentication data using an algorithm in a security authentication module, and sends the first authentication data to the gateway;

[0209] After the gateway receives the first authentication data, the first authentication data is verified by the gateway, a preset authentication algorithm in the security authentication module is used to generate second authentication data, and the authentication identifier, the second authentication data and a third random number ciphertext are fed back to the diagnostic instrument;

[0210] Verifying the second authentication data by the diagnostic instrument, and decrypting the third random number ciphertext after verification to obtain the third random number;

[0211] The grid and the diagnostic instrument use the third random number as a session key, protect the communication message by the session key, and take the high 2 bytes of the first random number and the second random number as a calculator;

[0212] The diagnostic instrument periodically sends a session state maintenance message, performs MAC calculation on the session state maintenance message, wherein the message content of the session state maintenance message includes a counter, and each time a message is sent, the counter increases by 1;

[0213] When the gateway receives the session state maintenance message, the third random number is used to verify the MAC value, and the current session is stopped after the verification fails.

[0214] Furthermore, when the in-vehicle gateway online identity authentication program is executed by the processor, the following operations are also implemented:

[0215] Two key matrices are randomly generated by the gateway, and the key matrices are subjected to a preset derivation algorithm to generate a target session key;

[0216] After receiving the response from the CAN node, the gateway performs data verification according to the target session key, and performs identity authentication with the electronic control unit ECU through the gateway according to the authentication key.

[0217] Furthermore, when the in-vehicle gateway online identity authentication program is executed by the processor, the following operations are also implemented:

[0218] Acquiring a security level of an electronic control unit ECU, randomly generating two key matrices with different security levels through the gateway according to the security level, and storing the key matrices during a working cycle;

[0219] The key matrix is ​​subjected to a preset derivation algorithm to generate a target session key.

[0220] Furthermore, when the in-vehicle gateway online identity authentication program is executed by the processor, the following operations are also implemented:

[0221] Acquire a unique node identifier of a frame data segment of a broadcast frame, and determine a CAN node according to the unique node identifier;

[0222] Generate a challenge ciphertext corresponding to the CAN node, and after receiving the challenge ciphertext, the CAN node decrypts the challenge ciphertext to obtain a target random number;

[0223] Processing the target random number according to the HMAC function and the symmetric encryption algorithm function to obtain a response frame corresponding to the target session key;

[0224] The response frame is sent to the gateway through the CAN node, and after the gateway receives the response frame, the corresponding verification data is generated according to the HMAC function;

[0225] Verify the consistency of the response frame and the verification data, and if the verification passes, determine that the two-way authentication process between the current CAN node and the gateway is successful;

[0226] The CAN node sends an authentication completion confirmation frame to the gateway node, and after the gateway receives the confirmation frames from all key nodes, it sends a communication start broadcast frame.

[0227] Those skilled in the art will appreciate that all or part of the steps in the above-mentioned implementation method can be accomplished by instructing related hardware through a program, and the program is stored in a storage medium, including a number of instructions for enabling a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each implementation method of the present application; and the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0228] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0229] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0230] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for online identity authentication of an in-vehicle gateway, It is characterized in that The in-vehicle gateway online identity authentication method comprises: Obtain the diagnostic instrument serial number of the diagnostic instrument, and obtain the authentication key of the diagnostic instrument from the TSP platform through the gateway through the T-BOX based on the diagnostic instrument serial number; Authenticating the gateway and the diagnostic instrument according to the authentication key; The gateway and the electronic control unit ECU are authenticated according to the authentication key.

2. The in-vehicle gateway online identity authentication method as claimed in claim 1, It is characterized in that The step of obtaining the diagnostic instrument serial number of the diagnostic instrument and obtaining the authentication key of the diagnostic instrument from the TSP platform through the gateway via the T-BOX based on the diagnostic instrument serial number includes: After receiving the authentication application initiated by the diagnostic instrument, receiving the diagnostic instrument serial number sent by the diagnostic instrument through the gateway; determining whether the gateway has saved the current authentication key of the diagnostic instrument; When the gateway has saved the current authentication key, entering an authentication challenge mode; When the gateway does not store the current authentication key, the gateway obtains the authentication key of the diagnostic instrument from the TSP platform through the T-BOX based on the serial number of the diagnostic instrument.

3. The in-vehicle gateway online identity authentication method as claimed in claim 2, It is characterized in that When the gateway does not store the current authentication key, obtaining the authentication key of the diagnostic instrument from the TSP platform through the gateway via the T-BOX based on the diagnostic instrument serial number includes: When the gateway does not store the current authentication key, obtaining the gateway serial number of the gateway, and sending the gateway serial number and the diagnostic instrument serial number to the TSP platform via T-BOX; Determine, through the TSP platform, whether the gateway has the authority to obtain the key; When the gateway has permission, the authentication key of the diagnostic instrument is obtained through the TSP platform, and the authentication key is sent to the gateway.

4. The in-vehicle gateway online identity authentication method as claimed in claim 1, It is characterized in that The authenticating the gateway and the diagnostic instrument according to the authentication key includes: When the gateway has saved the authentication key, sending an authentication request instruction through the diagnostic instrument, and generating a first random number and sending it to the gateway; generating a second random number by the grid in response to the authentication request instruction, and feeding back the second random number to the diagnostic instrument; After the diagnostic instrument receives the second random number, it generates first authentication data using an algorithm in a security authentication module, and sends the first authentication data to the gateway; After the gateway receives the first authentication data, the first authentication data is verified by the gateway, a preset authentication algorithm in the security authentication module is used to generate second authentication data, and the authentication identifier, the second authentication data and a third random number ciphertext are fed back to the diagnostic instrument; Verifying the second authentication data by the diagnostic instrument, and decrypting the third random number ciphertext after verification to obtain the third random number; The grid and the diagnostic instrument use the third random number as a session key, protect the communication message by the session key, and take the high 2 bytes of the first random number and the second random number as a calculator; The diagnostic instrument periodically sends a session state maintenance message, performs MAC calculation on the session state maintenance message, wherein the message content of the session state maintenance message includes a counter, and each time a message is sent, the counter increases by 1; When the gateway receives the session state maintenance message, the third random number is used to verify the MAC value, and the current session is stopped after the verification fails.

5. The in-vehicle gateway online identity authentication method as claimed in claim 1, It is characterized in that The performing identity authentication on the gateway and the electronic control unit ECU according to the authentication key includes: Two key matrices are randomly generated by the gateway, and the key matrices are subjected to a preset derivation algorithm to generate a target session key; After receiving the response from the CAN node, the gateway performs data verification according to the target session key, and performs identity authentication with the electronic control unit ECU through the gateway according to the authentication key.

6. The in-vehicle gateway online identity authentication method as claimed in claim 5, It is characterized in that The step of randomly generating two key matrices through the gateway and applying a preset derivation algorithm to the key matrices to generate a target session key comprises: Acquiring a security level of an electronic control unit ECU, randomly generating two key matrices with different security levels through the gateway according to the security level, and storing the key matrices during a working cycle; The key matrix is ​​subjected to a preset derivation algorithm to generate a target session key.

7. The in-vehicle gateway online identity authentication method as claimed in claim 5, It is characterized in that After receiving the response from the CAN node, the gateway performs data verification according to the target session key, and performs identity authentication with the electronic control unit ECU through the gateway according to the authentication key, including: Acquire a unique node identifier of a frame data segment of a broadcast frame, and determine a CAN node according to the unique node identifier; Generate a challenge ciphertext corresponding to the CAN node, and after receiving the challenge ciphertext, the CAN node decrypts the challenge ciphertext to obtain a target random number; Processing the target random number according to the HMAC function and the symmetric encryption algorithm function to obtain a response frame corresponding to the target session key; The response frame is sent to the gateway through the CAN node, and after the gateway receives the response frame, the corresponding verification data is generated according to the HMAC function; Verify the consistency of the response frame and the verification data, and if the verification passes, determine that the two-way authentication process between the current CAN node and the gateway is successful; The CAN node sends an authentication completion confirmation frame to the gateway node, and after the gateway receives the confirmation frames from all key nodes, it sends a communication start broadcast frame.

8. An in-vehicle gateway online identity authentication device, It is characterized in that The in-vehicle gateway online identity authentication device comprises: A key acquisition module, used to obtain the diagnostic instrument serial number of the diagnostic instrument, and obtain the authentication key of the diagnostic instrument from the TSP platform through the gateway through the T-BOX based on the diagnostic instrument serial number; A diagnostic instrument authentication module, used for authenticating the gateway and the diagnostic instrument according to the authentication key; The ECU authentication module is used to perform identity authentication on the gateway and the electronic control unit ECU according to the authentication key.

9. An in-vehicle gateway online identity authentication device, It is characterized in that The in-vehicle gateway online identity authentication device includes: a memory, a processor, and an in-vehicle gateway online identity authentication program stored in the memory and executable on the processor, wherein the in-vehicle gateway online identity authentication program is configured to implement the steps of the in-vehicle gateway online identity authentication method as described in any one of claims 1 to 7.

10. A storage medium, It is characterized in that The storage medium stores an in-vehicle gateway online identity authentication program, and when the in-vehicle gateway online identity authentication program is executed by the processor, the steps of the in-vehicle gateway online identity authentication method according to any one of claims 1 to 7 are implemented.