Communication authentication method, corresponding devices and storage medium
By identifying and adjusting the interface and slave address of the MFI chip before the vehicle-mounted device leaves the factory, and setting the authentication data in advance, the code redundancy problem caused by the variety of MFI chips is solved, and the authentication connection speed and efficiency are improved.
Patent Information
- Application Number
- CN202211090519.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-07
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-09-07
AI Technical Summary
In existing technologies, the variety of MFI chips leads to the need for multiple sets of authentication codes, which are redundant and difficult to switch dynamically, thus reducing the efficiency of reading authentication.
Before the vehicle-mounted equipment leaves the factory, it identifies the damage to the certification chip and reads the certification data of the MFI chip in advance. By automatically adjusting the I2C interface and slave address of the certification chip, the same software can be used for different models of MFI chips. The certification data is set into the preset storage structure before the operating system starts.
It improves authentication connection speed, reduces authentication data reading time, enhances connection efficiency, and achieves compatibility with different MFI chip models.
Smart Images

Figure CN116321145B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication authentication, in particular to a communication authentication method, a corresponding device and a storage medium. BACKGROUND
[0002] In the process of driving a car, many drivers will connect their mobile phones to the car machine end for convenience. Generally, the car machine end needs to be interconnected with an iPhone mobile phone, which requires Apple MFI (Made for iPhone / iPod / iPad) authentication. The car machine end reads and writes relevant data for MFI authentication to successfully authenticate and achieve interconnection.
[0003] However, since there is more than one type of MFI chip, each MFI chip corresponds to a set of codes for reading and writing MFI authentication-related data, which requires multiple sets of authentication codes, resulting in code redundancy and difficulty in dynamically switching codes, wasting time and reducing reading authentication efficiency. SUMMARY
[0004] The present application provides a communication authentication method, a corresponding device and a storage medium.
[0005] The first aspect of the present application provides a communication authentication method applied to a vehicle-mounted device, wherein the vehicle-mounted device is installed with an operating system, and the vehicle-mounted device is provided with an authentication chip. The method comprises: in response to a mobile terminal accessing to the vehicle-mounted device, establishing an authentication connection with the mobile terminal;
[0006] In response to receiving an authentication request from the mobile terminal through the authentication connection, feeding back authentication data in a preset storage structure to the mobile terminal, and receiving an authentication result from the mobile terminal, wherein the authentication data of the authentication chip is set to the preset storage structure before the operating system is started;
[0007] In response to the authentication result being authentication success, establishing a communication connection with the mobile terminal.
[0008] Wherein, an initialization process is started before the operating system is started, and an authentication service process started by the initialization process sets the authentication data to the preset storage structure.
[0009] Wherein, the preset storage structure is also provided with a plurality of slave addresses of the authentication chip, a plurality of interfaces connected to the authentication chip and a default protocol version number, wherein the plurality of slave addresses include a default slave address, and the plurality of interfaces include a default interface;
[0010] Setting the authentication data to the preset storage structure comprises: reading the default slave address from the preset storage structure;
[0011] reading a protocol version number from the authentication chip for the first time according to the default slave address through the default interface;
[0012] In response to the first reading of the protocol version number being successful and consistent with the default protocol version number, reading the authentication data from the authentication chip using parameters corresponding to the protocol version number to set the authentication data to the preset storage structure.
[0013] In response to the first reading of the protocol version number being successful and inconsistent with the default protocol version number, prompting information that the authentication chip is replaced.
[0014] In response to the first reading of the protocol version number being unsuccessful, obtaining any slave address of the plurality of slave addresses and any interface of the plurality of interfaces to read the protocol version number from the authentication chip for the second time according to the any slave address and the any interface.
[0015] In response to the second reading of the protocol version number being successful and consistent with the default protocol version number, resetting the any interface, the any slave address and the protocol version number to the preset storage structure.
[0016] In response to the second reading of the protocol version number being unsuccessful, reading the protocol version number from the authentication chip again for a preset number of times according to the any interface and the any slave address.
[0017] In response to the preset number of times of reading of the protocol version number being unsuccessful, prompting information that the authentication chip is damaged.
[0018] In response to the authentication result being authentication failure, clearing the preset storage structure, reading the authentication data from the authentication chip and setting the authentication data to the preset storage structure.
[0019] Reestablishing a communication connection with the mobile terminal according to the authentication data read from the authentication chip.
[0020] The second aspect of the application provides a communication authentication method applied to a mobile terminal, comprising: accessing a vehicle-mounted device to establish an authentication connection with the vehicle-mounted device.
[0021] send an authentication request to the in-vehicle device through the authentication connection, so that the in-vehicle device responds to the authentication request and returns authentication data in a preset storage structure to the mobile terminal, wherein the authentication data of the authentication chip is set into the preset storage structure before the operating system is started;
[0022] send an authentication result to the in-vehicle device, so that the in-vehicle device establishes a communication connection with the mobile terminal in response to the authentication result being successful.
[0023] The third aspect of the present application provides an in-vehicle device, comprising a memory and a processor coupled with each other, the processor being configured to execute program instructions stored in the memory to implement the communication authentication method in the first aspect.
[0024] The fourth aspect of the present application provides a mobile terminal, comprising a memory and a processor coupled with each other, the processor being configured to execute program instructions stored in the memory to implement the communication authentication method in the second aspect.
[0025] The fifth aspect of the present application provides a non-volatile computer readable storage medium, the computer readable storage medium being configured to store program instructions, the program instructions being configured to implement the communication authentication method in the first aspect or the communication authentication method in the second aspect when executed by a processor.
[0026] The present application establishes an authentication connection with the mobile terminal in response to the mobile terminal accessing the in-vehicle device, receives an authentication request from the mobile terminal through the authentication connection, returns authentication data in a preset storage structure to the mobile terminal, and receives an authentication result from the mobile terminal, wherein the authentication data of the authentication chip is set into the preset storage structure before the operating system is started, and the in-vehicle device establishes a communication connection with the mobile terminal in response to the authentication result being successful. By setting the authentication data in the preset storage structure before the operating system is started, the in-vehicle device can directly read the authentication data from the preset storage structure after the mobile terminal accesses the in-vehicle device, thereby saving the authentication data reading time and improving the connection efficiency.
[0027] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, but not limiting the present application. BRIEF DESCRIPTION OF DRAWINGS
[0028] The accompanying drawings incorporated in the specification and forming a part of it, illustrate embodiments consistent with the present application and, together with the description, serve to explain the technical solutions of the present application.
[0029] Figure 1 is a flowchart of the first embodiment of the communication authentication method of the present application;
[0030] Figure 2 is a flowchart of a second embodiment of the communication authentication method of the present application;
[0031] Figure 3 is a flowchart of a third embodiment of the communication authentication method of the present application;
[0032] Figure 4 is a flowchart of a fourth embodiment of the communication authentication method of the present application;
[0033] Figure 5 is a flowchart of a fifth embodiment of the communication authentication method of the present application;
[0034] Figure 6 is a structural diagram of an embodiment of the vehicle-mounted device of the present application;
[0035] Figure 7 is a structural diagram of an embodiment of the mobile terminal of the present application;
[0036] Figure 8 is a structural diagram of an embodiment of the system of the present application;
[0037] Figure 9 is a structural diagram of an embodiment of the non-volatile computer readable storage medium of the present application. DETAILED DESCRIPTION
[0038] The present application will be further described by embodiments with reference to the drawings. It is specifically pointed out that the following embodiments are only used to illustrate the present application, but do not limit the scope of the present application. Similarly, the following embodiments are only part of the embodiments of the present application, but not all embodiments of the present application. All other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0039] In the present application, the phrase "embodiment" means that the specific features, structures or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the present application. The phrase appears at various places in the specification does not necessarily refer to the same embodiment, nor is it independent or alternative to other embodiments. Those skilled in the art explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.
[0040] The term "and / or", used in the present document, only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the following three cases: A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in the present document generally represents an "or" relationship between the front and rear associated objects. In addition, "multiple" in the present document means two or more. In addition, the term "at least one" in the present document means any one of multiple or any combination of at least two of multiple, for example, including at least one of A, B and C can mean including any one or more elements selected from the set consisting of A, B and C. In addition, the terms "first", "second", "third" in the present application are only for description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features.
[0041] As described above, since there is more than one type of MFI chip, each type of MFI chip corresponds to a set of codes for reading and writing MFI authentication related data, multiple sets of authentication codes are required, resulting in code redundancy, and the codes are difficult to dynamically switch, wasting time and reducing authentication efficiency.
[0042] Therefore, the present application provides a communication authentication method, a corresponding device and a storage medium.
[0043] The present application is different from the prior art scheme that must go through an authentication stage as long as it is connected with an Apple device (such as an iPhone), and the authentication data used is read from the MFI chip. The difference is that the present application can identify the damage of the chip before the vehicle-mounted device is shipped by reading the authentication data of the MFI chip in advance, and can improve the speed of authentication connection, and can also automatically adjust the i2c interface and slave address of the authentication chip, so that the same software is applicable to different types of MFI chips.
[0044] Please refer to Figure 1 , Figure 1 is a flowchart of the first embodiment of the communication authentication method of the present application. The execution subject of the method can be a processor, for example, the method can be executed by a terminal device with computing function, and the terminal device can be a computing device or a vehicle-mounted device. In some possible implementation manners, the communication authentication method can be realized by the processor calling the computer readable instructions stored in the memory. Specifically, the communication authentication method is applied to a vehicle-mounted device, the vehicle-mounted device is installed with an operating system, and the vehicle-mounted device is provided with an authentication chip. The method can include the following steps:
[0045] S11, in response to the mobile terminal accessing to the vehicle-mounted device, establishing an authentication connection with the mobile terminal.
[0046] S12, in response to receiving an authentication request from the mobile terminal through the authentication connection, replying authentication data in the preset storage structure to the mobile terminal, and receiving an authentication result from the mobile terminal, wherein the authentication data of the authentication chip is set into the preset storage structure before the operating system is started.
[0047] S13, in response to the authentication result being authentication success, establishing a communication connection with the mobile terminal.
[0048] The authentication chip is arranged in the vehicle-mounted device, and is used for authenticating the mobile terminal accessing the vehicle-mounted device. The vehicle-mounted system is installed on the vehicle-mounted device, specifically, the vehicle-mounted system is installed and runs on other chips other than the authentication chip. The vehicle-mounted system includes a bottom kernel and an upper operating system, wherein the operating system can be an Android system, a Linux system, or other systems that can be implemented, and is not limited specifically. It can be understood that the CarPlay system is installed in the vehicle-mounted device, the mobile terminal (such as iPhone) accesses the vehicle-mounted device, and the CarPlay and the iPhone establish a communication connection after authentication success.
[0049] The mobile terminal can access the vehicle-mounted device through a wire, and in response to the mobile terminal accessing the vehicle-mounted device, an authentication connection between the vehicle-mounted device and the mobile terminal is established. In response to receiving an authentication request from the mobile terminal through the authentication connection, authentication data in a preset storage structure is replied to the mobile terminal, and an authentication result is received from the mobile terminal. It can be understood that after the vehicle-mounted device and the mobile terminal establish an authentication connection, the vehicle-mounted device receives an authentication request from the mobile terminal. The vehicle-mounted device replies authentication data in a preset storage structure to the mobile terminal according to the received authentication request, so that the mobile terminal can authenticate according to the received authentication data and generate an authentication result. The vehicle-mounted device can receive the authentication result from the mobile terminal through the authentication connection.
[0050] The authentication data of the authentication chip is set into the preset storage structure before the operating system is started. The preset storage structure has a shared storage function and can store the authentication data of the authentication chip. The authentication data is set into the preset storage structure before the operating system in the upper layer of the vehicle-mounted system is started. It can be understood that the authentication data of the authentication chip is set into the preset storage structure after the kernel of the vehicle-mounted system is started and before the operating system is started. It can be understood as a strategy to improve the authentication speed. After the vehicle-mounted device recognizes that the mobile terminal accesses, the vehicle-mounted device directly reads the authentication data from the preset storage structure and establishes an authentication connection with the mobile terminal, which can improve the speed of the authentication connection.
[0051] In response to the authentication result being authentication success, the vehicle-mounted device establishes a communication connection with the mobile terminal. It can be understood that the mobile terminal authenticates the authentication data, and the authentication result generated after the authentication is successful is authentication success. After the vehicle-mounted device receives the authentication result of authentication success from the mobile terminal through the authentication connection, the vehicle-mounted device establishes a communication connection with the mobile terminal to transmit data.
[0052] The application establishes an authentication connection with the mobile terminal in response to the mobile terminal accessing the vehicle-mounted device. In response to receiving an authentication request from the mobile terminal through the authentication connection, the vehicle-mounted device returns authentication data in a preset storage structure to the mobile terminal, and receives an authentication result from the mobile terminal. The authentication data of the authentication chip is set in the preset storage structure before the operating system is started. In response to the authentication result being authentication success, the vehicle-mounted device establishes a communication connection with the mobile terminal. By setting the authentication data in the preset storage structure before the operating system is started, the vehicle-mounted device can directly read the authentication data from the preset storage structure after the mobile terminal accesses the vehicle-mounted device, saving authentication data reading time and improving connection efficiency.
[0053] In an embodiment of the application, an initialization process is started before the operating system is started. An authentication service process started by the initialization process sets the authentication data in the preset storage structure.
[0054] It can be understood that the authentication service process started by the initialization process of the operating system sets the authentication data in the preset storage structure. The initialization process is started before the operating system is started, so that the authentication data is set in the preset storage structure before the operating system is started. The vehicle-mounted device is installed with a vehicle-mounted system, which includes a kernel at the bottom and an operating system at the top. After the kernel is started, it is first determined whether the preset storage structure includes valid authentication data. If the preset storage structure includes valid authentication data, the valid authentication data can be directly used in the subsequent authentication process to improve authentication efficiency. If the preset storage structure does not include valid authentication data, the initialization process starts an authentication service process before the operating system is started. The authentication service process can include multiple concurrent threads. One of the threads sets the authentication data, and does not hinder the running of other threads. Thus, the authentication data is set in the preset storage structure before the operating system is started, for use in the subsequent authentication process.
[0055] In an embodiment of the application, the preset storage structure is also provided with multiple slave addresses of the authentication chip, multiple interfaces connected to the authentication chip, and a default protocol version number. The multiple slave addresses include a default slave address, and the multiple interfaces include a default interface.
[0056] The preset storage structure is further provided with a plurality of slave addresses of the authentication chip, a plurality of interfaces connected with the authentication chip, and a default protocol version number, wherein the plurality of slave addresses include a default slave address, and the plurality of interfaces include a default interface. There are various models of the authentication chip, and the authentication data of the authentication chips of different models are different. The plurality of slave addresses of each type of authentication chip, the plurality of interfaces connected with the authentication chip, and the default protocol version number are set in the preset storage structure in advance, one of the slave addresses is defined as the default slave address, and one of the interfaces is defined as the default interface. The authentication data corresponding to the authentication chip is read according to the plurality of slave addresses, the plurality of interfaces, and the default protocol version number, and the authentication data is set in the preset storage structure in advance. In the subsequent authentication process, the corresponding authentication data can be directly read from the preset storage structure.
[0057] It can be understood that there are various models of authentication chips, for example, 2.0B, 2.0C, and 3.0, and each type of authentication chip has a default protocol version number. The vehicle-mounted device is provided with a car chip, and the vehicle-mounted system runs on the car chip. The car chip and the authentication chip can be connected through an i2c bus, and the i2c bus includes a plurality of interfaces. Among them, the interface connected between the car chip and the authentication chip is multiple, that is, the interface connected with the authentication chip is multiple, for example, i2c-0, i2c-1, and i2c-2. The slave address of the authentication chip is multiple, for example, 0X10 and 0X11.
[0058] Figure 2 is a flowchart of the second embodiment of the communication authentication method of the application, as shown in Figure 2 In some embodiments, setting the authentication data into the preset storage structure includes: reading the default slave address from the preset storage structure; reading the protocol version number from the authentication chip for the first time through the default interface according to the default slave address; in response to the first reading of the protocol version number being successful and consistent with the default protocol version number, reading the authentication data from the authentication chip using the parameters corresponding to the protocol version number to set the authentication data into the preset storage structure.
[0059] It can be understood that after the kernel of the vehicle-mounted system is started and before the operating system is started, the initialization process starts the authentication service process, a thread in the authentication service process reads the default slave address in the preset storage structure, and reads the protocol version number from the authentication chip for the first time according to the slave address. In response to the first successful reading of the protocol version number, the read protocol version number is compared with the default protocol version number in the preset storage structure. If the read protocol version number is consistent with the default protocol version number, the specific model of the authentication chip can be determined according to the parameters corresponding to the read protocol version number, and the authentication data of the authentication chip is read to set the authentication data in the preset storage structure for the subsequent authentication process. In addition, the next time the vehicle-mounted device is restarted, the authentication data corresponding to each model of authentication chip can be directly read from the preset storage structure.
[0060] For example, the preset storage structure stores the default slave address 0X10, the default interface i2c-0, and the default protocol version number 1.1.0. After the kernel is started and before the operating system is started, a thread in the authentication service process reads the protocol version number from the authentication chip for the first time according to the default slave address 0X10 through the default interface i2c-0. In response to the first successful reading of the protocol version number, the read protocol version number is 1.1.0, which is consistent with the default protocol version number. According to the parameters corresponding to the read protocol version number, the specific model of the authentication chip can be determined, the authentication data of the authentication chip is read, and then the authentication data is set to the preset storage structure. When setting, the authentication data of each model of authentication chip can be set correspondingly to achieve compatibility with multiple hardware.
[0061] Figure 3 is a flowchart of a third embodiment of the communication authentication method of the present application, as shown in Figure 3 In an embodiment of the present application, setting the authentication data to the preset storage structure further includes: in response to the first successful reading of the protocol version number and the protocol version number being inconsistent with the default protocol version number, prompting information that the authentication chip is replaced.
[0062] It can be understood that according to the default slave address, the protocol version number is read for the first time successfully through the default interface, the read protocol version number is compared with the default protocol version number in the preset storage structure, and if the read protocol version number is inconsistent with the default protocol version number, information that the authentication chip is replaced is prompted, but the replaced authentication chip does not affect use.
[0063] For example, the preset storage structure stores a default slave address 0X10, a default interface i2c-0, and a default protocol version number 1.1.0. After the kernel is started and before the operating system is started, a thread in the authentication service process reads the protocol version number from the authentication chip for the first time according to the default slave address 0X10 through the default interface i2c-0. In response to the first successful reading of the protocol version number, the read protocol version number is 1.2.0, which is inconsistent with the default protocol version number. Then, information that the authentication chip is replaced is generated to prompt, the default slave address 0X10, the default interface i2c-0, and the read protocol version number 1.2.0 are set to the preset storage structure, and the authentication data of the authentication chip is read according to the parameters corresponding to the read protocol version number. Then, the authentication data is set to the preset storage structure for use in the subsequent authentication process.
[0064] In an embodiment of the present application, please refer to Figure 3 The setting of the authentication data to the preset storage structure further includes: in response to the first reading of the protocol version number being unsuccessful, any slave address of a plurality of slave addresses and any interface of a plurality of interfaces are obtained to read the protocol version number from the authentication chip for the second time according to the any slave address and the any interface.
[0065] It can be understood that, in response to the first unsuccessful reading of the protocol version number according to the default slave address through the default interface, any slave address of a plurality of slave addresses and any interface of a plurality of interfaces are obtained to read the protocol version number from the authentication chip for the second time according to the any slave address and the any interface, which can be understood as an automatic adjustment strategy of the interface and the slave address.
[0066] Some authentication chips are affected by welding conditions or other factors when installed, resulting in a change in the slave address of the authentication chip, that is, different pin soldering positions of the authentication chip will change the slave address of the authentication chip. For example, the authentication chip is fixed by welding along a first direction, the slave address is 0X10, the authentication chip is fixed by welding along a second direction, the slave address is 0X11, and the first direction and the second direction are opposite directions.
[0067] Optionally, the preset storage structure stores a default slave address 0X10, a default interface i2c-0, and a default protocol version number 1.1.0. After the kernel is started and before the operating system is started, a thread in the authentication service process reads the protocol version number from the authentication chip for the first time according to the default slave address 0X10 through the default interface i2c-0. In response to the first unsuccessful reading of the protocol version number, any slave address of a plurality of slave addresses and any interface of a plurality of interfaces are obtained, and the plurality of slave addresses and the plurality of interfaces can be tried in turn.
[0068] For example, the protocol version number is read from the self-authentication chip for the second time according to the slave address 0X10 and the interface i2c-1, or the protocol version number is read from the self-authentication chip for the second time according to the slave address 0X10 and the interface i2c-2, or the protocol version number is read from the self-authentication chip for the second time according to the slave address 0X11 and the interface i2c-0, or the protocol version number is read from the self-authentication chip for the second time according to the slave address 0X11 and the interface i2c-1, or the protocol version number is read from the self-authentication chip for the second time according to the slave address 0X11 and the interface i2c-2. By changing the slave address and the interface for reading the protocol version number from the self-authentication chip for the second time, the software is adapted to the hardware, that is, the same software is applicable to different types of authentication chips.
[0069] Figure 4 is a flowchart of a fourth embodiment of the communication authentication method of the application, as shown in the embodiment of the application, the authentication data is set in the preset storage structure, further comprising: in response to successful reading of the protocol version number for the second time and the protocol version number being consistent with the default protocol version number, resetting any interface, any slave address and the protocol version number in the preset storage structure. Figure 4
[0070] It can be understood that, in response to successful reading of the protocol version number for the second time according to any slave address and any interface and the read protocol version number being consistent with the default protocol version number, the any slave address, the any interface and the read protocol version number are reset in the preset storage structure for use in subsequent authentication processes.
[0071] For example, the preset storage structure stores the default slave address 0X10, the default interface i2c-0 and the default protocol version number 1.1.0. After the kernel is started and before the operating system is started, a thread in the authentication service process reads the protocol version number from the self-authentication chip for the first time according to the default slave address 0X10 through the default interface i2c-0. In response to unsuccessful reading of the protocol version number for the first time, any slave address in a plurality of slave addresses and any interface in a plurality of interfaces are obtained, wherein the protocol version number is successfully read for the second time according to the slave address 0X10 and the interface i2c-2. The read protocol version number 1.1.0 is compared with the default protocol version number 1.1.0 in the preset storage structure, the read protocol version number is consistent with the default protocol version number, and the slave address 0X10, the interface i2c-2 and the read protocol version number 1.1.0 are set in the preset storage structure for use in subsequent authentication processes.
[0072] In the embodiment of the application, please refer to Figure 4 The setting of the authentication data into the preset storage structure further comprises: in response to the second reading of the protocol version number being unsuccessful, re-reading the protocol version number from the authentication chip according to any one of the plurality of slave addresses and any one of the plurality of interfaces for a preset number of times; and in response to the reading of the protocol version number still being unsuccessful for the preset number of times, prompting information that the authentication chip is damaged.
[0073] It can be understood that, in response to the reading of the protocol version number being unsuccessful according to any one of the plurality of slave addresses and any one of the plurality of interfaces, the reading of the protocol version number from the authentication chip is re-performed according to any one of the plurality of slave addresses and any one of the plurality of interfaces for a preset number of times. The preset number of times can be set according to actual use requirements, for example, once, twice, or any other number of times that can be achieved, without specific limitation. In response to the reading of the protocol version number still being unsuccessful for the preset number of times, the information that the authentication chip is damaged is prompted, which can be understood as a strategy for early identification of the damage of the authentication chip.
[0074] If the preset number of times is once, that is, in response to the reading of the protocol version number being unsuccessful according to any one of the plurality of slave addresses and any one of the plurality of interfaces, the reading of the protocol version number from the authentication chip is re-performed according to any one of the plurality of slave addresses and any one of the plurality of interfaces once. If the reading of the protocol version number is still unsuccessful again, the information that the authentication chip is damaged is generated and prompted.
[0075] The reading of the protocol version number and the determination of the specific model of the authentication chip according to the parameter corresponding to the protocol version number, and the reading of the authentication data from the authentication chip and the setting of the authentication data into the preset storage structure can be performed before the vehicle is shipped, so as to serve as a detection step of the vehicle-mounted device before the vehicle is shipped. If the reading of the protocol version number is still unsuccessful for the preset number of times according to any one of the plurality of slave addresses and any one of the plurality of interfaces, the information that the authentication chip is damaged is prompted, so that the damage of the authentication chip of the vehicle-mounted device is found before the vehicle is shipped.
[0076] In an embodiment of the present application, the communication authentication method further comprises: in response to the authentication result being authentication failure, emptying the preset storage structure, reading the authentication data from the authentication chip, and setting the authentication data into the preset storage structure; and re-establishing the communication connection with the mobile terminal according to the authentication data read from the authentication chip.
[0077] It can be understood that, after the kernel of the vehicle-mounted system is started, the authentication data of the authentication chip is set into the preset storage structure before the operating system is started. After the mobile terminal accesses the vehicle-mounted device, the vehicle-mounted device reads the authentication data of the authentication chip from the preset storage structure, and establishes an authentication connection with the mobile terminal, and then realizes authentication between the vehicle-mounted device and the mobile terminal through the authentication connection. After the vehicle-mounted device and the mobile terminal establish the authentication connection, the vehicle-mounted device receives the authentication request sent by the mobile terminal, and the vehicle-mounted device returns the authentication data to the mobile terminal according to the received authentication request, and the mobile terminal performs authentication according to the received authentication data, and generates an authentication result and sends it to the vehicle-mounted device.
[0078] Among them, since the authentication data is set into the preset storage structure before the mobile terminal and the vehicle-mounted device are connected, if the authentication data is contaminated, the authentication data will be invalid. The mobile terminal receives the invalid authentication data for authentication, and then generates an authentication failure authentication result and sends it to the vehicle-mounted device.
[0079] After the vehicle-mounted device receives the authentication failure authentication result, the vehicle-mounted device performs emptying processing on the preset storage structure, that is, deletes the related authentication data in the preset storage structure, reads new authentication data from the authentication chip again, and sets the read new authentication data into the preset storage structure for use in the next authentication process.
[0080] Further, according to the read new authentication data, the vehicle-mounted device re-establishes the authentication connection with the mobile terminal, receives the authentication request sent by the mobile terminal again, and the vehicle-mounted device returns the new authentication data to the mobile terminal according to the received authentication request, and the mobile terminal performs authentication according to the received new authentication data, and generates an authentication result and sends it to the vehicle-mounted device again.
[0081] In some embodiments, after the vehicle-mounted device receives the authentication result sent by the mobile terminal, the authentication data can be judged for reliability. If the authentication data meets the preset condition, it means that the authentication data is reliable and can be used for the next authentication process. If the authentication data does not meet the preset condition, it means that the authentication data is not reliable enough, and the authentication data needs to be read again and stored in the preset storage structure.
[0082] In an embodiment of the present application, the communication authentication method further comprises: in response to not reading the authentication data of the authentication chip from the preset storage structure, reading the authentication data of the authentication chip from the authentication chip, and setting the authentication data into the preset storage structure.
[0083] It can be understood that, in response to the mobile terminal accessing to the vehicle-mounted device, if the authentication data of the authentication chip is not read from the preset storage structure, it indicates that the authentication data is not set in the preset storage structure in advance, and the authentication data is directly read from the authentication chip to perform the authentication process, and the authentication data is set in the preset storage structure for the next authentication process.
[0084] In some embodiments, in response to the mobile terminal accessing to the vehicle-mounted device, if the authentication data of the authentication chip read from the preset storage structure is invalid data, for example, the length of the authentication data does not meet the preset condition, the authentication data is directly read from the authentication chip to perform the authentication process, and the authentication data is set in the preset storage structure for the next authentication process.
[0085] In an embodiment of the present application, the preset storage structure is at least one of a shared memory, a configuration file, an Android shared preference file and an Android performance file.
[0086] It can be understood that the preset storage structure has a shared storage function, and can be at least one of a shared memory, a configuration file, an Android shared preference file and an Android performance file, or other ways capable of realizing the shared storage function, which are not limited specifically. The configuration file can be an Extensible Markup Language (XML), a text document (txt), a Web configuration command (config), or other ways capable of realizing, which are not limited specifically.
[0087] Please refer to Figure 5 , Figure 5 is a flowchart of a fifth embodiment of the communication authentication method of the present application. The execution subject of the method is a mobile terminal, and the method can include the following steps:
[0088] S21, access to a vehicle-mounted device, and establish an authentication connection with the vehicle-mounted device.
[0089] S22, send an authentication request to the vehicle-mounted device through the authentication connection, so that the vehicle-mounted device responds to the authentication request and returns the authentication data in the preset storage structure to the mobile terminal, wherein the authentication data of the authentication chip is set in the preset storage structure before the operation system is started.
[0090] S23, send an authentication result to the vehicle-mounted device, so that the vehicle-mounted device responds to the authentication result as successful authentication and establishes a communication connection with the mobile terminal.
[0091] The mobile terminal accesses the vehicle-mounted device, and an authentication connection is established between the mobile terminal and the vehicle-mounted device. The mobile terminal sends an authentication request to the vehicle-mounted device through the authentication connection, so that the vehicle-mounted device returns authentication data in a preset storage structure to the mobile terminal in response to the authentication request. It can be understood that after the mobile terminal establishes a connection with the vehicle-mounted device, the mobile terminal sends an authentication request to the vehicle-mounted device and receives authentication data from the vehicle-mounted device. The mobile terminal authenticates the received authentication data and generates an authentication result and sends the authentication result to the vehicle-mounted device.
[0092] The preset storage structure has a shared storage function and can store authentication data of an authentication chip. The authentication data of the authentication chip is set into the preset storage structure before an operating system at an upper layer of the vehicle-mounted system is started. It can be understood that the authentication data of the authentication chip is set into the preset storage structure before the operating system is started after a kernel of the vehicle-mounted system is started. After the mobile terminal accesses the vehicle-mounted device, the vehicle-mounted device directly reads the authentication data from the preset storage structure and sends the authentication data to the mobile terminal for authentication.
[0093] The mobile terminal sends an authentication result to the vehicle-mounted device, so that the vehicle-mounted device establishes a communication connection with the mobile terminal in response to the authentication result being successful authentication. It can be understood that the mobile terminal authenticates the received authentication data. If the authentication is successful, the mobile terminal generates an authentication result of successful authentication and sends the authentication result to the vehicle-mounted device. The vehicle-mounted device establishes a communication connection with the mobile terminal in response to the authentication result being successful authentication, so that data transmission is performed.
[0094] The application sets the authentication data into the preset storage structure before the operating system is started. After the mobile terminal accesses the vehicle-mounted device, the vehicle-mounted device directly reads the authentication data from the preset storage structure, thereby saving authentication data reading time and improving connection efficiency.
[0095] Those skilled in the art can understand that the writing order of the steps in the above method of the specific embodiment does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by its function and possible internal logic.
[0096] Please refer to Figure 6 , Figure 6 is a structural schematic diagram of an embodiment of the vehicle-mounted device. The vehicle-mounted device 300 includes a memory 301 and a processor 302 coupled with each other. The processor 302 is configured to execute program instructions stored in the memory 301 to implement the steps in the communication authentication method embodiment described above. In a specific implementation scenario, the vehicle-mounted device 300 can include but is not limited to a microcomputer, a server, and in addition, the vehicle-mounted device 300 can also include a notebook computer, a tablet computer and other mobile devices, which are not limited herein.
[0097] Specifically, the processor 302 is configured to control itself and the memory 301 to implement the steps of the above communication authentication method embodiments. The processor 302 can also be referred to as a CPU (Central Processing Unit). The processor 302 can be an integrated circuit chip having a processing capability of signals. The processor 302 can also be a general processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general processor can be a microprocessor or the processor can also be any conventional processor or the like. In addition, the processor 302 can be jointly implemented by integrated circuit chips.
[0098] Referring to Figure 7 , Figure 7 is a structural schematic diagram of an embodiment of a mobile terminal of the present application. The mobile terminal 500 includes a memory 501 and a processor 502 coupled to each other. The processor 502 is configured to execute program instructions stored in the memory 501 to implement the steps in the above communication authentication method embodiments.
[0099] Referring to Figure 8 , Figure 8 is a structural schematic diagram of an embodiment of a system of the present application. The system includes the above vehicle-mounted device 300 and the above mobile terminal 500. The vehicle-mounted device 300 is capable of establishing a connection with the mobile terminal 500.
[0100] The mobile terminal 500 can be installed with an iOS system, and the authentication chip can be an MFI authentication chip. The vehicle-mounted device is provided with a car chip. The vehicle-mounted system runs on the car chip. The vehicle-mounted system includes a kernel at the bottom layer and an operating system at the upper layer. The car chip is connected with the MFI authentication chip through an i2c bus.
[0101] It can be understood that after the kernel of the in-vehicle device 300 is started and before the operating system is started, when the mobile terminal 500 does not access the in-vehicle device 300, the in-vehicle device 300 reads the authentication data of the MFI authentication chip and sets the authentication data into the preset storage structure. After the mobile terminal 500 accesses the in-vehicle device 300, the in-vehicle device 300 directly reads the authentication data from the preset storage structure and establishes an authentication connection with the mobile terminal 500. The mobile terminal 500 sends an authentication request to the in-vehicle device 300 through the authentication connection, and the in-vehicle device 300 returns the authentication data to the mobile terminal 500 according to the received authentication request. The mobile terminal 500 performs authentication according to the received authentication data, and generates an authentication result of authentication success and sends the authentication result to the in-vehicle device 300 when the authentication is passed. After the in-vehicle device 300 receives the authentication result of authentication success, the in-vehicle device 300 establishes a communication connection with the mobile terminal 500, so that the in-vehicle device 300 and the mobile terminal 500 can perform data transmission.
[0102] Please refer to Figure 9 , Figure 9 is a structural schematic diagram of an embodiment of the nonvolatile computer readable storage medium of the present application. The computer readable storage medium 700 is used to store program instructions 701, and the program instructions 701 are used to implement the steps in the communication authentication method embodiment described above when executed by the processor 302; or the program instructions 701 are used to implement the steps in the communication authentication method embodiment described above when executed by the processor 502.
[0103] The above description of various embodiments tends to emphasize the differences between various embodiments, and the same or similar parts can be referred to each other, and for the sake of brevity, the above description will not be repeated.
[0104] In several embodiments provided in the present application, it should be understood that the disclosed method and related device can be implemented in other ways. For example, the above-described related device implementation is only schematic, for example, the division of the module or unit is only a logical function division, and actual implementation can have another division manner, for example, the unit or component can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed each other can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0105] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0106] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the various embodiments of the method of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
Claims
1. A communication authentication method, characterized in that, The method, applied to in-vehicle devices equipped with an operating system and containing an authentication chip, includes: In response to a mobile terminal accessing the in-vehicle device, an authentication connection is established with the mobile terminal; In response to receiving an authentication request from the mobile terminal via the authentication connection, the authentication data in the preset storage structure is fed back to the mobile terminal, and the authentication result is received from the mobile terminal. The authentication data of the authentication chip is set in the preset storage structure before the operating system starts. The preset storage structure is also set with multiple slave addresses of the authentication chip, multiple interfaces connected to the authentication chip, and a default protocol version number. The multiple slave addresses include a default slave address, and the multiple interfaces include a default interface. In response to the authentication result being successful, a communication connection is established with the mobile terminal.
2. The method according to claim 1, characterized in that, The initialization process starts before the operating system starts, and the authentication service process started by the initialization process sets the authentication data into the preset storage structure.
3. The method according to claim 2, characterized in that, Setting the authentication data into the preset storage structure includes: Read the default slave address from the preset storage structure; Based on the default slave address, the protocol version number is read from the authentication chip for the first time through the default interface; In response to the successful first reading of the protocol version number, which is consistent with the default protocol version number, the authentication data is read from the authentication chip using the parameters corresponding to the protocol version number, so as to set the authentication data into the preset storage structure.
4. The method according to claim 3, characterized in that, Setting the authentication data into the preset storage structure further includes: In response to the successful first reading of the protocol version number, which is inconsistent with the default protocol version number, a message indicating that the authentication chip has been replaced is displayed; In response to the failure of the first reading of the protocol version number, any one of the plurality of slave addresses and any one of the plurality of interfaces is obtained, so as to read the protocol version number from the authentication chip for the second time based on the any one slave address and the any one interface.
5. The method according to claim 4, characterized in that, Setting the authentication data into the preset storage structure further includes: In response to the successful second reading of the protocol version number, which is consistent with the default protocol version number, the any interface, the any slave address, and the protocol version number are reset to the preset storage structure; In response to the failure of the second reading of the protocol version number, the protocol version number is read again from the authentication chip a preset number of times according to any interface and any slave address; If the protocol version number is not successfully read after the preset number of attempts, a message indicating that the authentication chip is damaged will be displayed.
6. The method according to claim 1, characterized in that, Further includes: In response to the authentication result being authentication failure, the preset storage structure is cleared, the authentication data is read from the authentication chip, and the authentication data is set into the preset storage structure; Based on the authentication data read from the authentication chip, a new communication connection is established with the mobile terminal.
7. A communication authentication method, characterized in that, Applied to mobile terminals, including: Access the in-vehicle device and establish an authentication connection with the in-vehicle device, wherein the in-vehicle device is equipped with an operating system and has an authentication chip; The authentication chip sends an authentication request to the vehicle-mounted device through the authentication connection, so that the vehicle-mounted device responds to the authentication request and replies the authentication data in the preset storage structure to the mobile terminal. The authentication data of the authentication chip is set in the preset storage structure before the operating system starts. The preset storage structure is also set with multiple slave addresses of the authentication chip, multiple interfaces connected to the authentication chip, and a default protocol version number. The multiple slave addresses include a default slave address, and the multiple interfaces include a default interface. The authentication result is sent to the vehicle-mounted device so that the vehicle-mounted device responds to the authentication result as successful and establishes a communication connection with the mobile terminal.
8. A vehicle-mounted device, characterized in that, It includes a memory and a processor coupled to each other, the processor being used to execute program instructions stored in the memory to implement the communication authentication method according to any one of claims 1 to 6.
9. A mobile terminal, characterized in that, It includes a memory and a processor that are coupled to each other, the processor being used to execute program instructions stored in the memory to implement the communication authentication method as described in claim 7.
10. A non-volatile computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program instructions, which, when executed by a processor, are used to implement the communication authentication method as described in any one of claims 1-6 or the communication authentication method as described in claim 7.
Citation Information
Patent Citations
Optimization method and system for efficient identification of vehicle-mounted CarPlay
CN113839920A