CN117676928A - Connection method of vehicle machine and terminal equipment, vehicle and storage medium - Google Patents
Connection method of vehicle machine and terminal equipment, vehicle and storage medium Download PDFInfo
- Publication number
- CN117676928A CN117676928A CN202311549728.5A CN202311549728A CN117676928A CN 117676928 A CN117676928 A CN 117676928A CN 202311549728 A CN202311549728 A CN 202311549728A CN 117676928 A CN117676928 A CN 117676928A
- Authority
- CN
- China
- Prior art keywords
- terminal equipment
- connection
- terminal device
- vehicle
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 238000004891 communication Methods 0.000 claims abstract description 142
- 230000004044 response Effects 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims 1
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 5
- 230000003993 interaction Effects 0.000 description 5
- 230000002457 bidirectional effect Effects 0.000 description 1
- 239000000470 constituent Substances 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/15—Setup of multiple wireless link connections
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/30—Services specially adapted for particular environments, situations or purposes
- H04W4/40—Services specially adapted for particular environments, situations or purposes for vehicles, e.g. vehicle-to-pedestrians [V2P]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/11—Allocation or use of connection identifiers
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The application discloses a connection method of a vehicle machine and terminal equipment, a vehicle and a storage medium, wherein the method comprises the following steps: acquiring connection information of a first terminal device to be connected; wherein the connection information is wire interface information or wireless address information; judging whether the identification information of the connected second terminal equipment is matched with the connection information of the first terminal equipment; wherein the identification information at least comprises connection information; if not, establishing a communication connection with the first terminal device based on the first line Cheng Jianli based on the first communication channel; the vehicle-mounted device establishes communication connection with the second terminal device based on a second communication channel, the second communication channel is established based on a second thread, and the first thread and the second thread are different. Through the mode, a plurality of terminal devices can be simultaneously in communication connection with the vehicle machine, so that the actual use requirements of different users are met.
Description
Technical Field
The present disclosure relates to the field of vehicle technologies, and in particular, to a method for connecting a vehicle with a terminal device, a vehicle, and a storage medium.
Background
With the development of vehicle-mounted systems, the vehicle-mounted systems of middle-high-grade vehicles can be provided with mobile phone interconnection application functions, such as CarPlay application, android Auto application, hiCar application and the like, through Bluetooth or USB interfaces when leaving factories, and are used for functions of navigation, music, telephones, intelligent voice assistants, videos and the like on automobile sharing terminal equipment.
However, when a second terminal device attempts to establish a connection after one terminal device is connected to the vehicle-mounted system, the currently connected terminal device is disconnected, and it is not possible for the user to establish a connection with the vehicle-mounted system using a plurality of terminal devices at the same time, for example: the user uses the terminal equipment to navigate, and another user wants to use the terminal equipment to connect with the vehicle-mounted system to play music, and the vehicle-mounted system does not support simultaneous connection of multiple devices, so that the requirement of the user cannot be met.
Disclosure of Invention
In order to solve the problems, the application discloses a connection method of a vehicle machine and terminal equipment, a vehicle and a storage medium, and a plurality of terminal equipment can be simultaneously in communication connection with the vehicle machine so as to meet actual use requirements of different users.
The application adopts a technical scheme that: a method for connecting a vehicle with a terminal device is provided. The connection method comprises the following steps: acquiring connection information of a first terminal device to be connected; wherein the connection information is wire interface information or wireless address information; judging whether the identification information of the connected second terminal equipment is matched with the connection information of the first terminal equipment; wherein the identification information at least comprises connection information; if not, establishing a communication connection with the first terminal device based on the first line Cheng Jianli based on the first communication channel; the vehicle-mounted device establishes communication connection with the second terminal device based on a second communication channel, the second communication channel is established based on a second thread, and the first thread and the second thread are different.
The method for obtaining the connection information of the first terminal equipment to be connected comprises the following steps: when the first terminal equipment is connected with the vehicle machine through a USB interface, a USB serial number of the first terminal equipment is obtained as connection information; or when the first terminal equipment is connected with the vehicle machine through Bluetooth, acquiring the Bluetooth address of the first terminal equipment as connection information.
Wherein the method further comprises: acquiring a USB serial number and a Bluetooth address of the second terminal equipment; and combining the USB serial number and the Bluetooth address of the second terminal device to form the identification information of the second terminal device.
When the first terminal device is connected with the vehicle machine through the USB interface, the USB serial number of the first terminal device is obtained as connection information, and the method comprises the following steps: when the first terminal equipment is connected with the vehicle machine through a USB interface, detecting whether the first terminal equipment supports an AOA protocol or not; if yes, sending an authority request to the first terminal equipment; and if receiving response information based on the permission request and sent by the first terminal equipment, acquiring the USB serial number of the first terminal equipment as connection information.
When the first terminal device is connected with the vehicle machine through Bluetooth, the Bluetooth address of the first terminal device is obtained as connection information, and the method comprises the following steps: when the first terminal equipment is connected with the vehicle machine through Bluetooth, an RFCOMM communication channel is established based on an RFCOMM protocol; and acquiring the Bluetooth address of the first terminal equipment as connection information through the RFCOMM communication channel.
Wherein the first communication channel based on the first line Cheng Jianli to establish a communication connection with the first terminal device based on the first communication channel comprises: determining an unused target TCP port; and establishing a first communication channel based on the first thread and the target TCP port, and sending port information of the target TCP port to the first terminal equipment so as to establish communication connection with the first terminal equipment based on the first communication channel.
Wherein, this connection method still includes: marking the first communication channel by adopting the connection information of the first terminal equipment so that the vehicle machine and the first terminal equipment communicate based on the first communication channel; and marking the second communication channel by adopting the connection information of the second terminal equipment so as to enable the vehicle machine and the second terminal equipment to communicate based on the second communication channel.
The first terminal device and the second terminal device are devices based on an android system.
The application adopts another technical scheme that: there is provided a vehicle including: the acquisition module is used for acquiring the connection information of the first terminal equipment to be connected; wherein the connection information is wire interface information or wireless address information; the matching module is used for judging whether the identification information of the connected second terminal equipment is matched with the connection information of the first terminal equipment; wherein the identification information at least comprises connection information; a communication module configured to, when the identification information of the connected second terminal device does not match the connection information of the first terminal device, establish a communication connection with the first terminal device based on the first communication channel based on the first line Cheng Jianli; the vehicle-mounted device establishes communication connection with the second terminal device based on a second communication channel, the second communication channel is established based on a second thread, and the first thread and the second thread are different.
The application adopts another technical scheme that: providing a vehicle comprising a plurality of USB interfaces; the Bluetooth module and the processor are connected with the USB interfaces and the Bluetooth module, and the processor is configured to execute the connection method.
The application adopts another technical scheme that: there is provided a computer readable storage medium having stored therein program data which, when executed by a processor, implements the connection method described above.
The application provides a connection method of a vehicle machine and terminal equipment, a vehicle and a storage medium. The connection method of the vehicle machine and the terminal equipment comprises the following steps: acquiring connection information of a first terminal device to be connected; wherein the connection information is wire interface information or wireless address information; judging whether the identification information of the connected second terminal equipment is matched with the connection information of the first terminal equipment; wherein the identification information at least comprises connection information; if not, establishing a communication connection with the first terminal device based on the first line Cheng Jianli based on the first communication channel; the vehicle-mounted device establishes communication connection with the second terminal device based on a second communication channel, the second communication channel is established based on a second thread, and the first thread and the second thread are different. By the mode, as each terminal device has unique identification information, the vehicle-mounted system can identify a plurality of terminal devices through the identification information, so that the plurality of terminal devices can be distributed with different communication channels for information interaction, the plurality of terminal devices can be simultaneously in communication connection with the vehicle, and the use requirement that different terminal devices can be simultaneously interacted with the vehicle-mounted system of the vehicle is met; in addition, since the two communication channels are respectively implemented by the two threads, the connection requests of different terminal devices can be processed simultaneously, and the different terminal devices are not affected by each other when communicating.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. Wherein:
fig. 1 is a schematic flow chart of a first embodiment of a connection method between a vehicle and a terminal device provided in the present application;
fig. 2 is a schematic flow chart of a second embodiment of a connection method between a vehicle and a terminal device provided in the present application;
fig. 3 is a schematic flow chart of a third embodiment of a connection method between a vehicle and a terminal device provided in the present application;
FIG. 4 is a schematic diagram of a connection according to one embodiment of FIG. 1;
FIG. 5 is a schematic view of an embodiment of a vehicle provided herein;
FIG. 6 is a schematic structural view of another embodiment of a vehicle provided herein;
fig. 7 is a schematic structural diagram of an embodiment of a computer readable storage medium provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the specific embodiments described herein are for purposes of illustration only and are not limiting. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present application are shown in the drawings. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms "first," "second," and the like in this application are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
Referring to fig. 1, fig. 1 is a flowchart of a first embodiment of a connection method for a vehicle and a terminal device, where the connection method includes the following steps:
step S10: acquiring connection information of a first terminal device to be connected; the connection information is wired interface information or wireless address information.
Optionally, step S10 may include, in an embodiment: when the first terminal equipment is connected with the vehicle machine through the USB interface, the USB serial number of the first terminal equipment is obtained as connection information.
Specifically, when the first terminal device is connected with the vehicle machine through the USB interface, detecting whether the first terminal device supports an AOA protocol (Android Open Accessory Protocol); if yes, sending an authority request to the first terminal equipment; and if receiving response information based on the permission request and sent by the first terminal equipment, acquiring the USB serial number of the first terminal equipment as connection information. The AOA protocol is a special Access (Accessory) mode which allows external USB hardware to interact with the android terminal equipment. In the access mode, the USB Accessory serves as a host (controlling reading, writing and enumerating connected devices) and provides power for the android terminal device, so that the USB Accessory can still interact with USB hardware under the condition that the android terminal device cannot serve as the USB host.
Optionally, in an application scenario, the first terminal device is already installed with an Android Auto application. Android Auto is a vehicle-mounted mobile phone interconnection function specially designed for automobiles and launched by google. It can be appreciated that Android Auto can access and access Android terminal device content through a data line connection. Specifically, the first terminal device is connected to the vehicle machine through a USB data line, and the vehicle-mounted system of the vehicle machine detects and identifies whether the first terminal device supports the AOA protocol, where the identifying procedure includes querying a Vendor ID (VID) and a Product ID (PID) of the first terminal device to determine compatibility of the first terminal device. If the first terminal equipment supports the compatible AOA protocol, the vehicle-mounted system sends an Access request to the first terminal equipment to request for communication with the first terminal equipment, and when the first terminal equipment responds to the Access request, the vehicle-mounted system receives response information based on the permission request and sent by the first terminal equipment, and then the USB serial number of the first terminal equipment is obtained as connection information. In addition, when the first terminal equipment enters the access mode, the vehicle-mounted system is used as a main control end for communicating with the first terminal equipment. And the follow-up vehicle-mounted system uses the USB Api provided by the android system to carry out communication control.
Alternatively, step S10 may include, in another embodiment: when the first terminal equipment is connected with the vehicle machine through Bluetooth, the Bluetooth address of the first terminal equipment is obtained as connection information.
Specifically, when the first terminal equipment is connected with the vehicle machine through Bluetooth, an RFCOMM communication channel is established based on a RFCOMM (Radio Frequency Communication) protocol; and acquiring the Bluetooth address of the first terminal equipment as connection information through the RFCOMM communication channel. The RFCOMM is a simple transmission protocol that aims at solving the problem of how to guarantee a complete communication path between applications on two different devices and to maintain a communication segment between them. RFCOMM is only directed to the connection between directly interconnected devices, or the interconnection between a device and a network access device, and the devices at both ends of the communication must be compatible with the RFCOMM protocol.
Optionally, in an application scenario, the first terminal device has installed an Android Auto application. The Bluetooth function is opened respectively by the first terminal equipment and the vehicle machine, and the connection between the first terminal equipment and the vehicle machine is carried out in a Bluetooth pairing mode. Specifically, serial communication may be performed through bluetooth using RFCOMM protocol on the first terminal device. RFCOMM simulates serial port communications and can establish virtual serial connections between different applications, while UUID (Universally Unique Identifier, universally unique identification code) is used to identify a particular service or feature. In bluetooth communications, each bluetooth RFCOMM communication enabled device provides a set of available services and corresponding UUIDs. When the bluetooth RFCOMM connection is established, the first terminal device may determine that the connection should be to the corresponding service or channel of the target device by specifying a specific UUID, so that communication between the devices may be performed based on the channel. In addition, the vehicle-mounted system monitors connection of RFCOMM by using the unique Bluetooth UUID specified by Android Auto, and when the first terminal device is connected on Bluetooth, the first terminal device actively checks whether the Bluetooth of the opposite terminal monitors by using the unique Bluetooth UUID specified by Android Auto, and if so, the first terminal device is connected. Therefore, after the first terminal equipment and the vehicle-mounted system establish a Bluetooth RFCOMM channel, the Bluetooth address of the first terminal equipment is obtained through the channel to serve as connection information. In addition, the channel can be used for message interaction, wherein the message interaction comprises Wi-Fi hot spot addresses of the vehicle-mounted system end and information of corresponding ports.
Optionally, in an embodiment, when acquiring the connection information of the first terminal device, a USB serial number and a bluetooth address of the connected second terminal device are also acquired, and the USB serial number and the bluetooth address of the second terminal device are combined to form the identification information of the second terminal device. It will be appreciated that the USB sequence number and bluetooth address of each terminal device are unique and can be used to distinguish between different terminal devices.
Optionally, in an embodiment, the first terminal device and the second terminal device are android system based devices.
Step S11: judging whether the identification information of the connected second terminal equipment is matched with the connection information of the first terminal equipment; wherein the identification information includes at least connection information.
If not, step S12 is performed.
Alternatively, in an embodiment, the second terminal device has established a connection with the vehicle, at which point the USB serial number and bluetooth address of the second terminal device may be determined. Optionally, when the first terminal device connects to the vehicle machine through the USB interface, it is determined whether the USB serial number of the first terminal device matches with the USB serial number of the connected second terminal device. Optionally, when the first terminal device is connected to the vehicle machine through bluetooth, it is determined whether the bluetooth address of the first terminal device is matched with the bluetooth address of the connected second terminal device.
Step S12: then a first communication channel is established based on the first line Cheng Jianli to establish a communication connection with the first terminal device based on the first communication channel; the vehicle-mounted device establishes communication connection with the second terminal device based on a second communication channel, the second communication channel is established based on a second thread, and the first thread and the second thread are different.
When the first terminal equipment is connected with the vehicle machine through Bluetooth, an unused target TCP (Transmission Control Protocol ) port needs to be determined; and establishing a first communication channel based on the first thread and the target TCP port, and sending port information of the target TCP port to the first terminal equipment so as to establish communication connection with the first terminal equipment based on the first communication channel. Among other things, the TCP protocol is a connection-oriented, reliable, byte stream based communication protocol. That is, a TCP connection is established between the client and the server before exchanging data, so that the data can be transmitted to each other. And provide the functions of timeout retransmission, discarding duplicate data, checking data, flow control, etc., ensuring that data can be transferred from one end to the other.
Optionally, in an embodiment, the first terminal device establishes a specific bluetooth RFCOMM channel through a bluetooth connection vehicle, and in a process of message interaction of the bluetooth RFCOMM channel, an Android Auto of the vehicle-mounted system screens out port information of a currently unoccupied TCP port according to a wireless connection condition, sends the port information to the first terminal device of the opposite terminal, and uses the target TCP port in a subsequent TCP connection. Thus, through the above procedure of wireless connection, different terminal devices use different TCP ports, and different TCP communication channels can be established. After the TCP communication channel is established, TCP communication is started, at this time, the vehicle-mounted system is used as a server of the TCP connection, the first terminal device is used as a client of the TCP connection, and in the starting stage of the TCP communication, a TCP connection is established between the client and the server, and the connection is bidirectional and can simultaneously transmit and receive data. Through the three-way handshake process, the client and the server establish a mutually trusted connection. The TCP/IP five-layer model comprises an application layer, a transmission layer, a network layer, a link layer and a physical layer, wherein the application layer transmits data to the transmission layer by specifying the IP address and the port number of a target host, the transmission layer transmits the data to the network layer by dividing, packaging and adding necessary information, the network layer is responsible for transmitting the data to the target host, and the link layer packages the data package into a data frame and transmits the data through the physical layer. And at the target host, the data is received and analyzed through a reverse process. Through the above procedure, a communication connection is established with the first terminal device based on the TCP communication channel. The server of the TCP can monitor the connection of different ports, so that the Android Auto wireless connection can establish a plurality of TCP channels, and a vehicle-mounted system is required to determine different ports of the terminal equipment in the process of communicating through the Bluetooth RFCOMM channel.
Optionally, the connection information of the first terminal device may be used to mark the first communication channel, so that the vehicle machine and the first terminal device communicate based on the first communication channel; and marking the second communication channel by adopting the connection information of the second terminal equipment so as to enable the vehicle machine and the second terminal equipment to communicate based on the second communication channel.
Optionally, in an embodiment, the first terminal device is connected to the vehicle machine through a USB interface, so that different threads can be created to process the connection of different terminal devices, so as to ensure that the connection requests of multiple terminal devices can be processed simultaneously. When the USB channel is established subsequently, the USB serial number of the corresponding terminal equipment is used as a mark, so that a subsequent user can correctly send a command to the corresponding terminal equipment when interacting with different terminal equipment.
In another embodiment, when the result of the determination in step S13 is yes, the first terminal device does not establish a connection with the vehicle.
Optionally, in an application scenario, taking a first terminal device and a connected second terminal device as an example, and accessing a vehicle machine through a USB interface by using a data line, as shown in fig. 2, fig. 2 is a flow chart of a second embodiment of a connection method between the vehicle machine and the terminal device provided in the application, where the connection method includes the following steps:
step S21: and acquiring the USB serial number of the first terminal equipment.
Specifically, the first terminal device is connected with the vehicle machine through a USB interface by a data line, and a vehicle-mounted system of the vehicle machine acquires a USB serial number of the first terminal device and acquires a USB serial number of a second terminal device which is connected with the current line. The first terminal device and the second terminal device are connected to different USB interfaces of the vehicle. It will be appreciated that the USB sequence number of each terminal device is unique and can be used to distinguish between different terminal devices.
Step S22: and judging whether the USB serial number of the second terminal equipment which is connected currently is the same as the USB serial number of the first terminal equipment.
If not, then step S23 is executed: if yes, go to step S24.
Alternatively, in an embodiment, step S22 may be to detect whether the USB serial number of the second terminal device that is currently connected is the same as the USB serial number of the first terminal device according to the USB serial number of the first terminal device.
Step S23: the first terminal equipment establishes wired connection with the vehicle machine.
It will be appreciated that, by accessing different USB interfaces, the communication data between the first terminal device and the second terminal device is in different USB channels, so that the communication data is not affected by other connection devices. When different terminal devices are connected, android Auto of a vehicle-mounted system of the vehicle can create different threads to process connection of the different terminal devices, and connection requests of a plurality of terminal devices can be processed simultaneously. And when the USB channel is established later, the USB serial number of the terminal equipment is used as a mark, so that the command can be correctly sent to the corresponding terminal equipment when a subsequent user interacts with different terminal equipment.
Step S24: no connection is established.
Optionally, in an application scenario, taking the connection between the first terminal device and the connected second terminal device and the vehicle machine by starting the bluetooth function of the device as an example, as shown in fig. 3, fig. 3 is a schematic flow chart of a third embodiment of the connection method between the vehicle machine and the terminal device, where the connection method includes the following steps:
step S31: and acquiring the Bluetooth address of the first terminal equipment.
Specifically, the first terminal equipment initiates wireless connection to the vehicle machine in a Bluetooth pairing mode, and after a Bluetooth RFCOMM communication channel is established, a vehicle-mounted system of the vehicle machine acquires a Bluetooth address of the first terminal equipment and acquires a Bluetooth address of a second terminal equipment which is in wireless connection at present. It will be appreciated that the bluetooth address of each terminal device is unique and can be used to distinguish between different terminal devices.
Step S32: and judging whether the Bluetooth address of the second terminal equipment which is connected currently is the same as the Bluetooth address of the first terminal equipment.
If not, step S33 is executed: if yes, go to step S34.
Alternatively, in an embodiment, step S32 may be to detect whether the bluetooth address of the currently connected second terminal device is identical to the bluetooth address of the first terminal device according to the bluetooth address of the first terminal device.
Step S33: the first terminal equipment establishes wireless connection with the vehicle machine.
It can be understood that the first terminal device and the second terminal device are wirelessly connected with the vehicle machine through bluetooth, and different bluetooth RFCOMM communication channels are established first, so that communication data between the first terminal device and the second terminal device are in different bluetooth RFCOMM communication channels, and the communication data cannot be affected by other connection devices. When a TCP communication channel is established subsequently, the vehicle-mounted system is used as a TCP server, connection of different ports can be monitored, in the Bluetooth RFCOMM communication stage, android Auto of the vehicle-mounted system distributes different TCP ports for different terminal devices and informs the terminal devices of the information, and when the Android Auto of the vehicle-mounted system is connected with different terminal devices, different threads can be created to process connection of different terminal devices, and connection requests of a plurality of terminal devices can be processed simultaneously. And when the TCP channel is established subsequently, the Bluetooth address of the terminal equipment is used as a mark, so that a subsequent user can conveniently and correctly send a command to the corresponding terminal equipment when interacting with different terminal equipment.
Step S34: no connection is established.
Optionally, in an application scenario, the first terminal device and the second terminal device are connected to the vehicle machine through a USB interface or bluetooth, for example. It will be appreciated that the communication channels used by the vehicle to establish a wired connection and a wireless connection with the terminal device are different, so that the communication between the two will not affect each other. Specifically, each terminal device is distinguished through identification information formed by the terminal device, so as to judge whether the device is connected, and thus the connection of the terminal device is controlled, wherein the identification information can be a combination of a USB serial number and a Bluetooth address. For example, a first terminal device is wired connected and a second terminal device initiates a wireless connection. At this time, android Auto of the vehicle-mounted system can check whether the second terminal device is connected with the vehicle-mounted system according to the USB serial number of the second terminal device, and if not, the second terminal device is allowed to be connected wirelessly. Wherein the second terminal device has formed the identification information.
Alternatively, the vehicle-mounted system can establish Android Auto connection with terminal devices in different connection modes at the same time, but the current Android Auto only supports the same Android device and can only establish one Android Auto connection at the same time. When the same Android device performs wired and wireless connection at the same time, the last successful connection mode interrupts the connection established before. For example, the first terminal device is connected by wire, but the first terminal device initiates a wireless connection again, and since the first terminal device has formed the identification information, the vehicle-mounted system can detect that the first terminal device has connected to the vehicle-mounted system according to the USB serial number of the first terminal device, and at this time, the wireless connection initiated by the first terminal device is ignored. It will be appreciated that when both wired and wireless connections are made to the terminal device, a more stable wired connection is preferred.
Referring to fig. 4, fig. 4 is a schematic diagram of connection according to an embodiment of fig. 1, and the implementation process is described in the foregoing embodiment, which is not repeated here.
Different from the prior art, the application provides a connection method of a vehicle machine and terminal equipment, which comprises the following steps: acquiring connection information of a first terminal device to be connected; wherein the connection information is wire interface information or wireless address information; judging whether the identification information of the connected second terminal equipment is matched with the connection information of the first terminal equipment; wherein the identification information at least comprises connection information; if not, establishing a communication connection with the first terminal device based on the first line Cheng Jianli based on the first communication channel; the vehicle-mounted device establishes communication connection with the second terminal device based on a second communication channel, the second communication channel is established based on a second thread, and the first thread and the second thread are different. By the mode, as each terminal device has unique identification information, the vehicle-mounted system can identify a plurality of terminal devices through the identification information, so that the plurality of terminal devices can be distributed with different communication channels for information interaction, the plurality of terminal devices can be simultaneously in communication connection with the vehicle, and the use requirement that different terminal devices can be simultaneously interacted with the vehicle-mounted system of the vehicle is met; in addition, since the two communication channels are respectively implemented by the two threads, the connection requests of different terminal devices can be processed simultaneously, and the different terminal devices are not affected by each other when communicating.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an embodiment of a vehicle provided in the present application, and the vehicle 50 includes an acquisition module 51, a matching module 52, and a communication module 53.
The acquiring module 51 is configured to acquire connection information of a first terminal device to be connected; wherein the connection information is wire interface information or wireless address information; the matching module 52 is configured to determine whether the identification information of the connected second terminal device is matched with the connection information of the first terminal device; wherein the identification information at least comprises connection information; the communication module 53 is configured to, when the identification information of the connected second terminal device does not match the connection information of the first terminal device, establish a communication connection with the first terminal device based on the first communication channel based on the first line Cheng Jianli; the vehicle-mounted device establishes communication connection with the second terminal device based on a second communication channel, the second communication channel is established based on a second thread, and the first thread and the second thread are different.
Optionally, in an embodiment, the obtaining module 51 is configured to obtain, when the first terminal device is connected to the vehicle machine through the USB interface, a USB serial number of the first terminal device as the connection information; or when the first terminal equipment is connected with the vehicle machine through Bluetooth, acquiring the Bluetooth address of the first terminal equipment as connection information.
Optionally, in an embodiment, the matching module 52 is configured to obtain a USB serial number and a bluetooth address of the second terminal device; and combining the USB serial number and the Bluetooth address of the second terminal device to form the identification information of the second terminal device.
Optionally, in an embodiment, the obtaining module 51 is configured to detect, when the first terminal device is connected to the vehicle machine through the USB interface, whether the first terminal device supports the AOA protocol; if yes, sending an authority request to the first terminal equipment; and if receiving response information based on the permission request and sent by the first terminal equipment, acquiring the USB serial number of the first terminal equipment as connection information.
Optionally, in an embodiment, the obtaining module 51 is configured to establish an RFCOMM communication channel based on an RFCOMM protocol when the first terminal device connects to the vehicle machine through bluetooth; and acquiring the Bluetooth address of the first terminal equipment as connection information through the RFCOMM communication channel.
Optionally, in an embodiment, the communication module 53 is configured to determine an unused destination TCP port; and establishing a first communication channel based on the first thread and the target TCP port, and sending port information of the target TCP port to the first terminal equipment so as to establish communication connection with the first terminal equipment based on the first communication channel.
Optionally, in an embodiment, the communication module 53 is configured to use connection information of the first terminal device to mark the first communication channel, so that the vehicle and the first terminal device communicate based on the first communication channel; and marking the second communication channel by adopting the connection information of the second terminal equipment so as to enable the vehicle machine and the second terminal equipment to communicate based on the second communication channel.
Referring to fig. 6, fig. 6 is a schematic structural diagram of another embodiment of a vehicle provided in the present application, the vehicle 60 includes a plurality of USB interfaces 61, a bluetooth module 63, and a processor 62, the processor 62 is connected to the plurality of USB interfaces 61 and the bluetooth module 63, and the processor 62 is configured to execute the following method:
acquiring connection information of a first terminal device to be connected; wherein the connection information is wire interface information or wireless address information; judging whether the identification information of the connected second terminal equipment is matched with the connection information of the first terminal equipment; wherein the identification information at least comprises connection information; if not, establishing a communication connection with the first terminal device based on the first line Cheng Jianli based on the first communication channel; the vehicle-mounted device establishes communication connection with the second terminal device based on a second communication channel, the second communication channel is established based on a second thread, and the first thread and the second thread are different.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an embodiment of a computer readable storage medium provided in the present application, where program data 71 is stored in the computer readable storage medium 70, and the program data 71, when executed by a processor, is configured to implement the following method:
acquiring connection information of a first terminal device to be connected; wherein the connection information is wire interface information or wireless address information; judging whether the identification information of the connected second terminal equipment is matched with the connection information of the first terminal equipment; wherein the identification information at least comprises connection information; if not, establishing a communication connection with the first terminal device based on the first line Cheng Jianli based on the first communication channel; the vehicle-mounted device establishes communication connection with the second terminal device based on a second communication channel, the second communication channel is established based on a second thread, and the first thread and the second thread are different.
Among them, the processor in the above-described embodiments may also be referred to as a CPU (Central Processing Unit ). The processor may be an integrated circuit chip having signal processing capabilities. The processor may also be a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit,15 ASIC), a Field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. In addition, the processor may be commonly implemented by a plurality of constituent circuit chips.
The Memory or the computer readable storage medium in the above embodiments may be a medium that may store program data, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disc, or may also be a server that stores the program data, where the server may send the stored program data to another device for running, or may also self-run the stored program data.
In the several embodiments provided in the present application, it should be understood that the disclosed methods and apparatuses may be implemented in other manners. For example, the above-described device embodiments are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist alone physically, or two or more units may be integrated into one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing description is only of embodiments of the present application, and is not intended to limit the scope of the patent application, and all equivalent structures or equivalent processes using the descriptions and the contents of the present application or other related technical fields are included in the scope of the patent application.
Claims (10)
1. The connection method of the vehicle machine and the terminal equipment is characterized by comprising the following steps:
acquiring connection information of a first terminal device to be connected; wherein, the connection information is wire interface information or wireless address information;
judging whether the identification information of the connected second terminal equipment is matched with the connection information of the first terminal equipment or not; wherein the identification information at least comprises connection information;
if not, a first communication channel is established based on the first line Cheng Jianli to establish a communication connection with the first terminal device based on the first communication channel;
the vehicle-mounted device establishes communication connection with the second terminal device based on a second communication channel, the second communication channel is established based on a second thread, and the first thread and the second thread are different.
2. The method according to claim 1, wherein the obtaining connection information of the first terminal device to be connected includes:
when the first terminal equipment is connected with the vehicle machine through a USB interface, a USB serial number of the first terminal equipment is obtained as connection information; or (b)
And when the first terminal equipment is connected with the car machine through Bluetooth, acquiring the Bluetooth address of the first terminal equipment as connection information.
3. The method according to claim 2, wherein the method further comprises:
acquiring a USB serial number and a Bluetooth address of the second terminal equipment;
and combining the USB serial number and the Bluetooth address of the second terminal equipment to form the identification information of the second terminal equipment.
4. The method according to claim 2, wherein the obtaining, when the first terminal device connects to the vehicle machine through a USB interface, a USB serial number of the first terminal device as connection information includes:
when the first terminal equipment is connected with the vehicle machine through a USB interface, detecting whether the first terminal equipment supports an AOA protocol or not;
if yes, sending an authority request to the first terminal equipment;
and if receiving the response information based on the permission request sent by the first terminal equipment, acquiring the USB serial number of the first terminal equipment as connection information.
5. The method according to claim 2, wherein the acquiring, when the first terminal device connects to the vehicle machine via bluetooth, the bluetooth address of the first terminal device as the connection information includes:
when the first terminal equipment is connected with the vehicle machine through Bluetooth, an RFCOMM communication channel is established based on an RFCOMM protocol;
and acquiring the Bluetooth address of the first terminal equipment as connection information through the RFCOMM communication channel.
6. The method of claim 1, wherein the first communication channel based on the first line Cheng Jianli to establish a communication connection with the first terminal device based on the first communication channel comprises:
determining an unused target TCP port;
and establishing a first communication channel based on a first thread and the target TCP port, and sending port information of the target TCP port to the first terminal equipment so as to establish communication connection with the first terminal equipment based on the first communication channel.
7. The method according to claim 1, wherein the method further comprises:
marking the first communication channel by adopting the connection information of the first terminal equipment so that the vehicle-mounted device and the first terminal equipment communicate based on the first communication channel; and
and marking the second communication channel by adopting the connection information of the second terminal equipment so that the vehicle machine and the second terminal equipment can communicate based on the second communication channel.
8. A vehicle, characterized in that the vehicle comprises:
the acquisition module is used for acquiring the connection information of the first terminal equipment to be connected; wherein, the connection information is wire interface information or wireless address information;
the matching module is used for judging whether the identification information of the connected second terminal equipment is matched with the connection information of the first terminal equipment; wherein the identification information at least comprises connection information;
a communication module, configured to, when the identification information of the connected second terminal device does not match the connection information of the first terminal device, establish a communication connection with the first terminal device based on a first line Cheng Jianli and a first communication channel;
the vehicle-mounted device establishes communication connection with the second terminal device based on a second communication channel, the second communication channel is established based on a second thread, and the first thread and the second thread are different.
9. A vehicle, characterized in that the vehicle comprises:
a plurality of USB interfaces;
a Bluetooth module;
a processor connecting the plurality of USB interfaces and the bluetooth module, the processor configured to perform the connection method of any one of claims 1-8.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the connection method of any of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311549728.5A CN117676928A (en) | 2023-11-17 | 2023-11-17 | Connection method of vehicle machine and terminal equipment, vehicle and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311549728.5A CN117676928A (en) | 2023-11-17 | 2023-11-17 | Connection method of vehicle machine and terminal equipment, vehicle and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117676928A true CN117676928A (en) | 2024-03-08 |
Family
ID=90078078
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311549728.5A Pending CN117676928A (en) | 2023-11-17 | 2023-11-17 | Connection method of vehicle machine and terminal equipment, vehicle and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117676928A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118588078A (en) * | 2024-08-06 | 2024-09-03 | 中国第一汽车股份有限公司 | Audio control method, device, vehicle and storage medium |
-
2023
- 2023-11-17 CN CN202311549728.5A patent/CN117676928A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118588078A (en) * | 2024-08-06 | 2024-09-03 | 中国第一汽车股份有限公司 | Audio control method, device, vehicle and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10916073B2 (en) | Vehicle network data streaming system | |
US7346370B2 (en) | Enabling interoperability between distributed devices using different communication link technologies | |
JP6611921B2 (en) | Terminal interconnection method, apparatus, nonvolatile computer storage medium, and computer program | |
US8705550B2 (en) | Device interface architecture and protocol | |
KR101820392B1 (en) | Method, device and system for establishing data connection | |
CN110383896A (en) | Method for network access, terminal, access net and core net | |
CN117676928A (en) | Connection method of vehicle machine and terminal equipment, vehicle and storage medium | |
US9635549B2 (en) | Providing subscriber identity module function | |
CA2821338A1 (en) | Wireless network interface with infrastructure and direct modes | |
WO2018120493A1 (en) | Communication connection establishing method and system, mobile terminal, vehicle-mounted equipment, corresponding equipment and computer storage medium | |
US20130223361A1 (en) | Terminal and method for establishing wireless access channel | |
CN105338529B (en) | Wireless network connection method and system | |
US10448253B2 (en) | Wireless terminal | |
WO2015098162A1 (en) | Onboard device and control method for onboard device | |
KR20190138088A (en) | Electronic device suporting multiple wireless communication protocols and method therefor | |
CN112702739B (en) | Wireless network sharing method and device, readable storage medium and mobile terminal | |
JP5795628B2 (en) | Method, apparatus and system for communication between double central processing units | |
CN113595839B (en) | Device binding method, terminal device and storage medium | |
KR20090053282A (en) | Method and apparatus for indentifing equipments requesting javapush | |
WO2011009339A1 (en) | Method, system and device for transmitting data | |
CN116366705A (en) | Device connection management method, related device, system and storage medium | |
WO2019104989A1 (en) | Terminal and communication method | |
US20130273842A1 (en) | Methods for exchanging information between electronic devices, and electronic devices | |
CN113900428A (en) | Vehicle diagnosis method, diagnosis node, device, and storage medium | |
CN114143396B (en) | Method and system for realizing wireless interconnection between vehicle and mobile phone based on NFC |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |