Equipment connection method and device, terminal equipment and medium
By using virtual identity in device connections, cross-protocol identification and simplification of connections are achieved, and the problems of waste of resources and privacy risks in the prior art are solved, improving connection efficiency and security.
Patent Information
- Application Number
- CN202310583928.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-22
- Publication Date
- 2024-11-22
AI Technical Summary
The prior art is difficult to identify the same device across protocols, resulting in waste of resources and extended time when the device is connected, and there is a risk of user identity tracking privacy.
The device is identified by a virtual identifier. By generating and broadcasting connection request information containing the virtual identifier, if the device has established a connection through any wireless connection protocol, the connection is simplified based on the historical connection data to avoid exposure of the real identifier.
Cross-protocol identification between devices is realized, resources and time are saved, connection efficiency is improved, and the possibility of user identity tracking is reduced through virtual identification, enhancing security.
Smart Images

Figure CN119012410A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and in particular, relates to a device connection method, apparatus, terminal equipment and medium. Background Art
[0002] Devices that are close to each other can be connected through a variety of different short-range wireless connection protocols. For example, near-field devices can be connected through wireless fidelity (WiFi), Bluetooth, or connection protocols customized by different manufacturers. Different connection protocols can use different device identifiers, such as Bluetooth hardware (Media Access Control, MAC) address, WiFi MAC address.
[0003] When establishing a connection between near-field devices for the first time, more computing resources are required; when it is not the first time to establish a connection, if the connection can be established based on the historical data of the first connection, the connection process can be simplified. Currently, devices can only identify historical connections established based on the same protocol, and it is difficult to identify whether historical connections have been established through other protocols. If the device can achieve cross-protocol recognition, it can reuse data when connecting, saving resources and time.
[0004] Based on this, there is a need for devices to identify the same device across protocols.
[0005] In order to meet the need to identify the same device across protocols, the identification information of other connection protocols can be added to the broadcast data packets of different connection protocols of the device, so that the device can obtain the identification of different protocols from the broadcast data packets of a single protocol, thereby identifying the same device corresponding to the identification of different protocols. For example, the Bluetooth MAC address can be carried in plain text in the WiFi broadcast data packet, so that the device can determine whether the device has previously established a connection via Bluetooth through the Bluetooth MAC address in the WiFi broadcast data packet.
[0006] However, in the above method, the device identifiers of other protocols carried in plain text in the protocol broadcast packet are mostly long-term or real device identifiers at the device level, and can be accessed by other devices in the near field, which poses a privacy risk of user identity tracking. In addition, every time a new connection protocol is added to the device, the corresponding protocol broadcast packet needs to be modified. The number of other protocol device identifiers carried by the broadcast packet increases with the number of protocol types, which leads to poor scalability and compatibility of the solution. Summary of the invention
[0007] In view of this, the embodiments of the present application provide a device connection method, apparatus, terminal device and medium for identifying devices across protocols when establishing a connection between devices, so that historical connection data when connecting using any connection protocol can be reused to connect between devices, simplifying the connection process and saving computing resources; at the same time, based on the virtual identification of the device, it can ensure that the real identification of the device is not read, reducing the possibility of user identity tracking.
[0008] A first aspect of an embodiment of the present application provides a device connection method, including:
[0009] Receiving connection request information from a first device, wherein the connection request information includes a first virtual identifier for identifying the first device;
[0010] In the case where it is determined that the first device is a historical connection device of the second device based on the first virtual identifier, the second device is triggered to make a connection response based on the historical connection data between the second device and the first device, wherein the historical connection device is a device that has established a connection with the second device based on any wireless connection protocol.
[0011] A second aspect of an embodiment of the present application provides a device connection method, including:
[0012] Generate connection request information, the connection request information including a first virtual identifier for identifying the first device;
[0013] Broadcast the above connection request information;
[0014] Based on the connection response returned by the second device in response to the connection request information, a wireless connection is established between the first device and the second device.
[0015] A third aspect of an embodiment of the present application provides a device connection apparatus, including:
[0016] A connection request information receiving module, configured to receive connection request information from a first device, wherein the connection request information includes a first virtual identifier for identifying the first device;
[0017] A connection response module is used to trigger the second device to make a connection response based on the historical connection data between the second device and the first device when it is determined that the first device is a historical connection device of the second device based on the first virtual identifier, wherein the historical connection device is a device that has established a connection with the second device based on any wireless connection protocol.
[0018] A fourth aspect of an embodiment of the present application provides a device connection apparatus, including:
[0019] A connection request information generating module, used to generate connection request information, wherein the connection request information includes a first virtual identifier for identifying the first device;
[0020] A connection request information broadcasting module, used for broadcasting the above connection request information;
[0021] A connection module is used to establish a wireless connection between the first device and the second device based on a connection response returned by the second device in response to the connection request information.
[0022] The fifth aspect of an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first or second aspect when executing the computer program.
[0023] A sixth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect or the second aspect is implemented.
[0024] A seventh aspect of the embodiments of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device executes the method described in the first aspect or the second aspect.
[0025] Compared with the prior art, the embodiments of the present application have the following advantages:
[0026] The device in the embodiment of the present application may have a virtual identifier. The virtual identifier can uniquely identify the device without exposing the actual device identifier of the device. When a connection is established between devices based on any wireless connection protocol, the device initiating the connection can generate a connection request message based on the virtual identifier, so that the device receiving the connection request message can obtain the virtual identifier of the initiator's device, and can identify whether the devices have ever been connected based on a wireless connection protocol based on the virtual identifier. If a connection has been established between devices based on a wireless connection protocol, historical connection data can be used to establish a connection between the devices, so that some data exchange processes can be omitted when connecting, saving network resources consumed during connection and shortening the connection time. At the same time, since the device uses a virtual identifier instead of a real device identifier, the device can be prevented from being tracked and the device can be protected. The embodiment of the present application can improve the security of the device while realizing cross-protocol identification of the same device based on the virtual identifier. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art.
[0028] Figure 1 It is a schematic diagram of the steps of a device connection method provided in an embodiment of the present application;
[0029] Figure 2 This is a schematic diagram of a device connection scenario provided by an embodiment of the present application;
[0030] Figure 3 It is a schematic diagram of the steps of another device connection method provided in an embodiment of the present application;
[0031] Figure 4 This is a schematic diagram of another device connection scenario provided in an embodiment of the present application;
[0032] Figure 5 This is a schematic diagram of the steps of another device connection method provided in an embodiment of the present application;
[0033] Figure 6 This is a schematic diagram of the steps of another device connection method provided in an embodiment of the present application;
[0034] Figure 7 This is a schematic diagram of a scenario of application connection provided by an embodiment of the present application;
[0035] Figure 8 is a schematic diagram of a device connection device provided in an embodiment of the present application;
[0036] Fig. 9 is a schematic diagram of another device connection device provided in an embodiment of the present application;
[0037] Fig.10 It is a schematic diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In the following description, specific details such as specific system structures, technologies, etc. are proposed for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from hindering the description of the present application.
[0039] The technical solution of the present application is described below through specific embodiments.
[0040] Reference Figure 1 , shows a schematic diagram of the steps of a device connection method provided in an embodiment of the present application, which may specifically include the following steps:
[0041] S101, receiving connection request information of a first device, where the connection request information includes a first virtual identifier for identifying the first device.
[0042] The method in the embodiment of the present application can be applied to the scenario of short-range wireless communication between terminal devices, and the terminal device can use the method in the embodiment of the present application to establish a connection with other terminal devices. The terminal device can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a smart home device, a playback device, and other devices that can perform wireless communication.
[0043] This embodiment uses the second device as the execution subject to describe the solution in this embodiment. Both the first device and the second device can be a terminal device that can perform wireless communication, and this embodiment of the application does not limit the specific type of the terminal device.
[0044] The first device may be a device that initiates a wireless connection, and the second device may be a device that responds to a connection based on the connection request information. In the embodiments of the present application, the first device and the second device are only used to facilitate the description of the solution. When a device is connected wirelessly, it may be the first device or the second device. Figure 2 As shown, both device A and device B can broadcast their own connection request information to devices within the short-range communication range. In the scenario where device A broadcasts the connection request information of device A, device C receives the connection request information of device A, and device A and device C establish a connection, device A is the first device and device C is the second device. In the scenario where device B broadcasts the connection request information of device B, device A receives the connection request information of device B, and device B and device A establish a connection, device B is the first device and device A is the second device.
[0045] Both the first device and the second device may include a functional module for generating a virtual identifier. In a possible implementation, a virtual identifier database may be configured on both the first device and the second device. A virtual identifier may be generated for a device based on the virtual identifier database, and each device corresponding to a virtual identifier is unique. Therefore, devices may identify each other through virtual identifiers. Exemplarily, the virtual identifier database may be a dynamic library so library. In an embodiment of the present application, in order to ensure the security of the generated virtual identifier, the virtual identifier may be stored and access controlled by the operating system of the terminal device, thereby preventing the virtual identifier corresponding to a malicious application from being illegally tampered with.
[0046] When the first device needs to communicate with other devices within the range of short-range wireless communication, or when the first device needs to switch communication protocols with other devices within the range of short-range wireless communication, the first device may generate and broadcast connection request information, wherein the connection request information may include the first virtual identifier of the first device.
[0047] In a possible implementation, the connection request information may be a data packet, and the data packet may include a data packet description portion and a data portion, wherein the description portion of the data packet may be used to describe the protocol information used to request the establishment of a connection, for example, the description portion of the data packet may refer to the header of the data packet. For a communication protocol, the description portion of a general data packet is fixed, while the content of the data portion is variable. The embodiment of the present application may write the first virtual identifier into the data portion of the data packet, so that when the data packet carries the first virtual identifier, there is no need to make structural modifications to the data packet used by the communication protocol, and the operation is convenient.
[0048] For example, in the scenario where the smart home devices in the room are controlled by the mobile phone, when the user enters the house, the mobile phone has not yet established a connection with the smart home devices. At this time, the mobile phone can broadcast a WiFi data packet to the smart home devices within the indoor range, and the WiFi data packet can carry the virtual identifier of the mobile phone. When the mobile phone communicates with the smart home indoors via WiFi, if it is necessary to switch the communication mode, such as switching to Bluetooth for connection, the mobile phone can broadcast a Bluetooth data packet to the smart home devices within the indoor range, and the Bluetooth data packet can carry the virtual identifier of the mobile phone.
[0049] The first device may broadcast the generated connection request information within the wireless communication range using the destination connection protocol, and the device that needs to connect to the first device within the wireless communication range may receive the connection request information.
[0050] S102, when it is determined that the first device is a historical connection device of the second device based on the first virtual identifier, trigger the second device to make a connection response based on the historical connection data between the second device and the first device, wherein the historical connection device is a device that has established a connection with the second device based on any wireless connection protocol.
[0051] The terminal device can record devices that have established a connection through any wireless connection protocol. For example, the first device and the second device can be connected through WiFi, Bluetooth, Near Field Communication (NFC), ZigBee, etc. When the first device and the second device are connected through any protocol, the first device can record the second virtual identifier of the second device, and the second device can record the first virtual identifier of the first device. In this embodiment, the historical connection device of the terminal device can be a device that has established a connection with the terminal device based on any wireless connection protocol.
[0052] When a terminal device establishes a connection with other devices, there are two ways to connect. One is to make the first connection directly based on the protocol, that is, based on the protocol information in the connection request information, the terminal devices send verification information to each other and verify, and establish a connection after the verification is passed. The other is to make a simple connection based on historical connection data. When the terminal devices have established a connection based on any wireless connection protocol, the terminal devices can store each other's identity authentication information, so that the terminal devices can directly obtain the identity authentication information based on the historical connection data for direct verification, which is equivalent to simplifying the connection process by reusing data.
[0053] Therefore, when receiving the connection request information, the terminal device can identify whether the device that initiates the connection request information is a historically connected device.
[0054] After the second device receives the connection request information from the first device, it can determine whether it is recorded in the second device according to the first virtual identifier, and determine whether the second device is a historical connection device of the first device. If the first virtual identifier is recorded in the second device, it is determined that the first device is a historical connection device of the second device; if the first virtual identifier is not recorded in the second device, it is determined that the first device is not a historical connection device of the second device. Exemplarily, the second device may include a virtual identifier record table of historical connection devices, and the virtual identifier record table is used to record the virtual identifiers of the historical connection devices of each second device. After receiving the connection request information, the second device can obtain the first virtual identifier from the connection request information, and then determine whether the first virtual identifier exists in the virtual identifier record table of the second device. If the first virtual identifier exists in the virtual identifier record table of the second device, it is determined that the first device is a historical connection device of the second device; if the first virtual identifier does not exist in the virtual identifier record table of the second device, it is determined that the first device is not a historical connection device of the second device.
[0055] If the first device is a historical connection device of the second device, then when the first device and the second device are connected before, some data that requires identity verification or connection establishment can be saved as historical connection data in the first device and the second device, and the first device and the second device can respond to the connection based on the saved historical connection data, so that a simple connection can be made based on the saved historical connection data without the need to re-acquire identity verification data or other related data. Exemplarily, the second device can authenticate the identity of the first device based on the saved historical connection data, and after the identity verification is passed, generate a connection response message, and send the connection response message to the first device, thereby establishing a connection between the first device and the second device. Among them, the connection response message can carry the second virtual identifier of the second device, so that the first device can obtain the historical connection data of the first device and the second device based on the second virtual identifier, and authenticate the identity of the second device based on the historical connection data.
[0056] If the first device is not a historical connection device of the second device, when the first device and the second device are connected, the first connection response can be performed in the manner specified by the protocol. The first device and the second device can obtain relevant verification data and other connection data from each other, so as to connect after the verification is passed, and save the relevant verification data and other connection data in the historical data, and record the virtual identification of the other device to each other. For example, the second device can return a connection response to the first device, and the connection response can carry the verification information of the second device and the second virtual identification of the second device to request identity authentication information from the first device. The first device can perform identity authentication based on the verification information in the connection response, and then the first device and the second device can respond based on the verification result. For example, when the connection protocol between the first device and the second device is the Transmission Control Protocol (TCP) or other protocols generated based on the Transmission Control Protocol, the first device and the second device can establish a connection through a three-way handshake or a method similar to a three-way handshake.
[0057] In an embodiment of the present application, the terminal device can write a virtual identifier into the connection request information each time it establishes a wireless connection with other devices. For the same device, the virtual identifier used when connecting using any wireless connection protocol is the same. Therefore, when receiving the connection request information, the device can determine whether the devices have been connected through any wireless connection protocol before through the virtual identifier in the connection request information. The embodiment of the present application realizes cross-protocol identification of the same connection device, thereby simplifying the connection process, improving connection efficiency, and saving network resources when the devices are connected.
[0058] Reference Figure 3, shows a schematic diagram of the steps of another device connection method provided in an embodiment of the present application, which may specifically include the following steps:
[0059] S301, generating connection request information, where the connection request information includes a first virtual identifier for identifying a first device.
[0060] The embodiments of the present application can be applied to a terminal device, and the terminal device can be the device introduced in the previous embodiment.
[0061] When the first device needs to communicate with other devices within the range of short-range wireless communication, or when the first device needs to switch communication protocols with other devices within the range of short-range wireless communication, the first device can generate and broadcast connection request information. In one possible implementation, the connection request information may include an information description part and a payload part, the information description part can be used to describe the protocol version of the information, etc., and the payload part can be used to describe the content of the information. Generally, the information description part is fixed, and the payload part may not be fixed. Therefore, when generating the connection request information, the first device can write the first virtual identifier into the payload part of the connection request information.
[0062] S302, broadcast the above connection request information.
[0063] The first device may broadcast the connection request information within the wireless communication range by using a protocol used by the wireless communication.
[0064] S303: Establish a wireless connection between the first device and the second device based on a connection response returned by the second device in response to the connection request information.
[0065] The second device may make a connection response to the connection request information based on the steps in S101-S103. The connection response may carry the second virtual identifier of the second device. Therefore, after the first device receives the connection response returned by the second device in response to the connection request information, it may confirm whether the second device is a historically connected device of the first device based on the second virtual identifier of the second device in the connection response. When the second device is not a historically connected device of the first device, the second virtual identifier of the second device may be recorded after the first device and the second device establish a connection.
[0066] In a possible implementation, the terminal device may update the virtual identification at regular intervals, thereby avoiding the risk of identity tracking caused by using the same virtual identification for a long time.
[0067] Exemplarily, the terminal device may be pre-set to update the time of the virtual identification, or the user may automatically decide when to update the virtual identification. When the terminal device is triggered to update the virtual identification by the user, or the terminal device determines that the virtual identification needs to be updated based on the update time information of the virtual identification, the terminal device may call the corresponding program in the virtual identification database to update the virtual identification. For example, the terminal device may call ID_so in the so library to reacquire a new virtual identification. After acquiring the virtual identification, the terminal device may reconnect with other devices for the first time based on the new virtual identification.
[0068] In the embodiment of the present application, based on the virtual identifier, the actual identifier of the device can be prevented from being leaked, thereby reducing the risk of user identity tracking; at the same time, by updating the virtual identifier, it is possible to avoid carrying the same virtual identifier for a long time when broadcasting protocol information, thereby reducing the possibility of user identity tracking and enhancing user privacy protection. In addition, since the unique device identifier carried in the connection request information is a fixed virtual identifier, it is possible to avoid carrying device identification information of multiple other connection protocols at the same time, saving the data space occupied by the broadcast connection request information; at the same time, since different connection protocols use the same virtual identifier, when the device is compatible with a new wireless connection protocol, it is possible to avoid modifying the format of the data packet, thereby simplifying the process of establishing a connection.
[0069] Figure 4 is an application scenario diagram provided by an embodiment of the present application, wherein: Figure 4 The mobile phone in the embodiment may be the first device mentioned above, Figure 4 The speaker in the embodiment may be the second device mentioned above. Figure 4 As shown, the connection request information broadcast by the mobile phone can be sent to the speaker. The speaker can make a connection response based on the connection request information, so that a connection can be established between the mobile phone and the speaker.
[0070] A virtual identification database can be configured in the mobile phone and the speaker respectively. The mobile phone can call the virtual identification database to generate a mobile phone virtual identification; the speaker can call the virtual identification database to generate a speaker virtual identification. The mobile phone and the speaker can communicate through WiFi, Bluetooth and other wireless protocols. When the user wants to play music through the speaker, the mobile phone can be triggered to connect with the speaker. The mobile phone and the speaker can be connected through Bluetooth. After the mobile phone receives the user's instruction, it can generate Bluetooth connection request information based on the mobile phone virtual identification and broadcast the Bluetooth connection request information; after the speaker receives the Bluetooth connection request information sent by the mobile phone, it can obtain the mobile phone virtual identification from the Bluetooth connection request information, so as to determine whether the mobile phone virtual identification has been recorded in the speaker. If the mobile phone virtual identification is recorded in the speaker, it means that the mobile phone has previously established a connection with the speaker through WiFi, Bluetooth or some other wireless protocols. At this time, the historical connection data of the mobile phone and the speaker can be obtained, so as to make a connection response based on the historical connection data. After the mobile phone and the speaker are connected based on the historical connection data, communication can be carried out, so that the user can use the speaker to play music through the mobile phone. Based on the above connection method, as long as the mobile phone and the speaker are connected once, the connection process can be simplified when connecting based on any protocol afterwards. For example, if the mobile phone and the speaker have been connected via WiFi before, then when the Bluetooth connection is made for the first time, the WiFi connection data can be reused for identity authentication, thereby simplifying the Bluetooth connection process, saving network resources, and improving connection efficiency.
[0071] In the short-range wireless communication scenario, applications installed on different devices can be connected in a variety of different ways to transmit data. Different connection methods use different connection protocols. Therefore, when switching between connection methods, it is necessary to re-establish the connection. Among them, the application installed on the device is used to handle the corresponding business.
[0072] When switching connection modes, if the same application can be identified, the authentication data stored when the connection was previously made based on other protocols can be obtained, and the authentication when connecting can be directly performed based on the stored authentication data, so that data reuse can be achieved and the connection process can be simplified. For example, corresponding music software can be installed on the mobile phone and the speaker respectively, and the music software on the mobile phone and the speaker can establish a communication connection through WiFi, Bluetooth, or connection protocols customized by different manufacturers. When the mobile phone and the speaker currently switch from WiFi connection to Bluetooth connection, if the music software on the mobile phone can recognize from the Bluetooth connection information that the music software on the speaker has previously established a connection with itself through WiFi, it can directly obtain the data during the WiFi connection for authentication, thereby simplifying the Bluetooth connection process.
[0073] Therefore, there is a need for applications to identify the same application across protocols.
[0074] In order to meet the need to identify the same application across protocols, the identification information of other connection protocols can be added to the broadcast data packets of different connection protocols of the application, so that the application can obtain the identification of different protocols from the broadcast data packets of a single protocol, thereby identifying the same application corresponding to the identification of different protocols. For example, the Bluetooth MAC address can be carried in plain text in the WiFi broadcast data packet, so that the application can determine whether the application has previously established a connection through Bluetooth through the Bluetooth MAC address in the WiFi broadcast data packet.
[0075] However, in the above method, the device identifiers of other protocols carried in plain text in the protocol broadcast packet are mostly long-term or real device identifiers at the device level, and can be accessed by other devices in the near field, which poses a privacy risk of user identity tracking. In addition, every time an application adds a new connection protocol, the corresponding protocol broadcast packet needs to be modified. The number of other protocol device identifiers carried by the broadcast packet increases with the number of protocols, which leads to poor scalability and compatibility of the solution.
[0076] Based on this, the embodiments of the present application can use Figure 5 as well as Figure 6 The method in realizes cross-protocol identification between applications.
[0077] Reference Figure 5 , shows a schematic diagram of the steps of another device connection method provided in an embodiment of the present application, which may specifically include the following steps:
[0078] S501, receiving connection request information of a first application, wherein the connection request information includes a first virtual identifier for identifying the first application.
[0079] The method in this embodiment can be applied to a terminal device, and the terminal device can be the terminal device in the above embodiment. One or more applications can be run on the terminal device, for example, the terminal device can include music software, sports software, etc. Each application can call the virtual identification data to generate a unique virtual identification, and the application on the terminal device uses the unique virtual identification in the process of short-range wireless communication with applications on other devices. In an embodiment of the present application, in order to ensure the security of the generated virtual identification, the virtual identification can be stored and access controlled by the operating system of the terminal device, so as to prevent the virtual identification corresponding to the malicious application from being illegally tampered with.
[0080] The first application may be an application installed on the first device that initiates a wireless connection, and the second application may be an application installed on the second device that responds to a wireless connection. A wireless connection communication may be established between the first application and the second application, thereby establishing a wireless connection between the first device and the second device.
[0081] In an embodiment of the present application, for each application running on the device, its virtual identifier is unique. For example, the identifiers of the music software on device A and the music software on device B are different. That is to say, for a terminal device, if it includes multiple applications, it can have multiple different virtual identifiers. The devices and applications identified by each virtual identifier are unique, the virtual identifier corresponding to each device is different, and the virtual identifier corresponding to each application is unique. The first application can call the virtual identifier database on the first device to generate a first virtual identifier; the second application can call the virtual identifier database on the second device to generate a second virtual identifier.
[0082] When the first application needs to communicate with an application on another device within the range of short-range wireless communication, or when the first application needs to switch communication protocols with an application on another device within the range of short-range wireless communication, the first application can generate and broadcast connection request information, wherein the connection request information can include the first virtual identifier of the first application.
[0083] The first device can use any wireless connection protocol to broadcast the connection request information generated by the first application program within the wireless communication range. Devices that need to connect to the first application program within the wireless communication range can receive the connection request information.
[0084] S502, when it is determined that the first application is a historically connected application of the second application based on the first virtual identifier, trigger the second application to make a connection response based on the historical connection data between the second application and the first application, wherein the historically connected application is an application that has established a connection with the second application based on any wireless connection protocol.
[0085] When the second application on the second device receives the connection request information of the first application, it can determine whether the first application is a historically connected application of the second application based on the first virtual identifier in the connection request information. If the first application is a historically connected application of the second application, the second application can be triggered to make a connection response based on the historical connection data between the first application and the second application. If the first application is not a historically connected application of the second application, the second application can be triggered to make an initial connection response with the first application based on the protocol information carried in the connection request information; and in the case where the initial connection between the first application and the second application is successful, the first virtual identifier is recorded in the second application.
[0086] In the embodiment of the present application, the application on the terminal device can have a unique virtual identifier. When using any wireless protocol to establish a connection with other applications, the virtual identifier can be written into the connection request information, so that under different wireless connection modes, the connection request information of the same device received by the device carries the same virtual identifier, so that the application can identify the same application across protocols, and then data can be reused to simplify the connection process. At the same time, the use of virtual identifiers can avoid carrying device-level long-term or real device identifiers in protocol broadcast information, reduce the possibility of user identity tracking, and enhance privacy protection of user identities.
[0087] Reference Figure 6 , shows a schematic diagram of the steps of another device connection method provided in an embodiment of the present application, which may specifically include the following steps:
[0088] S601, generating connection request information, wherein the connection request information includes a first virtual identifier for identifying a first application.
[0089] The method in this embodiment can be applied to a terminal device, and the terminal device can be the terminal device described in the above embodiment. One or more application programs can be run on the terminal device.
[0090] When the first application needs to communicate with other devices within the range of short-range wireless communication, or when the first application needs to switch communication protocols with other devices within the range of short-range wireless communication, the first application can generate and broadcast connection request information, wherein the connection request information can include the first virtual identifier of the first application.
[0091] S602: Broadcast the above connection request information.
[0092] The first application may broadcast connection request information based on a wireless connection protocol.
[0093] S603: Establish a wireless connection between the first application and the second application based on a connection response returned by the second application to the connection request information.
[0094] The second application may make a connection response based on the method in S501-S503. The connection response may carry the second virtual identifier. The first application may establish a wireless connection with the second application based on the second virtual identifier.
[0095] In an embodiment of the present application, a terminal device may include multiple applications, and different applications may update virtual identification according to their respective needs. When the terminal device updates the virtual identification of an application based on a virtual identification database, it may determine a target application from one or more applications; then the virtual identification database may be called through the target application; based on the virtual identification database, the terminal device updates the virtual identification of the target application. Among them, the update time and update conditions of the virtual identification of different applications may be automatically set by the user. The terminal device may determine the target application required based on the update time and update conditions corresponding to each application. For example, application A may be set to update the virtual identification every 3 months, and the terminal device may record the time when application A updates the virtual identification, thereby updating the virtual identification of application A through the virtual identification database every 3 months.
[0096] In an embodiment of the present application, a unique application identifier can be generated for each application, so that cross-protocol identification of the same application can be achieved based on the unique application identifier. When establishing a connection based on any protocol, the connection request information broadcast by the application can carry the unique application identifier of the application, so that the application that receives the connection request information can identify whether a connection has been established with the application through any protocol based on the unique application identifier in the connection request information. For the same application, the application identifier carried in the connection request information based on any protocol is the same, so when establishing a connection based on any protocol, the application can be identified based on the unique application identifier, thereby simplifying the cross-protocol identification process for the same application and improving the scalability and compatibility of the cross-protocol identification solution. At the same time, the application identifier does not disclose the real device identifier, which can reduce the possibility of user identity tracking and enhance privacy protection of user identity.
[0097] Figure 7 Schematic diagram of a scenario of application connection provided by an embodiment of the present application. Figure 7As shown, the terminal device may include one or more applications. For example, a mobile phone may include mobile sports software and mobile music software. The speaker can run the speaker music software corresponding to the mobile music software, and the sports bracelet can run the bracelet sports software corresponding to the mobile sports software. The mobile sports software, mobile music software, speaker music software and bracelet sports software can have different virtual identifiers, so that during the communication process, a unique software can be identified based on the virtual identifier. When the method in the present application is used to establish a wireless connection between applications, the mobile sports software and the bracelet sports software only need to be wirelessly connected once, and the subsequent connection process can be simplified, so that after the first connection, the connection between the mobile phone and the sports bracelet is simpler, thereby improving the user experience. Similarly, the wireless connection process between the mobile music software and the speaker music software can also be simpler.
[0098] In a possible implementation, different applications on a terminal device can use different wireless communication methods to connect to applications on other devices. For example, a mobile sports software can be connected to a bracelet sports software via Bluetooth, and a mobile music software can be connected to a speaker music software via WiFi.
[0099] It should be noted that the size of the serial numbers of the steps in the above embodiments 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 application.
[0100] Reference Figure 8 , shows a schematic diagram of a device connection apparatus 800 provided in an embodiment of the present application, which may specifically include a connection request information receiving module 81 and a connection response module 82, wherein:
[0101] A connection request information receiving module 81 is used to receive connection request information of a first device, wherein the connection request information includes a first virtual identifier for identifying the first device;
[0102] The connection response module 82 is used to trigger the second device to make a connection response based on the historical connection data between the second device and the first device when it is determined that the first device is a historical connection device of the second device based on the first virtual identifier, wherein the historical connection device is a device that has established a connection with the second device based on any wireless connection protocol.
[0103] In a possible implementation, the above device further includes:
[0104] An identification module, used to identify whether the first virtual identifier is recorded in the second device;
[0105] A first determining module, configured to determine that the first device is a historically connected device of the second device if the first virtual identifier is recorded in the second device;
[0106] The second determination module is configured to determine that the first device is not a historically connected device of the second device if the first virtual identifier is not recorded in the second device.
[0107] In a possible implementation, the above device further includes:
[0108] a first connection response module, configured to trigger the second device to make a first connection response with the first device based on the protocol information carried in the connection request information, when it is determined based on the first virtual identifier that the first device is not a historical connection device of the second device;
[0109] The recording module is used to record the first virtual identifier in the second device when the first device and the second device are successfully connected for the first time.
[0110] In a possible implementation, the first virtual identifier is a unique identifier of a first application running on the first device, a second application corresponding to the first application runs on the second device, and the connection response module 82 includes:
[0111] An application connection response submodule is used to trigger the second application to make a connection response based on the historical connection data between the second application and the first application, when it is determined that the first application is the historical connection program of the second application based on the first virtual identifier, wherein the historical connection program is an application that has established a connection with the second application based on any wireless connection protocol.
[0112] In a possible implementation manner, the connection response of the second device carries the second virtual identifier of the second device, and the second virtual identifier is generated by a virtual identifier database configured on the second device.
[0113] Reference Fig. 9 , shows a schematic diagram of another device connection apparatus 900 provided in an embodiment of the present application, which may specifically include a connection request information generating module 91 and a connection request information broadcasting module 92, wherein:
[0114] A connection request information generating module 91, configured to generate connection request information, wherein the connection request information includes a first virtual identifier for identifying a first device;
[0115] A connection request information broadcasting module 92, used for broadcasting the above connection request information;
[0116] The connection module 93 is configured to establish a wireless connection between the first device and the second device based on a connection response returned by the second device in response to the connection request information.
[0117] In a possible implementation, the above device further includes:
[0118] The first virtual identification generating module is used to generate the first virtual identification through the virtual identification database configured on the first device.
[0119] In a possible implementation, the first device includes a first application, the first virtual identifier is used to uniquely identify the first application, the second device has a second application corresponding to the first application, and the connection module 93 includes:
[0120] The application response submodule is used to establish a wireless connection between the first application and the second application based on the connection response returned by the second application in response to the connection request information.
[0121] In a possible implementation, the first device includes one or more first applications, each of the first applications has a unique first virtual identifier, and the apparatus further includes:
[0122] The virtual identification updating module is used to update the first virtual identification of one or more of the first applications based on the virtual identification database configured on the first device.
[0123] In a possible implementation, the virtual identification updating module includes:
[0124] A target application determining submodule, used to determine a target application from one or more of the first applications;
[0125] A calling submodule, used for calling the above-mentioned virtual identification database through the above-mentioned target application;
[0126] The updating submodule is used to update the first virtual identification of the target application based on the virtual identification database.
[0127] In a possible implementation, the virtual identification database is a dynamic database.
[0128] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.
[0129] Fig.10 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Fig.10As shown, the terminal device 100 of this embodiment includes: at least one processor 1000 ( Fig.10 Only one is shown), a memory 1001, and a computer program 1002 stored in the memory 1001 and executable on the at least one processor 1000, wherein the processor 1000 implements the steps of any of the above method embodiments when executing the computer program 1002.
[0130] The terminal device 100 may be a device for implementing each step in the above-mentioned method embodiments, such as a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a smart home device, a playback device, etc. The terminal device may include, but is not limited to, a processor 1000 and a memory 1001. Those skilled in the art will appreciate that Fig.10 It is only an example of the terminal device 100 and does not constitute a limitation on the terminal device 100 , and may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0131] The processor 1000 may be a central processing unit (CPU), or 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. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0132] In some embodiments, the memory 1001 may be an internal storage unit of the terminal device 100, such as a hard disk or memory of the terminal device 100. In other embodiments, the memory 1001 may also be an external storage device of the terminal device 100, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device 100. Further, the memory 1001 may also include both an internal storage unit of the terminal device 100 and an external storage device. The memory 1001 is used to store an operating system, an application program, a boot loader (BootLoader), data and other programs, such as the program code of the computer program. The memory 1001 may also be used to temporarily store data that has been output or is to be output.
[0133] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0134] An embodiment of the present application provides a computer program product. When the computer program product runs on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0135] The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them. Although the present application is described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A device connection method, characterized in that: include: Receiving connection request information from a first device, wherein the connection request information includes a first virtual identifier for identifying the first device; In the case where it is determined that the first device is a historically connected device of the second device based on the first virtual identifier, the second device is triggered to make a connection response based on the historical connection data between the second device and the first device, wherein the historically connected device is a device that has established a connection with the second device based on any wireless connection protocol.
2. The method according to claim 1, characterized in that After receiving the connection request information of the first device, the method further includes: identifying whether the first virtual identifier is recorded in the second device; If the first virtual identifier is recorded in the second device, determining that the first device is a historically connected device of the second device; If the first virtual identifier is not recorded in the second device, it is determined that the first device is not a historically connected device of the second device.
3. The method according to claim 1, characterized in that The method further comprises: In a case where it is determined based on the first virtual identifier that the first device is not a historically connected device of the second device, triggering the second device to make an initial connection response with the first device based on the protocol information carried in the connection request information; When the first device is successfully connected to the second device for the first time, the first virtual identifier is recorded in the second device.
4. The method according to claim 1, characterized in that The first virtual identifier is a unique identifier of a first application running on the first device, a second application corresponding to the first application is running on the second device, and in a case where it is determined based on the first virtual identifier that the first device is a historically connected device of the second device, triggering the second device to perform a connection response based on historical connection data between the second device and the first device, includes: In the case where it is determined based on the first virtual identifier that the first application is a historical connection program of the second application, the second application is triggered to make a connection response based on the historical connection data between the second application and the first application, wherein the historical connection program is an application that has established a connection with the second application based on any wireless connection protocol.
5. The method according to any one of claims 1 to 4, characterized in that: The connection response of the second device carries a second virtual identifier of the second device, where the second virtual identifier is generated by a virtual identifier database configured on the second device.
6. A device connection method, characterized in that: include: Generate connection request information, wherein the connection request information includes a first virtual identifier for identifying the first device; Broadcasting the connection request information; A wireless connection is established between the first device and the second device based on a connection response returned by the second device in response to the connection request information.
7. The method according to claim 6, characterized in that Before generating the connection request information, the method further includes: The first virtual identifier is generated by configuring a virtual identifier database on the first device.
8. The method according to claim 6 or 7, characterized in that The first device includes a first application, the first virtual identifier is used to uniquely identify the first application, the second device has a second application corresponding to the first application, and the establishing a wireless connection between the first device and the second device based on a connection response returned by the second device in response to the connection request information includes: A wireless connection is established between the first application and the second application based on a connection response returned by the second application in response to the connection request information.
9. The method according to claim 8, characterized in that The first device includes one or more first applications, each of the first applications has a unique first virtual identifier, and the method further includes: Based on a virtual identification database configured on the first device, the first virtual identification of one or more of the first applications is updated.
10. The method according to claim 9, characterized in that The updating of the first virtual identification of one or more first applications based on the virtual identification database configured on the first device includes: determining a target application from one or more of said first applications; calling the virtual identification database through the target application; The first virtual identification of the target application is updated based on the virtual identification database.
11. The method according to claim 7, 9 or 10, characterized in that: The virtual identification database is a dynamic database.
12. A device connection device, characterized in that: include: A connection request information receiving module, configured to receive connection request information of a first device, wherein the connection request information includes a first virtual identifier for identifying the first device; A connection response module is used to trigger the second device to make a connection response based on historical connection data between the second device and the first device when it is determined that the first device is a historical connection device of the second device based on the first virtual identifier, wherein the historical connection device is a device that has established a connection with the second device based on any wireless connection protocol.
13. A device connection device, characterized in that: include: A connection request information generating module, configured to generate connection request information, wherein the connection request information includes a first virtual identifier for identifying a first device; A connection request information broadcasting module, used for broadcasting the connection request information; A connection module is used to establish a wireless connection between the first device and the second device based on a connection response returned by the second device in response to the connection request information.
14. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 or 6 to 11 is implemented.
15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 or 6 to 11 is implemented.
Citation Information
Cited By
Bluetooth connection control method, device and system
CN121509953A
Bluetooth connection control methods, devices and systems
CN121509953B
