Method for realizing interconnection of multiple devices based on vehicle-mounted Bluetooth
Obtaining the context of the first terminal through the vehicle Bluetooth device and adding it to the list of discovered devices solves the problem that the prior art cannot meet the higher user needs, realizes Bluetooth connection and interaction between multiple devices, and improves the user experience.
Patent Information
- Application Number
- CN202510071373.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-04-25
AI Technical Summary
Existing automotive Bluetooth technology cannot meet higher user needs, especially in the interconnection and interaction of multiple devices.
Establish a Bluetooth connection with the first terminal through the vehicle Bluetooth device, obtain its context, and add it to the list of discovered devices, so that other devices (such as the second terminal) can discover and establish a Bluetooth connection with it, and realize the interconnection of multiple devices.
It realizes Bluetooth connection and interaction between multiple devices, meets higher user needs, and improves interoperability and user experience between devices.
Smart Images

Figure CN119893486A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method for interconnecting multiple devices based on vehicle-mounted Bluetooth. Background Art
[0002] With the rapid development of science and technology, wireless communication technology plays an increasingly important role in our lives. Among them, Bluetooth technology, as a short-range wireless communication technology, has been widely used in various devices, including mobile phones, headphones, car audio systems, etc. Car Bluetooth technology, as one of the application forms, provides a convenient way to connect mobile phones with car audio systems or communication devices. This article will introduce the relevant background and development status of car Bluetooth technology in detail.
[0003] In-car Bluetooth technology is a device connection solution based on Bluetooth wireless technology. Through in-car Bluetooth devices, drivers or passengers can connect smartphones or other mobile devices to the vehicle's audio system or communication devices. This connection method can achieve a variety of functions, such as playing music on the phone through the car audio, answering or making calls, etc. With in-car Bluetooth technology, drivers can answer or make calls without touching their phones, thereby improving driving safety. In addition, some advanced in-car Bluetooth systems also support voice control functions, and drivers can control music playback, answering calls, and other functions through voice commands.
[0004] However, the functions currently provided by in-car Bluetooth may not meet higher user demands in application scenarios. Summary of the invention
[0005] The embodiment of the present invention provides a method for interconnecting multiple devices based on vehicle-mounted Bluetooth, so as to realize the interconnection and interaction of multiple devices through vehicle-mounted Bluetooth, thereby meeting higher user needs.
[0006] In order to achieve the above object, the present invention adopts the following technical scheme: In a first aspect, a method for interconnecting multiple devices based on vehicle-mounted Bluetooth is provided, and the method is applied to a vehicle-mounted Bluetooth device, and the method includes: when the vehicle-mounted Bluetooth device establishes a Bluetooth connection with a first terminal, the vehicle-mounted Bluetooth device obtains the context of the first terminal; the vehicle-mounted Bluetooth device adds the first terminal to a list of discovered devices based on the context of the first terminal, and the list of discovered devices also includes the vehicle-mounted Bluetooth device; the vehicle-mounted Bluetooth device receives a connection request from a second terminal to establish a Bluetooth connection with the first terminal; in response to the connection request, the vehicle-mounted Bluetooth device establishes a Bluetooth connection between the second terminal and the first terminal.
[0007] Optionally, the in-vehicle Bluetooth device includes an application layer and an RFCOMM layer, and the in-vehicle Bluetooth device obtains the context of the first terminal, including: the application layer sends a context acquisition request #1 to the first terminal through the RFCOMM layer, and the context acquisition request #1 is used to request the first terminal to provide its own context; the application layer receives a context acquisition response #1 sent by the first terminal through the RFCOMM layer, and the context acquisition response #1 includes the context of the first terminal, and the context of the first terminal includes the description information of the first terminal, the address of the first terminal, and the security parameters of the first terminal; the application layer saves the context of the first terminal to the application layer. Correspondingly, the in-vehicle Bluetooth device also includes an SDP layer, and the in-vehicle Bluetooth device adds the first terminal to the list of discovered devices according to the context of the first terminal, including: the application layer obtains the description information of the first terminal in the context of the first terminal; the application layer adds the description information of the first terminal to the list of discovered devices in the SDP layer; the application layer instructs the SDP layer to broadcast the list of discovered devices.
[0008] Optionally, the context acquisition request #1 is specifically used to request the first terminal to provide at least one of the following: a description of the first terminal itself, the air interface information of the first terminal itself, and the AS layer security parameters of the first terminal itself; accordingly, the description information of the first terminal in the context of the first terminal is: the description information provided by the first terminal in response to requesting the first terminal to provide its own description; the address of the first terminal in the context of the first terminal is: the device address on the air interface side provided by the first device in response to requesting the first terminal to provide its own air interface information; the security parameters of the first terminal in the context of the first terminal are: the confidentiality key #1 and integrity protection key #1 of the AS layer provided by the first terminal in response to requesting the first terminal to provide its own AS layer security parameters, the confidentiality key #1 is used by the first terminal to encrypt and decrypt data transmitted by the first terminal over the air interface, and the integrity protection key #1 is used by the first terminal to perform integrity protection and integrity protection verification on data transmitted by the first terminal over the air interface.
[0009] Optionally, the vehicle-mounted Bluetooth device receives a connection request from the second terminal requesting to establish a Bluetooth connection with the first terminal, including: the application layer receives the connection request from the second terminal through the RFCOMM layer, the connection request includes the device identifier of the second terminal and the description information of the first terminal, which is used to indicate that the second terminal requests to establish a Bluetooth connection with the first terminal; accordingly, in response to the connection request, the vehicle-mounted Bluetooth device establishes a Bluetooth connection between the second terminal and the first terminal, including: in response to the connection request, the application layer establishes a Bluetooth connection between the vehicle-mounted Bluetooth device and the second terminal through the RFCOMM layer, and associates the Bluetooth connection between the vehicle-mounted Bluetooth device and the second terminal with the first terminal to indicate that a Bluetooth connection has been established between the second terminal and the first terminal.
[0010] Optionally, in the case of a Bluetooth connection between the vehicle-mounted Bluetooth device and the second terminal, the method also includes: the application layer sends a context acquisition request #2 to the second terminal through the RFCOMM layer, and the context acquisition request #2 is used to request the second terminal to provide its own context; the application layer receives a context acquisition response #2 sent by the second terminal through the RFCOMM layer, and the context acquisition response #2 includes the context of the second terminal, and the context of the second terminal includes description information of the second terminal, the address of the second terminal and security parameters of the second terminal; the application layer saves the context of the second terminal to the application layer.
[0011] Optionally, when the in-vehicle Bluetooth device is connected to the second terminal through Bluetooth, the method further includes: the in-vehicle Bluetooth device adding the second terminal to a list of discovered devices according to the context of the second terminal.
[0012] Optionally, context acquisition request #2 is specifically used to request the second terminal to provide at least one of the following: a description of the second terminal itself, the air interface information of the second terminal itself, and the AS layer security parameters of the second terminal itself; accordingly, the description information of the second terminal in the context of the second terminal is: the description information provided by the second terminal in response to requesting the second terminal to provide its own description; the address of the second terminal in the context of the second terminal is: the device address on the air interface side provided by the second device in response to requesting the first terminal to provide its own air interface information; the security parameters of the second terminal in the context of the second terminal are: the AS layer confidentiality key #2 and integrity protection key #2 provided by the second terminal in response to requesting the second terminal to provide its own AS layer security parameters, confidentiality key #2 is used by the second terminal to encrypt and decrypt data transmitted by the second terminal over the air interface, and integrity protection key #2 is used by the second terminal to perform integrity protection and integrity protection verification on data transmitted by the second terminal over the air interface.
[0013] Optionally, the method also includes: the application layer receives data from the second terminal through the RFCOMM layer; in response to the Bluetooth connection between the vehicle-mounted Bluetooth device and the second terminal being associated with the first terminal, the application layer sends the data of the second terminal to the first terminal through the RFCOMM layer.
[0014] Optionally, the application layer receives data from the second terminal through the RFCOMM layer, including: the application layer receives encrypted data #1 and the integrity protection value MAC#1 of the encrypted data #1 from the second terminal through the RFCOMM layer; the application layer uses the encrypted data #1 and the integrity protection key #2 to generate the integrity verification value MAC#2 of the encrypted data #1; the application layer verifies whether the integrity protection value MAC#1 is consistent with the integrity verification value MAC#2; when the integrity protection value MAC#1 is consistent with the integrity verification value MAC#2, the application layer uses the confidentiality key #2 to decrypt the encrypted data #1 to obtain the plaintext data.
[0015] Optionally, the application layer sends data of the second terminal to the first terminal through the RFCOMM layer, including: the application layer uses confidentiality key #1 to encrypt plain text data to obtain encrypted data #2; the application layer uses encrypted data #2 and integrity protection key #1 to generate integrity protection value MAC #3 of encrypted data #2; the application layer sends encrypted data #2 and integrity protection value MAC #3 to the first terminal through the RFCOMM layer.
[0016] In a second aspect, a device for interconnecting multiple devices based on vehicle-mounted Bluetooth is provided, wherein the device is configured to execute the method described in the first aspect.
[0017] In a third aspect, an electronic device is provided, comprising: a processor and a memory; the memory is used to store a computer program, and when the processor executes the computer program, the electronic device executes the method described in the first aspect.
[0018] In a possible design solution, the electronic device described in the third aspect may further include a transceiver. The transceiver may be a transceiver circuit or an interface circuit. The transceiver may be used for the electronic device described in the third aspect to communicate with other electronic devices.
[0019] In an embodiment of the present invention, the electronic device described in the third aspect may be a terminal, or a chip (system) or other parts or components that may be arranged in the terminal, or a system including the terminal.
[0020] In a fourth aspect, a computer-readable storage medium is provided, comprising: a computer program or instructions; when the computer program or instructions are executed on a computer, the computer is caused to execute the method described in the first aspect.
[0021] In summary, the above method and system have the following technical effects: When the vehicle-mounted Bluetooth device establishes a Bluetooth connection with the first terminal, the vehicle-mounted Bluetooth device can obtain the context of the first terminal to add the first terminal to the list of discovered devices based on the context of the first terminal. In this way, when other devices (such as the second terminal) discover devices through Bluetooth, they can not only discover the vehicle-mounted Bluetooth device, but also discover the first terminal, so as to establish a Bluetooth connection with the first terminal through the vehicle-mounted Bluetooth device, so that the first terminal and the second terminal can interact through the Bluetooth connection of the vehicle-mounted Bluetooth device, that is, multiple devices can be interconnected and interacted through the vehicle-mounted Bluetooth to meet higher user needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic diagram of a communication system provided by an embodiment of the present invention; Figure 2A schematic diagram of a protocol stack in a communication system provided by an embodiment of the present invention; Figure 3 A flow chart of a method for interconnecting multiple devices based on vehicle-mounted Bluetooth provided in an embodiment of the present invention; Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The technical solution of the present invention will be described below in conjunction with the accompanying drawings.
[0024] In the embodiment of the present invention, "indication" may include direct indication and indirect indication, and may also include explicit indication and implicit indication. The information indicated by a certain information is called information to be indicated. In the specific implementation process, there are many ways to indicate the information to be indicated, such as but not limited to, the information to be indicated can be directly indicated, such as the information to be indicated itself or the index of the information to be indicated. The information to be indicated can also be indirectly indicated by indicating other information, wherein there is an association relationship between the other information and the information to be indicated. It is also possible to indicate only a part of the information to be indicated, while the other parts of the information to be indicated are known or agreed in advance. For example, the indication of specific information can also be achieved by means of the arrangement order of each information agreed in advance (for example, specified by the protocol), thereby reducing the indication overhead to a certain extent. At the same time, the common parts of each information can also be identified and indicated uniformly to reduce the indication overhead caused by indicating the same information separately.
[0025] In addition, the specific indication method may also be various existing indication methods, such as but not limited to the above-mentioned indication methods and various combinations thereof. The specific details of the various indication methods can refer to the prior art and will not be repeated herein. As can be seen from the above, for example, when it is necessary to indicate multiple information of the same type, different indication methods may be used for different information. In the specific implementation process, the desired indication method can be selected according to specific needs. The embodiment of the present invention does not limit the selected indication method. In this way, the indication method involved in the embodiment of the present invention should be understood to cover various methods that can enable the party to be indicated to obtain the information to be indicated.
[0026] It should be understood that the information to be indicated can be sent as a whole or divided into multiple sub-information and sent separately, and the sending period and / or sending time of these sub-information can be the same or different. The specific sending method is not limited in the embodiment of the present invention. Among them, the sending period and / or sending time of these sub-information can be pre-defined, for example, pre-defined according to a protocol, or can be configured by the sending end device by sending configuration information to the receiving end device.
[0027] "Pre-definition" or "pre-configuration" can be implemented by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in the device, and the embodiments of the present invention do not limit the specific implementation method. Among them, "saving" can mean saving in one or more memories. The one or more memories can be set separately or integrated in an encoder or decoder, a processor, or an electronic device. The one or more memories can also be partially set separately and partially integrated in a decoder, a processor, or an electronic device. The type of memory can be any form of storage medium, which is not limited by the embodiments of the present invention.
[0028] The "protocol" involved in the embodiments of the present invention may refer to a protocol family in the communication field, a standard protocol with a similar protocol family frame structure, or a related protocol used in a method system for interconnecting multiple devices based on vehicle-mounted Bluetooth in the future. The embodiments of the present invention do not specifically limit this.
[0029] In the embodiments of the present invention, descriptions such as "when...", "in the case of...", "if" and "if" all mean that the device will perform corresponding processing under certain objective circumstances, but do not limit the time, nor do they require the device to perform judgment actions when implementing, nor do they mean the existence of other limitations.
[0030] In the description of the embodiments of the present invention, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in the embodiments of the present invention is only a kind of association relationship describing the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. In addition, in the description of the embodiments of the present invention, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solution of the embodiments of the present invention, in the embodiments of the present invention, the words "first" and "second" are used to distinguish the same or similar items with basically the same functions and effects. Those skilled in the art will appreciate that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference. At the same time, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0031] The network architecture and business scenarios described in the embodiments of the present invention are intended to more clearly illustrate the technical solutions of the embodiments of the present invention, and do not constitute a limitation on the technical solutions provided by the embodiments of the present invention. A person of ordinary skill in the art can appreciate that with the evolution of the network architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present invention are equally applicable to similar technical problems.
[0032] To facilitate understanding of the embodiments of the present application, first Figure 1 The communication system shown in the figure is used as an example to describe in detail the communication system applicable to the embodiments of the present application.
[0033] Figure 1 A schematic diagram of the architecture of a communication system applicable to the ship-based multi-link fusion communication method provided in the embodiment of the present application. Figure 1 As shown, the communication system includes: one or more terminals (such as a first terminal and a second terminal) and a vehicle-mounted Bluetooth device.
[0034] The terminal may be a terminal device with transceiver and processing functions, or a chip or chip system that can be set in the terminal device. The terminal device may also be called user equipment (UE), access terminal equipment, subscriber unit (subscriberunit), user station, mobile station (MS), mobile station, remote station, remote terminal equipment, mobile equipment, user terminal equipment, terminal equipment, wireless communication equipment, user agent or user device. The terminal device in the embodiments of the present application can be a mobile phone, a cellular phone, a smart phone, a tablet computer, a wireless data card, a personal digital assistant (PDA), a wireless modem, a handset, a laptop computer, a machine type communication (MTC) terminal device, a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal device in industrial control, a wireless terminal device in self driving, a wireless terminal device in remote medical, a wireless terminal device in smart grid, a wireless terminal device in transportation safety, a wireless terminal device in smart city, a wireless terminal device in smart home, a vehicle-mounted terminal device, a road side unit (RSU) with terminal device function, etc. The terminal device of the present application may also be a vehicle-mounted module, a vehicle-mounted module, a vehicle-mounted component, a vehicle-mounted chip or a vehicle-mounted unit built into a vehicle as one or more components or units. Or the terminal device may also be a customer-premises equipment (CPE).
[0035] The in-vehicle Bluetooth device can be a part of the vehicle computer. Figure 4As shown in the figure, the protocol stack of the in-vehicle Bluetooth device mainly includes the application layer, RFCOMM layer, SDP layer, L2CAP layer and radio frequency. The application layer has added functions. The application layer can interact with the terminal connected to Bluetooth to obtain the context of the terminal and save it in the application layer. In this way, the application layer can use the context of the terminal and add the terminal to the list of discovered devices in the SDP layer, so that the terminal can be discovered as a Bluetooth device by other terminals and connected and interacted with them through the in-vehicle Bluetooth device.
[0036] Figure 3 This is a flow chart of the method provided by an embodiment of the present invention. The method for interconnecting multiple devices based on in-vehicle Bluetooth can be applied to in-vehicle Bluetooth devices. The specific process is as follows: S301: When a vehicle-mounted Bluetooth device establishes a Bluetooth connection with a first terminal, the vehicle-mounted Bluetooth device obtains a context of the first terminal.
[0037] The application layer sends a context acquisition request #1 to the first terminal through the RFCOMM layer, which can also be considered as sending a context acquisition request #1 to the first terminal through the Bluetooth connection established between the vehicle-mounted Bluetooth device and the first terminal. The context acquisition request #1 is encapsulated as an RFCOMM message through the RFCOMM layer, and then sent out through the L2CAP layer and the radio frequency in turn. The context acquisition request #1 is used to request the first terminal to provide its own context. Afterwards, the application layer receives the context acquisition response #1 sent by the first terminal through the RFCOMM layer, which can also be considered as receiving the context acquisition response #1 through the Bluetooth connection established between the vehicle-mounted Bluetooth device and the first terminal. The context response request #1 is first received and demodulated through the radio frequency, and then passed to the application layer through the L2CAP and RFCOMM layers in turn. The context acquisition response #1 includes the context of the first terminal, and the context of the first terminal includes the description information of the first terminal, the address of the first terminal, and the security parameters of the first terminal. The application layer saves the context of the first terminal to the application layer.
[0038] Specifically, the context acquisition request #1 is specifically used to request the first terminal to provide at least one of the following: a description of the first terminal itself, the air interface information of the first terminal itself, and the AS layer security parameters of the first terminal itself. Accordingly, the description information of the first terminal in the context of the first terminal is: the description information provided by the first terminal in response to requesting the first terminal to provide its own description, such as describing the first terminal as XX mobile phone of XX user, XX model mobile phone, etc.; the address of the first terminal in the context of the first terminal is: the device address on the air interface side provided by the first device in response to requesting the first terminal to provide its own air interface information, that is, the air interface transmission address of the first terminal can be reused to realize Bluetooth transmission to save overhead; the security parameters of the first terminal in the context of the first terminal are: the first terminal provides the AS layer confidentiality key #1 and integrity protection key #1 in response to requesting the first terminal to provide its own access layer (Access-stratum, AS layer) security parameters. The confidentiality key #1 is used by the first terminal to detect the first terminal on the air interface (such as the new air interface (new Integrity protection key #1 is used by the first terminal to perform integrity protection and integrity protection verification on the data transmitted by the first terminal over the air interface. That is to say, due to the increase of the application layer, the application layer can save more information about the terminal, so that the terminal can provide the security parameters of the air interface side to the application layer through the Bluetooth security connection for security protection of subsequent Bluetooth connection communications. In addition, since the AS layer security parameters of the terminal will be updated as the terminal moves, such as cell switching / reselection, the terminal can synchronize the latest AS layer security parameters to the application layer, thereby ensuring that the security parameters for security protection of Bluetooth connection communications can also be updated synchronously, thereby improving communication security.
[0039] S302: The in-vehicle Bluetooth device adds the first terminal to a discovered device list according to the context of the first terminal, and the discovered device list also includes the in-vehicle Bluetooth device.
[0040] The application layer can obtain the description information of the first terminal in the context of the first terminal. The application layer adds the description information of the first terminal to the list of discovered devices in the SDP layer, and the application layer instructs the SDP layer to broadcast the list of discovered devices. It can also be considered that the list of discovered devices is broadcasted through the radio frequency of the vehicle-mounted Bluetooth device, that is, the SDP layer sends the list of discovered devices through the L2CAP layer and the radio frequency in sequence.
[0041] S303: The in-vehicle Bluetooth device receives a connection request from the second terminal to establish a Bluetooth connection with the first terminal.
[0042] The application layer may receive a connection request from the second terminal through the RFCOMM layer. For example, the connection request is first received and demodulated through the radio frequency, and then passed to the application layer through the L2CAP and RFCOMM layers in sequence. The connection request may include the description information of the first terminal, the device identifier of the second terminal, to indicate that the second terminal requests to establish a Bluetooth connection with the first terminal, that is, the second terminal selects the first terminal according to the broadcasted list of discovered devices, thereby providing the description information of the first terminal to the vehicle-mounted Bluetooth device to indicate that it wants to interact with the first terminal.
[0043] S304: In response to the connection request, the in-vehicle Bluetooth device establishes a Bluetooth connection between the second terminal and the first terminal.
[0044] In response to the connection request, the application layer establishes a Bluetooth connection between the vehicle-mounted Bluetooth device and the second terminal through the RFCOMM layer, and associates the Bluetooth connection between the vehicle-mounted Bluetooth device and the second terminal with the first terminal and the identifier of the first terminal to indicate that the second terminal has established a Bluetooth connection with the first terminal. In other words, the vehicle-mounted Bluetooth device still establishes a Bluetooth connection with the second terminal normally, but associates the Bluetooth connection with the first terminal, so that when data is received from the second terminal, it can send the data to the first terminal according to the association relationship, which is described in detail below.
[0045] Optionally, when the vehicle-mounted Bluetooth device is connected to the second terminal via Bluetooth, the method further includes: The application layer can send a context acquisition request #2 to the second terminal through the RFCOMM layer. The context acquisition request #2 is used to request the second terminal to provide its own context. The context acquisition request #2 is specifically used to request the second terminal to provide at least one of the following: a description of the second terminal itself, the air interface information of the second terminal itself, and the AS layer security parameters of the second terminal itself. The specific principle is similar to the above-mentioned context acquisition request #1, which can be understood by reference and will not be repeated here.
[0046] The application layer can also receive the context acquisition response #2 sent by the second terminal through the RFCOMM layer. The context acquisition response #2 includes the context of the second terminal. The context of the second terminal includes the description information of the second terminal, the address of the second terminal, and the security parameters of the second terminal. For example, the description information of the second terminal in the context of the second terminal is: the description information provided by the second terminal in response to requesting the second terminal to provide its own description; the address of the second terminal in the context of the second terminal is: the device address of the air interface side provided by the second device in response to requesting the first terminal to provide its own air interface information; the security parameters of the second terminal in the context of the second terminal are: the confidentiality key #2 and integrity protection key #2 of the AS layer provided by the second terminal in response to requesting the second terminal to provide its own AS layer security parameters. The confidentiality key #2 is used by the second terminal to encrypt and decrypt the data transmitted by the second terminal on the air interface, and the integrity protection key #2 is used by the second terminal to perform integrity protection and integrity protection verification on the data transmitted by the second terminal on the air interface. The specific principle is similar to the above-mentioned context acquisition request #2, which can be understood by reference and will not be repeated here.
[0047] The application layer saves the context of the second terminal to the application layer.
[0048] Thus, the method further comprises: The application layer receives data from the second terminal through the RFCOMM layer. The data can be pictures, videos, audio, etc. without limitation. The application layer receives data from the second terminal through the RFCOMM layer, which can also be considered as receiving the data of the second terminal through the Bluetooth connection established between the vehicle-mounted Bluetooth device and the second terminal. The data of the second terminal is first received and demodulated through radio frequency, and then passed to the application layer through L2CAP and RFCOMM layers in sequence.
[0049] Specifically, the application layer can receive the encrypted data #1 and the integrity protection value MAC#1 of the encrypted data #1 from the second terminal through the RFCOMM layer. That is, since the second terminal provides its own AS layer security parameters to the application layer, when sending data to the application layer, the second terminal also knows that the AS layer security parameters need to be used to perform security protection on the data, and obtains the encrypted data #1 and the integrity protection value MAC#1 of the encrypted data #1. The application layer can use the encrypted data #1 and the integrity protection key #2 to generate the integrity verification value MAC#2 of the encrypted data #1. For example, the encrypted data #1 is used as an input parameter, and the input parameter is calculated using the integrity protection key #2 to obtain the integrity verification value MAC#2 of the encrypted data #1. The application layer verifies whether the integrity protection value MAC#1 is consistent with the integrity verification value MAC#2; if the integrity protection value MAC#1 is consistent with the integrity verification value MAC#2, the application layer uses the confidentiality key #2 to decrypt the encrypted data #1 to obtain the plaintext data, otherwise, the application layer discards the encrypted data #1.
[0050] In response to the Bluetooth connection between the vehicle-mounted Bluetooth device and the second terminal being associated with the first terminal, the application layer sends the data of the second terminal to the first terminal through the RFCOMM layer. The application layer sending the data of the second terminal to the first terminal through the RFCOMM layer can also be considered as sending the data of the second terminal to the first terminal through the Bluetooth connection established between the vehicle-mounted Bluetooth device and the first terminal. The data of the second terminal is encapsulated as an RFCOMM message through the RFCOMM layer, and then sent out through the L2CAP layer and the radio frequency in sequence. Specifically, the application layer encrypts the plaintext data using the confidentiality key #1 to obtain the encrypted data #2; the application layer uses the encrypted data #2 and the integrity protection key #1 to generate the integrity protection value MAC#3 of the encrypted data #2; the application layer sends the encrypted data #2 and the integrity protection value MAC#3 to the first terminal through the RFCOMM layer, and the first terminal receives the encrypted data #2 and the integrity protection value MAC#3. The way to decrypt the security protection is similar to that of the vehicle-mounted Bluetooth device, which can be understood by reference and will not be repeated here.
[0051] Optionally, the in-vehicle Bluetooth device adds the second terminal to the list of discovered devices according to the context of the second terminal.
[0052] In summary: when the vehicle-mounted Bluetooth device establishes a Bluetooth connection with the first terminal, the vehicle-mounted Bluetooth device can obtain the context of the first terminal to add the first terminal to the list of discovered devices based on the context of the first terminal. In this way, when other devices (such as the second terminal) discover devices through Bluetooth, they can not only discover the vehicle-mounted Bluetooth device, but also discover the first terminal, so as to establish a Bluetooth connection with the first terminal through the vehicle-mounted Bluetooth device, so that the first terminal and the second terminal can interact through the Bluetooth connection of the vehicle-mounted Bluetooth device, that is, multiple devices can be interconnected and interacted through the vehicle-mounted Bluetooth to meet higher user needs.
[0053] Combination of the above Figure 3 The method provided by the embodiment of the present invention is described in detail. The following is a detailed description of a device for implementing the method provided by the embodiment of the present invention based on vehicle-mounted Bluetooth to interconnect multiple devices. The device is applied to a vehicle-mounted Bluetooth device, and the device is configured as follows: when the vehicle-mounted Bluetooth device establishes a Bluetooth connection with a first terminal, the vehicle-mounted Bluetooth device obtains the context of the first terminal; the vehicle-mounted Bluetooth device adds the first terminal to a list of discovered devices according to the context of the first terminal, and the list of discovered devices also includes the vehicle-mounted Bluetooth device; the vehicle-mounted Bluetooth device receives a connection request from a second terminal to establish a Bluetooth connection with the first terminal; in response to the connection request, the vehicle-mounted Bluetooth device establishes a Bluetooth connection between the second terminal and the first terminal.
[0054] Optionally, the in-vehicle Bluetooth device includes an application layer and an RFCOMM layer, and the in-vehicle Bluetooth device obtains the context of the first terminal, including: the application layer sends a context acquisition request #1 to the first terminal through the RFCOMM layer, and the context acquisition request #1 is used to request the first terminal to provide its own context; the application layer receives a context acquisition response #1 sent by the first terminal through the RFCOMM layer, and the context acquisition response #1 includes the context of the first terminal, and the context of the first terminal includes the description information of the first terminal, the address of the first terminal, and the security parameters of the first terminal; the application layer saves the context of the first terminal to the application layer. Correspondingly, the in-vehicle Bluetooth device also includes an SDP layer, and the in-vehicle Bluetooth device adds the first terminal to the list of discovered devices according to the context of the first terminal, including: the application layer obtains the description information of the first terminal in the context of the first terminal; the application layer adds the description information of the first terminal to the list of discovered devices in the SDP layer; the application layer instructs the SDP layer to broadcast the list of discovered devices.
[0055] Optionally, the context acquisition request #1 is specifically used to request the first terminal to provide at least one of the following: a description of the first terminal itself, the air interface information of the first terminal itself, and the AS layer security parameters of the first terminal itself; accordingly, the description information of the first terminal in the context of the first terminal is: the description information provided by the first terminal in response to requesting the first terminal to provide its own description; the address of the first terminal in the context of the first terminal is: the device address on the air interface side provided by the first device in response to requesting the first terminal to provide its own air interface information; the security parameters of the first terminal in the context of the first terminal are: the confidentiality key #1 and integrity protection key #1 of the AS layer provided by the first terminal in response to requesting the first terminal to provide its own AS layer security parameters, the confidentiality key #1 is used by the first terminal to encrypt and decrypt data transmitted by the first terminal over the air interface, and the integrity protection key #1 is used by the first terminal to perform integrity protection and integrity protection verification on data transmitted by the first terminal over the air interface.
[0056] Optionally, the vehicle-mounted Bluetooth device receives a connection request from the second terminal requesting to establish a Bluetooth connection with the first terminal, including: the application layer receives the connection request from the second terminal through the RFCOMM layer, the connection request includes the device identifier of the second terminal and the description information of the first terminal, which is used to indicate that the second terminal requests to establish a Bluetooth connection with the first terminal; accordingly, in response to the connection request, the vehicle-mounted Bluetooth device establishes a Bluetooth connection between the second terminal and the first terminal, including: in response to the connection request, the application layer establishes a Bluetooth connection between the vehicle-mounted Bluetooth device and the second terminal through the RFCOMM layer, and associates the Bluetooth connection between the vehicle-mounted Bluetooth device and the second terminal with the first terminal to indicate that a Bluetooth connection has been established between the second terminal and the first terminal.
[0057] Optionally, when the vehicle-mounted Bluetooth device is connected to the second terminal through Bluetooth, the device is configured as follows: the application layer sends a context acquisition request #2 to the second terminal through the RFCOMM layer, and the context acquisition request #2 is used to request the second terminal to provide its own context; the application layer receives a context acquisition response #2 sent by the second terminal through the RFCOMM layer, and the context acquisition response #2 includes the context of the second terminal, and the context of the second terminal includes description information of the second terminal, the address of the second terminal and security parameters of the second terminal; the application layer saves the context of the second terminal to the application layer.
[0058] Optionally, when the in-vehicle Bluetooth device is connected to the second terminal through Bluetooth, the apparatus is configured as follows: the in-vehicle Bluetooth device adds the second terminal to a list of discovered devices according to the context of the second terminal.
[0059] Optionally, context acquisition request #2 is specifically used to request the second terminal to provide at least one of the following: a description of the second terminal itself, the air interface information of the second terminal itself, and the AS layer security parameters of the second terminal itself; accordingly, the description information of the second terminal in the context of the second terminal is: the description information provided by the second terminal in response to requesting the second terminal to provide its own description; the address of the second terminal in the context of the second terminal is: the device address on the air interface side provided by the second device in response to requesting the first terminal to provide its own air interface information; the security parameters of the second terminal in the context of the second terminal are: the AS layer confidentiality key #2 and integrity protection key #2 provided by the second terminal in response to requesting the second terminal to provide its own AS layer security parameters, confidentiality key #2 is used by the second terminal to encrypt and decrypt data transmitted by the second terminal over the air interface, and integrity protection key #2 is used by the second terminal to perform integrity protection and integrity protection verification on data transmitted by the second terminal over the air interface.
[0060] Optionally, the device is configured as follows: the application layer receives data from the second terminal through the RFCOMM layer; in response to the Bluetooth connection between the vehicle-mounted Bluetooth device and the second terminal being associated with the first terminal, the application layer sends the data of the second terminal to the first terminal through the RFCOMM layer.
[0061] Optionally, the application layer receives data from the second terminal through the RFCOMM layer, including: the application layer receives encrypted data #1 and the integrity protection value MAC#1 of the encrypted data #1 from the second terminal through the RFCOMM layer; the application layer uses the encrypted data #1 and the integrity protection key #2 to generate the integrity verification value MAC#2 of the encrypted data #1; the application layer verifies whether the integrity protection value MAC#1 is consistent with the integrity verification value MAC#2; when the integrity protection value MAC#1 is consistent with the integrity verification value MAC#2, the application layer uses the confidentiality key #2 to decrypt the encrypted data #1 to obtain the plaintext data.
[0062] Optionally, the application layer sends data of the second terminal to the first terminal through the RFCOMM layer, including: the application layer uses confidentiality key #1 to encrypt plain text data to obtain encrypted data #2; the application layer uses encrypted data #2 and integrity protection key #1 to generate integrity protection value MAC #3 of encrypted data #2; the application layer sends encrypted data #2 and integrity protection value MAC #3 to the first terminal through the RFCOMM layer.
[0063] Figure 4 The schematic diagram of the structure of the electronic device provided by the embodiment of the present invention. For example, the electronic device may be a network device, or a chip (system) or other components or assemblies that can be set in the network device. Figure 4As shown, the electronic device 400 may include a processor 401. Optionally, the electronic device 400 may further include a memory 402 and / or a transceiver 403. The processor 401 is coupled with the memory 402 and the transceiver 403, such as being connected via a communication bus.
[0064] Combine the following Figure 4 The components of the electronic device 400 are described in detail: The processor 401 is the control center of the electronic device 400, and may be a processor or a general term for multiple processing elements. For example, the processor 401 is one or more central processing units (CPUs), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (field programmable gate arrays, FPGAs).
[0065] Optionally, the processor 401 can execute various functions of the electronic device 400 by running or executing the software program stored in the memory 402 and calling the data stored in the memory 402, such as executing the above Figure 3 The method shown is to realize the interconnection of multiple devices based on vehicle-mounted Bluetooth.
[0066] In a specific implementation, as an embodiment, the processor 401 may include one or more CPUs, such as Figure 4 CPU0 and CPU1 are shown in FIG.
[0067] In a specific implementation, as an embodiment, the electronic device 400 may also include multiple processors. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0068] The memory 402 is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor 401. The specific implementation method can refer to the above method embodiment, which will not be repeated here.
[0069] Optionally, the memory 402 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 402 may be integrated with the processor 401, or may exist independently and accessed through the interface circuit ( Figure 4 The processor 401 is coupled to the processor 401 (not shown), which is not specifically limited in this embodiment of the present invention.
[0070] The transceiver 403 is used for communication with other electronic devices. For example, if the electronic device 400 is a terminal, the transceiver 403 can be used to communicate with a network device, or with another terminal device. For another example, if the electronic device 400 is a network device, the transceiver 403 can be used to communicate with a terminal, or with another network device.
[0071] Optionally, the transceiver 403 may include a receiver and a transmitter ( Figure 4 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.
[0072] Optionally, the transceiver 403 may be integrated with the processor 401, or may exist independently and communicate with the electronic device 400 through an interface circuit ( Figure 4 The processor 401 is coupled to the processor 401 (not shown), which is not specifically limited in this embodiment of the present invention.
[0073] Understandably, Figure 4 The structure of the electronic device 400 shown in the figure does not constitute a limitation on the electronic device, and the actual electronic device may include more or fewer components than those shown in the figure, or combine certain components, or arrange the components differently.
[0074] In addition, the technical effects of the electronic device 400 can refer to the technical effects of the methods described in the above method embodiments, which will not be repeated here.
[0075] It should be understood that the processor in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0076] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM).
[0077] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0078] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0079] In the present invention, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0080] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0081] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0082] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0083] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0084] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0085] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0086] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0087] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for interconnecting multiple devices based on vehicle-mounted Bluetooth, characterized in that: The method is applied to a vehicle-mounted Bluetooth device, and the method comprises: When the in-vehicle Bluetooth device establishes a Bluetooth connection with the first terminal, the in-vehicle Bluetooth device acquires the context of the first terminal; The in-vehicle Bluetooth device adds the first terminal to a discovered device list according to the context of the first terminal, and the discovered device list also includes the in-vehicle Bluetooth device; The in-vehicle Bluetooth device receives a connection request from a second terminal requesting to establish a Bluetooth connection with the first terminal; In response to the connection request, the in-vehicle Bluetooth device establishes a Bluetooth connection between the second terminal and the first terminal.
2. The method according to claim 1, characterized in that The in-vehicle Bluetooth device includes an application layer and an RFCOMM layer, and the in-vehicle Bluetooth device obtains the context of the first terminal, including: The application layer sends a context acquisition request #1 to the first terminal through the RFCOMM layer, where the context acquisition request #1 is used to request the first terminal to provide its own context; The application layer receives, through the RFCOMM layer, a context acquisition response #1 sent by the first terminal, where the context acquisition response #1 includes the context of the first terminal, and the context of the first terminal includes description information of the first terminal, an address of the first terminal, and security parameters of the first terminal; The application layer saves the context of the first terminal to the application layer; Correspondingly, the in-vehicle Bluetooth device further includes an SDP layer, and the in-vehicle Bluetooth device adds the first terminal to a list of discovered devices according to the context of the first terminal, including: The application layer obtains description information of the first terminal in the context of the first terminal; The application layer adds the description information of the first terminal to the discovered device list in the SDP layer; The application layer instructs the SDP layer to broadcast the discovered device list.
3. The method according to claim 2, characterized in that The context acquisition request #1 is specifically used to request the first terminal to provide at least one of the following: a description of the first terminal itself, air interface information of the first terminal itself, and AS layer security parameters of the first terminal itself; Correspondingly, the description information of the first terminal in the context of the first terminal is: the description information provided by the first terminal in response to a request to the first terminal to provide a description of itself; the address of the first terminal in the context of the first terminal is: the device address on the air interface side provided by the first device in response to a request to the first terminal to provide its own air interface information; the security parameters of the first terminal in the context of the first terminal are: the confidentiality key #1 and integrity protection key #1 of the AS layer provided by the first terminal in response to a request to the first terminal to provide its own AS layer security parameters, the confidentiality key #1 is used by the first terminal to encrypt and decrypt data transmitted by the first terminal over the air interface, and the integrity protection key #1 is used by the first terminal to perform integrity protection and integrity protection verification on data transmitted by the first terminal over the air interface.
4. The method according to claim 3, characterized in that: The in-vehicle Bluetooth device receives a connection request from a second terminal to establish a Bluetooth connection with the first terminal, including: The application layer receives a connection request from the second terminal through the RFCOMM layer, where the connection request includes a device identifier of the second terminal and description information of the first terminal, indicating that the second terminal requests to establish a Bluetooth connection with the first terminal; Correspondingly, in response to the connection request, the in-vehicle Bluetooth device establishes a Bluetooth connection between the second terminal and the first terminal, including: In response to the connection request, the application layer establishes a Bluetooth connection between the vehicle-mounted Bluetooth device and the second terminal through the RFCOMM layer, and associates the Bluetooth connection between the vehicle-mounted Bluetooth device and the second terminal with the first terminal to indicate that the second terminal has established a Bluetooth connection with the first terminal.
5. The method according to claim 4, characterized in that In the case where the vehicle-mounted Bluetooth device is connected to the second terminal through Bluetooth, the method further includes: The application layer sends a context acquisition request #2 to the second terminal through the RFCOMM layer, where the context acquisition request #2 is used to request the second terminal to provide its own context; The application layer receives, through the RFCOMM layer, a context acquisition response #2 sent by the second terminal, where the context acquisition response #2 includes the context of the second terminal, and the context of the second terminal includes description information of the second terminal, an address of the second terminal, and security parameters of the second terminal; The application layer saves the context of the second terminal to the application layer.
6. The method according to claim 5, characterized in that In the case where the vehicle-mounted Bluetooth device is connected to the second terminal through Bluetooth, the method further includes: The in-vehicle Bluetooth device adds the second terminal to a discovered device list according to the context of the second terminal.
7. The method according to claim 6, characterized in that The context acquisition request #2 is specifically used to request the second terminal to provide at least one of the following: a description of the second terminal itself, air interface information of the second terminal itself, and AS layer security parameters of the second terminal itself; Correspondingly, the description information of the second terminal in the context of the second terminal is: the description information provided by the second terminal in response to requesting the second terminal to provide its own description; the address of the second terminal in the context of the second terminal is: the device address on the air interface side provided by the second device in response to requesting the first terminal to provide its own air interface information; the security parameters of the second terminal in the context of the second terminal are: the AS layer confidentiality key #2 and integrity protection key #2 provided by the second terminal in response to requesting the second terminal to provide its own AS layer security parameters, the confidentiality key #2 is used by the second terminal to encrypt and decrypt data transmitted by the second terminal over the air interface, and the integrity protection key #2 is used by the second terminal to perform integrity protection and integrity protection verification on data transmitted by the second terminal over the air interface.
8. The method according to claim 7, characterized in that The method further comprises: The application layer receives data from the second terminal through the RFCOMM layer; In response to the Bluetooth connection between the in-vehicle Bluetooth device and the second terminal being associated with the first terminal, the application layer sends the data of the second terminal to the first terminal through the RFCOMM layer.
9. The method according to claim 8, characterized in that The application layer receives data from the second terminal through the RFCOMM layer, including: The application layer receives the encrypted data #1 and the integrity protection value MAC #1 of the encrypted data #1 from the second terminal through the RFCOMM layer; The application layer generates an integrity verification value MAC#2 of the encrypted data #1 using the encrypted data #1 and the integrity protection key #2; The application layer verifies whether the integrity protection value MAC#1 is consistent with the integrity verification value MAC#2; When the integrity protection value MAC#1 is consistent with the integrity verification value MAC#2, the application layer uses the confidentiality key #2 to decrypt the encrypted data #1 to obtain plaintext data.
10. The method according to claim 9, characterized in that The application layer sends the data of the second terminal to the first terminal through the RFCOMM layer, including: The application layer encrypts the plaintext data using the confidentiality key #1 to obtain encrypted data #2; The application layer generates an integrity protection value MAC#3 of the encrypted data #2 using the encrypted data #2 and the integrity protection key #1; The application layer sends the encrypted data #2 and the integrity protection value MAC #3 to the first terminal through the RFCOMM layer.