Communication method and device, equipment and storage medium

By carrying identifiers and device identifiers in the Beacon connection broadcast between devices and re-establishing the connection when the conditions are met, the problem of low efficiency of non-first connections between devices is solved, and the connection success rate and communication performance are improved.

CN119729699APending Publication Date: 2025-03-28GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411779014.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, non-first connections between devices are relatively low and the connection success rate is not high, which seriously affects communication performance.

Method used

By receiving the beacon connection broadcast sent by the second device while performing beacon listening, it carries the first identifier, the primary device identifier and the secondary device identifier, and re-establishes the connection with the second device when the reconnection condition is met.

Benefits of technology

It improves the connection efficiency and connection success rate between devices, improves communication performance, and makes automatic reconnection between devices more efficient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729699A_ABST
    Figure CN119729699A_ABST
Patent Text Reader

Abstract

The invention discloses a communication method, and the method comprises the steps: receiving a beacon connection broadcast sent by a second device under the condition of executing beacon monitoring; wherein the beacon connection broadcast carries a first identifier, a primary device identifier and a secondary device identifier, and the second device is a historical connection device that has established a connection with the first device; and under the condition that the first identifier, the primary device identifier and the secondary device identifier meet the reconnection condition, reestablishing connection with the second device. When it is determined that the first device is reconnected, determining a first identifier, a primary device identifier and a secondary device identifier; wherein the first equipment is historical connection equipment which establishes connection with the second equipment; sending a beacon connection broadcast to the first device so as to reestablish a connection with the first device; wherein the beacon connection broadcast carries the first identifier, the primary device identifier and the secondary device identifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a communication method and apparatus, equipment and storage medium. Background Art

[0002] Establishing a connection between devices and recording the other device user identifier (Identity, ID) for subsequent communication is a common requirement, especially in scenarios such as the Internet of things (IoT), Bluetooth device pairing, and network communication.

[0003] However, during non-first connection processes, the connection efficiency between devices is low. Summary of the invention

[0004] The embodiments of the present application provide a communication method and apparatus, a device and a storage medium, which improve the connection efficiency and connection success rate between devices and enhance the communication performance.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a communication method, which is applied to a first device, and the method includes:

[0007] In the case of performing beacon monitoring, receiving a beacon connection broadcast sent by the second device; wherein the beacon connection broadcast carries the first identifier, the primary device identifier, and the secondary device identifier, and the second device is a historically connected device that has established a connection with the first device;

[0008] When the first identifier, the primary device identifier, and the secondary device identifier satisfy the reconnection condition, re-establishing the connection with the second device.

[0009] In a second aspect, an embodiment of the present application provides a communication method, which is applied to a second device, and the method includes:

[0010] In the case of determining to reconnect the first device, determining the first identifier, the primary device identifier, and the secondary device identifier; wherein the first device is a historically connected device that has established a connection with the second device;

[0011] A beacon connection broadcast is sent to the first device to re-establish a connection with the first device; wherein the beacon connection broadcast carries the first identifier, the primary device identifier, and the secondary device identifier.

[0012] In a third aspect, an embodiment of the present application provides a communication device, the communication device comprising:

[0013] A receiving unit, configured to receive a beacon connection broadcast sent by a second device when performing beacon monitoring; wherein the beacon connection broadcast carries a first identifier, a primary device identifier, and a secondary device identifier, and the second device is a historically connected device that has established a connection with the first device;

[0014] The connection unit is used to re-establish a connection with the second device when the first identifier, the primary device identifier and the secondary device identifier meet a reconnection condition.

[0015] In a fourth aspect, an embodiment of the present application provides a communication device, the communication device comprising:

[0016] A determination unit, configured to determine the first identifier, the primary device identifier, and the secondary device identifier when determining to reconnect to the first device; wherein the first device is a historically connected device that has established a connection with the second device;

[0017] A sending unit is used to send a beacon connection broadcast to the first device to re-establish a connection with the first device; wherein the beacon connection broadcast carries a first identifier, a primary device identifier, and a secondary device identifier.

[0018] In a fifth aspect, an embodiment of the present application provides a computer device, which is applied to a first device or a second device. The computer device includes a processor and a memory storing instructions executable by the processor. When the instructions are executed by the processor, the method of the first aspect or the second aspect is implemented.

[0019] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the method of the first aspect or the second aspect described above is implemented.

[0020] The embodiment of the present application provides a communication method and apparatus, a device and a storage medium, in the case of performing beacon monitoring, receiving a beacon connection broadcast sent by a second device; wherein the beacon connection broadcast carries a first identifier, a main device identifier and a secondary device identifier, and the second device is a historically connected device that has established a connection with the first device; when the first identifier, the main device identifier and the secondary device identifier meet the reconnection condition, re-establishing a connection with the second device. In the case of determining to reconnect the first device, determining the first identifier, the main device identifier and the secondary device identifier; wherein the first device is a historically connected device that has established a connection with the second device; sending a beacon connection broadcast to the first device to re-establish a connection with the first device; wherein the beacon connection broadcast carries the first identifier, the main device identifier and the secondary device identifier. That is, in the present application, for the two end devices that have established a connection, the reconnection initiator can send a beacon connection broadcast carrying the first identifier, the main device identifier and the secondary device identifier to the opposite end device, so that the opposite end device reconnects based on the first identifier, the main device identifier and the secondary device identifier. It can be seen that in the present application, the devices at both ends can automatically reconnect by setting and monitoring the beacon connection broadcast carrying the first identifier, the main device identifier and the secondary device identifier, thereby improving the connection efficiency and connection success rate between devices and improving the communication performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 A schematic diagram of a communication method implementation process proposed in an embodiment of the present application;

[0022] Figure 2 A schematic diagram of a communication method implementation process proposed in an embodiment of the present application;

[0023] Figure 3 A schematic diagram of a communication method proposed in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of a communication method implementation process proposed in an embodiment of the present application;

[0025] Figure 5 A schematic diagram of a communication method implementation process proposed in an embodiment of the present application;

[0026] Figure 6 A schematic diagram of a communication method proposed in an embodiment of the present application;

[0027] Figure 7 A schematic diagram of the implementation flow of the communication method proposed in the embodiment of the present application;

[0028] Figure 8 A schematic diagram of the implementation flow of the communication method proposed in the embodiment of the present application;

[0029] Fig. 9 A schematic diagram of the implementation of registration and monitoring proposed in the embodiment of the present application;

[0030] Fig.10 A schematic diagram of a communication method proposed in an embodiment of the present application;

[0031] Fig.11 A schematic diagram of the composition structure of a first communication device proposed in an embodiment of the present application;

[0032] Fig.12 A schematic diagram of the structure of the second communication device proposed in the embodiment of the present application;

[0033] Fig.13 A schematic diagram of the composition structure of the computer device proposed in an embodiment of the present application. DETAILED DESCRIPTION

[0034] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It is understood that the specific embodiments described herein are only used to explain the difference application, rather than to limit the application. It should also be noted that, for the convenience of description, only the parts that are different from the related applications are shown in the drawings.

[0035] Establishing a connection between devices and recording the other device user identifier (ID) for subsequent communication is a common requirement, especially in scenarios such as the Internet of Things (IoT), Bluetooth device pairing, and network communication.

[0036] For the first device connection, when two devices try to connect for the first time, they need to go through a series of handshakes or authentication processes to confirm each other's identity. This process may involve steps such as encryption key exchange and device authentication, depending on the application scenario and security requirements. Specifically, device discovery is performed first, that is, a device (usually called a "client") scans the surrounding devices (called "servers" or "peer devices") to find potential connection objects. Then a connection request is performed, that is, the client sends a connection request to the server, which may contain some basic information, such as device type, supported protocol version, etc. Then authentication and key exchange are performed. If security is required, the two parties authenticate each other and exchange encryption keys. Finally, connection establishment is performed, that is, once authentication and key exchange are successful, the two parties establish a connection.

[0037] Furthermore, the other device ID can be recorded. After the connection is established, each device should record the other device ID. This ID can be the device's Media Access Control Address (MAC address), Universally Unique Identifier (UUID), or other custom unique identifier. Specifically, the device ID can be obtained first, that is, during the connection establishment process, obtain its ID from the other device. Then store the device ID, that is, store the other device ID in local storage, such as memory, files, databases, etc., for subsequent use. Finally, update the device list. If the device supports communication with multiple devices, a device list can be maintained to track all connected or known devices.

[0038] Furthermore, subsequent communication is performed through the recorded device ID. In subsequent communications, the device can identify the other party through the previously recorded device ID and directly initiate communication without having to go through the complete connection and authentication process again. Specifically, the device ID can be searched first. When communication is required, the device first searches for the ID of the target device in its storage. Then direct communication is established. If the ID of the target device is found and both parties are online, a communication connection can be directly established. Then data exchange is performed, that is, data transmission and exchange are performed through the established connection. Finally, connection management can be performed, that is, maintaining the connection status and handling abnormal situations such as disconnection and reconnection.

[0039] In the subsequent communication process through the recorded device ID, even if the ID of the target device is found, if the target device is not online, a communication connection cannot be established directly.

[0040] In other words, common technologies all require manual startup of the corresponding application or service to initiate a non-initial connection and subsequent processing. If the peer application is not started, the local application cannot actively initiate a connection with the peer device and subsequent processing. The connection efficiency and success rate between devices are relatively poor, which seriously affects the communication performance.

[0041] In order to solve the above problems, the embodiment of the present application provides a communication method and apparatus, a device and a storage medium, in the case of performing beacon monitoring, receiving a beacon connection broadcast sent by a second device; wherein the beacon connection broadcast carries a first identifier, a main device identifier and a secondary device identifier, and the second device is a historically connected device that has established a connection with the first device; when the first identifier, the main device identifier and the secondary device identifier meet the reconnection condition, re-establishing a connection with the second device. In the case of determining to reconnect the first device, determining the first identifier, the main device identifier and the secondary device identifier; wherein the first device is a historically connected device that has established a connection with the second device; sending a beacon connection broadcast to the first device to re-establish a connection with the first device; wherein the beacon connection broadcast carries the first identifier, the main device identifier and the secondary device identifier. That is, in the present application, for the two end devices that have established a connection, the reconnection initiator can send a beacon connection broadcast carrying the first identifier, the main device identifier and the secondary device identifier to the opposite end device, so that the opposite end device reconnects based on the first identifier, the main device identifier and the secondary device identifier. It can be seen that in the present application, the devices at both ends can automatically reconnect by setting and monitoring the beacon connection broadcast carrying the first identifier, the main device identifier and the secondary device identifier, thereby improving the connection efficiency and connection success rate between devices and improving the communication performance.

[0042] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0043] An embodiment of the present application provides a communication method, which can be applied to a communication device (eg, a first communication device) or an electronic device (eg, a first device), and can also be applied to any terminal including a communication device or an electronic device.

[0044] Below, taking the first device as an example, the communication method proposed in the embodiment of the present application is exemplarily described.

[0045] Furthermore, in the embodiments of the present application, Figure 1 The communication method proposed in the embodiment of the present application is implemented as a flow chart. Figure 1 As shown, the communication method may include the following steps:

[0046] Step 101: While performing beacon monitoring, receive a beacon connection broadcast sent by a second device; wherein the beacon connection broadcast carries a first identifier, a primary device identifier, and a secondary device identifier, and the second device is a historically connected device that has established a connection with the first device.

[0047] In an embodiment of the present application, when performing beacon monitoring, the first device can receive the beacon connection broadcast sent by the second device.

[0048] Among them, beacon refers specifically to the broadcast protocol based on the Bluetooth Low Energy (BLE) protocol, and the BLE peripheral device with this broadcast protocol. It is usually placed in a fixed position indoors and broadcasts continuously to the surroundings, but cannot connect to any low-power Bluetooth host. All broadcast data is arranged under specific rules.

[0049] Furthermore, in an embodiment of the present application, the second device is a historically connected device that has established a connection with the first device. That is, a connection has been established between the first device and the second device, and the beacon connection broadcast sent by the second device is used to establish a connection with the first device again, rather than establishing a first connection with the first device.

[0050] Further, in an embodiment of the present application, the beacon connection broadcast may carry information and data, including but not limited to the first identifier, the primary device identifier, and the secondary device identifier.

[0051] It can be understood that in the embodiments of the present application, the first identifier may be a unique identifier. For example, the first identifier may include but is not limited to a universally unique identifier (UUID) or other custom unique identifiers.

[0052] It is understandable that in the embodiments of the present application, the main device identifier can be understood as a defined Major value, and the secondary device identifier can be understood as a defined Minor value. Among them, in Bluetooth beacon technology, the Major value is generally used to distinguish beacon groups with the same UUID. For example, in an application scenario of a shopping mall, each floor can be assigned a different Major value so that the smartphone application can identify the floor the user is currently on. The Minor value is used to further distinguish beacon groups with the same UUID and Major value. For example, in a shopping mall, different stores or areas on each floor can be assigned different Minor values. In this way, when the user approaches a specific store, the smartphone application can provide corresponding information or services through the identified Minor value.

[0053] That is, in the embodiments of the present application, in the Bluetooth beacon technology, the primary device identifier (Major value) and the secondary device identifier (Minor value) can be used to identify and distinguish different Bluetooth devices or locations.

[0054] It can be understood that in an embodiment of the present application, the secondary device identifier carried in the beacon connection broadcast sent by the second device may include the identifier of the second device, that is, the secondary device identifier in the beacon connection broadcast is used to indicate the identifier of the second device sending the beacon connection broadcast.

[0055] It is understood that in the embodiment of the present application, the primary device identifier may be the identifier of the device receiving the beacon connection broadcast, and the secondary device identifier may be the identifier of the device sending the beacon connection broadcast, such as the identifier of the second device. The device receiving the beacon connection broadcast is a historically connected device that has established a connection with the second device, including but not limited to the first device.

[0056] For the sender of the beacon connection broadcast, such as the second device, when registering for beacon monitoring, the Major value is set to the second device's ID2, and the Minor value is set to the first device's ID1. When sending a beacon connection broadcast, the Major value carried is the first device's ID1, and the Minor value is the second device's ID2.

[0057] For the receiver of the beacon connection broadcast, such as the first device, the information carried in the received beacon connection broadcast is consistent with the information when registering for beacon monitoring, that is, the Major value is the identifier ID1 of the first device, and the Minor value is the identifier ID2 of the second device.

[0058] That is to say, the communication method proposed in the embodiment of the present application redefines the format of BLE beacon so that the non-directional broadcast message is designed as a directional broadcast, thereby achieving precise control of the connection of historical devices.

[0059] Furthermore, in the embodiments of the present application, Figure 2 The communication method proposed in the embodiment of the present application is implemented as a flow chart. Figure 2 As shown, before receiving the beacon connection broadcast sent by the second device, that is, before step 101, the communication method may further include the following steps:

[0060] Step 103: When the first connection is established between the first application and the second application of the second device, determine the identifier of the second device and determine the identifier value between the first application and the second device.

[0061] In an embodiment of the present application, when establishing an initial connection between a first application and a second application of a second device, the first device may first determine an identifier of the second device and simultaneously determine an identifier value between the first device and the second device.

[0062] Further, in the embodiments of the present application, the first connection between the first device and the second device can be understood as the first application in the first device and the second application in the second device being connected in accordance with an agreed connection method. The agreed connection method of the two-end devices may include but is not limited to Bluetooth (BT), low-power Bluetooth BLE, Wi-Fi connection, etc.

[0063] Among them, Bluetooth BT is a wireless technology and communication open standard for transmitting data between various electronic devices. Classic Bluetooth has relatively high power consumption and is suitable for devices that require continuous communication and data transmission, such as audio devices, keyboards, and mice. Classic Bluetooth has a high transmission rate and is suitable for scenarios where large amounts of data need to be transmitted, such as audio files and high-quality images. Classic Bluetooth is widely used in audio devices (such as headphones, speakers), keyboards, mice, and game controllers. It is also used for short-range data transmission and synchronization, such as transferring photos from a mobile phone to a computer. Classic Bluetooth supports pairing and connection between devices, with strong security and stability. It can also be used in combination with other wireless technologies (such as Wi-Fi) to provide a more comprehensive communication solution.

[0064] Among them, BLE, which can also be called Bluetooth Low Energy, is a variant of Bluetooth technology designed to reduce power consumption and extend battery life. BLE is also known as part of Bluetooth 4.0 and later versions, which uses an optimized communication protocol to reduce energy consumption. BLE's power consumption is significantly reduced, making it ideal for battery-powered devices such as smart watches, health monitoring devices, and Internet of Things (IoT) sensors. BLE has a relatively low transmission rate, but it is sufficient to meet the data transmission needs of IoT devices and sensors. Its optimization focuses on low power consumption and long-distance communication. BLE is widely used in the fields of Internet of Things (IoT), health monitoring, smart homes, and wearable devices. It allows devices to communicate in a low-power manner, which is ideal for devices that need to run for a long time and rely on battery power.

[0065] Among them, Wi-Fi is a technology that allows electronic devices to connect to a wireless local area network (WLAN), which is usually used to access the Internet. Wi-Fi is based on the IEEE 802.11 standard and has multiple versions, such as 802.11b, 802.11g, 802.11n, 802.11ac, and 802.11ax (Wi-Fi 6). The power consumption of Wi-Fi is between BT and BLE, depending on the activity state of the device and the quality of the connection. The power consumption of Wi-Fi may be higher during data transmission, but lower in standby mode. Wi-Fi provides very high transmission rates and is suitable for scenarios that require high-speed data transmission, such as online video streaming, online games, and large file downloads. Wi-Fi is mainly used to provide wireless Internet access and is suitable for a variety of devices such as smartphones, tablets, laptops, and smart TVs. It is also used for device interconnection and resource sharing in home and enterprise networks.

[0066] It can be understood that in the embodiments of the present application, the first device and the second device can determine which connection mode to select based on specific application requirements, device power consumption requirements, and data transmission requirements.

[0067] It is understood that in the embodiments of the present application, when the first device is connected to the second device for the first time, the first device can obtain and store data and information related to the second device. For example, the first device can determine the identification of the second device, the MAC address, and the identification value agreed with the second device.

[0068] Exemplarily, in some embodiments, the identification value agreed upon with the second device may be a fixed UUID value agreed upon between the first device and the second device, or may be other fixed identification value agreed upon by both parties, which is not specifically limited in this application.

[0069] Step 104: The first application registers beacon monitoring with the system service in the first device based on the identification value, the identification of the first device, and the identification of the second device.

[0070] In an embodiment of the present application, when the first connection is established between the first application and the second application of the second device, after determining the identification of the second device and the identification value between the first application and the second device, the first application in the first device can register beacon monitoring with the system service in the first device based on the identification value, the identification of the first device and the identification of the second device.

[0071] It can be understood that in an embodiment of the present application, system services may include but are not limited to system BLE services. For example, the first application may send a registration request for beacon monitoring to the system BLE service, and register for beacon monitoring with the system BLE service based on the identification value, the identification of the first device and the identification of the second device.

[0072] Furthermore, in an embodiment of the present application, when registering for beacon monitoring based on the identification value, the identification of the first device and the identification of the second device, the first device can choose to determine the agreed identification value determined when the two parties are first connected as the identifier, and can set the Major value according to the identification of the local device, that is, the identification of the first device, and can also set the Minor value according to the identification of the opposite device, that is, the identification of the second device.

[0073] That is to say, in an embodiment of the present application, the first device registering beacon monitoring may include setting an identifier, a Major value, and a Minor value.

[0074] It can be understood that in an embodiment of the present application, in the process of registering beacon monitoring, the data size of the Major value and / or the Minor value can be limited. For example, the data size of the Major value and / or the Minor value can be limited to 2 bytes. If the identifier of the first device and / or the identifier of the second device exceeds the 2-byte limit, a hash algorithm can be used to process it into 2-byte data.

[0075] For example, in some embodiments, the first application in the first device can register beacon monitoring with the system BLE service. Assuming that the identification value agreed upon by the first device and the second device is UUID1, the identification of the first device is ID1, and the identification of the second device is ID2, then registering beacon monitoring may include setting the identifier UUID to the identification value UUID1, setting the Major value to the identification ID1 of the first device, and setting the Minor value to the identification ID2 of the second device.

[0076] Step 105: The system service in the first device performs beacon monitoring based on the identification value, the identification of the first device, and the identification of the second device.

[0077] In an embodiment of the present application, after the first application registers for beacon monitoring based on the identification value, the identification of the first device and the identification of the second device, the system service in the first device can further perform beacon monitoring based on the identification value, the identification of the first device and the identification of the second device.

[0078] It is understandable that in the embodiment of the present application, after the BLE service receives the registration event of the first application, it can monitor the broadcast of the BLE beacon, and the monitoring can be achieved even after the application is exited.

[0079] That is to say, in the embodiment of the present application, after completing the registration of beacon monitoring, the first device can perform beacon monitoring regardless of whether the first device and the second device are in a connected state.

[0080] Exemplarily, in some embodiments, after the first application registers beacon monitoring with the system BLE service, the system BLE service may continue to perform beacon monitoring according to the registered information, that is, the system BLE service performs beacon monitoring based on identifier UUID1, Major value ID1, and Minor value ID2.

[0081] Step 102: When the first identifier, the primary device identifier, and the secondary device identifier satisfy a reconnection condition, reestablish a connection with the second device.

[0082] In an embodiment of the present application, when performing beacon monitoring, after receiving the beacon connection broadcast sent by the second device, the first device can further re-establish a connection with the second device based on the first identifier, primary device identifier and secondary device identifier carried in the beacon connection broadcast.

[0083] It is understandable that in the embodiment of the present application, after receiving the beacon connection broadcast sent by the second device, the first device can first determine whether the first identifier, the primary device identifier, and the secondary device identifier meet the reconnection condition. If the reconnection condition is met, the first device can further perform the reconnection process with the second device; if the reconnection condition is not met, the first device can skip the reconnection with the second device.

[0084] Further, in an embodiment of the present application, when determining whether the first identifier, the main device identifier and the secondary device identifier meet the reconnection condition, the first device can respectively compare the first identifier with the identification value determined at the first connection, the main device identifier with the identifier of the first device, and the secondary device identifier with the identifier of the second device determined at the first connection, so as to determine whether the reconnection condition is met.

[0085] Further, in an embodiment of the present application, if the first identifier is the same as the identification value, and the primary device identification is the same as the identification of the first device, and the secondary device identification is the same as the identification of the second device, then it can be determined that the reconnection condition is met. If the first identifier is different from the identification value, or the primary device identification is different from the identification of the first device, or the secondary device identification is different from the identification of the second device, then it can be determined that the reconnection condition is not met.

[0086] That is to say, in an embodiment of the present application, if the information and data carried in the received beacon connection broadcast are consistent with the information and data obtained and stored by the first device when registering for beacon monitoring, then it can be determined that the reconnection request indicated by the beacon connection broadcast is accurate, and therefore it can be chosen to re-establish a connection with the second device that sent the beacon connection broadcast.

[0087] Accordingly, in an embodiment of the present application, if the information and data carried in the received beacon connection broadcast are inconsistent with the information and data obtained and stored by the first device when registering for beacon monitoring, for example, the main device identifier is different from the identifier of the first device, then the first device may believe that the monitored beacon connection broadcast is not sent to itself, but to other devices, and may then choose to skip re-establishing a connection with the second device.

[0088] Further, in an embodiment of the present application, when re-establishing a connection with the second device, the first device may choose to run the first application to re-establish a connection with the second device.

[0089] It is understandable that in the embodiment of the present application, when it is determined to re-establish the connection, the system BLE service can pull up the first application that registered the beacon monitoring, so that the connection can be re-established according to the connection method agreed upon by the two-end devices. The connection method agreed upon by the two-end devices may include but is not limited to BT, BLE, Wi-Fi connection, etc.

[0090] In summary, the communication method proposed in the embodiment of the present application can, on the one hand, set the beacon information of the historically connected device, and on the other hand, perform system-level BLE beacon monitoring. In other words, the automatic reconnection between historically connected devices can be achieved by setting the beacon information and monitoring the beacon broadcast.

[0091] It can be seen that the communication method proposed in the embodiment of the present application can realize automatic triggering of historical device connections by redefining the format content of BLE beacon, and can automatically launch the application without manually launching the application, thereby realizing fast connection between historical devices.

[0092] For example, in some embodiments, Figure 3 A schematic diagram of the communication method proposed in the embodiment of the present application is shown in FIG. Figure 3As shown, for the first device, after the first application establishes the first connection with the second application of the second device, it can register beacon monitoring with the system BLE service, wherein when registering beacon monitoring, the identifier UUID can be set to the identifier value UUID1 agreed upon during the first connection, the Major value is set to the ID of the local device, that is, the identifier of the first device, and the Minor value is set to the ID of the opposite device, that is, the identifier of the second device. After receiving the registration event of the application, the system BLE service starts to monitor the broadcast of the BLEbeacon. Subsequently, even if the first application is disconnected from the second application, the system BLE service continues to monitor the broadcast of the BLEbeacon. The system BLE service of the first device scans the beacon connection broadcast sent by the second device, such as beacon1. If it is consistent with the registered beacon monitoring, that is, the identifier UUID included in beacon1 is UUID1, the Major value is the ID of the local device, that is, the identifier of the first device, and the Minor value is the ID of the opposite device, that is, the identifier of the second device, then the system BLE service can pull up the first application that registered the beacon monitoring and re-establish a connection with the second device.

[0093] An embodiment of the present application proposes a communication method, in which a beacon connection broadcast sent by a second device is received while beacon monitoring is performed; wherein the beacon connection broadcast carries a first identifier, a primary device identifier, and a secondary device identifier, and the second device is a historically connected device that has established a connection with the first device; and when the first identifier, the primary device identifier, and the secondary device identifier meet the reconnection condition, a connection is reestablished with the second device. That is to say, in the present application, for the two end devices that have established a connection, the reconnection initiator can send a beacon connection broadcast carrying the first identifier, the primary device identifier, and the secondary device identifier to the opposite end device, so that the opposite end device reconnects based on the first identifier, the primary device identifier, and the secondary device identifier. It can be seen that in the present application, the two end devices can automatically achieve reconnection by setting and monitoring the beacon connection broadcast carrying the first identifier, the primary device identifier, and the secondary device identifier, thereby improving the connection efficiency and connection success rate between devices and improving communication performance.

[0094] Based on the above embodiments, another embodiment of the present application proposes a communication method, which can be applied to a communication device (such as a second communication device) or an electronic device (such as a second device), and can also be applied to any terminal including a communication device or an electronic device.

[0095] Below, taking the second device as an example, the communication method proposed in the embodiment of the present application is exemplarily described.

[0096] Furthermore, in the embodiments of the present application, Figure 4The communication method proposed in the embodiment of the present application is implemented as a flow chart. Figure 4 As shown, the communication method may include the following steps:

[0097] Step 201: When it is determined that the first device is to be reconnected, a first identifier, a primary device identifier, and a secondary device identifier are determined; wherein the first device is a historically connected device that has established a connection with the second device.

[0098] In an embodiment of the present application, if the second device determines to re-establish a connection with the first device, the first identifier, the primary device identifier, and the secondary device identifier may be determined first.

[0099] Further, in an embodiment of the present application, the first device is a historically connected device that has established a connection with the second device. In other words, a connection has been established between the first device and the second device.

[0100] It can be understood that in the embodiments of the present application, the first identifier may be a unique identifier. For example, the first identifier may include but is not limited to a universally unique identifier (UUID) or other custom unique identifiers.

[0101] It is understandable that in the embodiments of the present application, the main device identifier can be understood as a defined Major value, and the secondary device identifier can be understood as a defined Minor value. Among them, in Bluetooth beacon technology, the Major value is generally used to distinguish beacon groups with the same UUID. For example, in an application scenario of a shopping mall, each floor can be assigned a different Major value so that the smartphone application can identify the floor the user is currently on. The Minor value is used to further distinguish beacon groups with the same UUID and Major value. For example, in a shopping mall, different stores or areas on each floor can be assigned different Minor values. In this way, when the user approaches a specific store, the smartphone application can provide corresponding information or services through the identified Minor value.

[0102] That is, in the embodiments of the present application, in the Bluetooth beacon technology, the primary device identifier (Major value) and the secondary device identifier (Minor value) can be used to identify and distinguish different Bluetooth devices or locations.

[0103] Furthermore, in the embodiments of the present application, Figure 5 The communication method proposed in the embodiment of the present application is implemented as a flow chart. Figure 5 As shown, the communication method may further include the following steps:

[0104] Step 203: When the first connection is established between the second application and the first application of the first device, determine the identifier of the first device and determine the identifier value between the second application and the first device.

[0105] In an embodiment of the present application, when the first connection is established between the second application and the first application of the first device, the second device may first determine the identifier of the first device and simultaneously determine the identifier value between the second device and the first device.

[0106] Further, in the embodiments of the present application, the first connection between the second device and the first device can be understood as the first application in the first device and the second application in the second device being connected in accordance with an agreed connection method. The agreed connection method of the two-end devices may include but is not limited to BT, BLE, Wi-Fi connection, etc.

[0107] It can be understood that in the embodiments of the present application, the first device and the second device can determine which connection mode to select based on specific application requirements, device power consumption requirements, and data transmission requirements.

[0108] It is understood that in the embodiments of the present application, when the second device is connected to the first device for the first time, the second device can obtain and store data and information related to the first device. For example, the second device can determine the identification of the first device, the MAC address, and the identification value agreed with the first device.

[0109] Exemplarily, in some embodiments, the identification value agreed upon with the first device may be a fixed UUID value agreed upon between the first device and the second device, or may be other fixed identification value agreed upon by both parties, which is not specifically limited in this application.

[0110] Step 204: The second application registers beacon monitoring with the system service in the second device based on the identification value, the identification of the first device and the identification of the second device.

[0111] In an embodiment of the present application, when the first connection is established between the second application and the first application of the first device, after determining the identification of the first device and the identification value between the second application and the first device, the second application in the second device can register beacon monitoring with the system service in the second device based on the identification value, the identification of the first device and the identification of the second device.

[0112] It can be understood that in an embodiment of the present application, system services may include but are not limited to system BLE services. For example, the second application can send a registration request for beacon monitoring to the system BLE service, and register for beacon monitoring with the system BLE service based on the identification value, the identification of the first device and the identification of the second device.

[0113] Furthermore, in an embodiment of the present application, when registering for beacon monitoring based on the identification value, the identification of the second device and the identification of the first device, the second device can choose to determine the agreed identification value determined when the two parties are first connected as the identifier, and can set the Major value according to the identification of the local device, that is, the identification of the second device, and can also set the Minor value according to the identification of the opposite device, that is, the identification of the first device.

[0114] That is to say, in the embodiment of the present application, the second device registering beacon monitoring may include setting an identifier, a Major value, and a Minor value.

[0115] It can be understood that in an embodiment of the present application, in the process of registering beacon monitoring, the data size of the Major value and / or the Minor value can be limited. For example, the data size of the Major value and / or the Minor value can be limited to 2 bytes. If the identifier of the first device and / or the identifier of the second device exceeds the 2-byte limit, a hash algorithm can be used to process it into 2-byte data.

[0116] For example, in some embodiments, the second application in the second device can register beacon monitoring with the system BLE service. Assuming that the identification value agreed upon by the second device and the first device is UUID1, the identification of the first device is ID1, and the identification of the second device is ID2, then registering beacon monitoring may include setting the identifier UUID to the identification value UUID1, setting the Major value to the identification ID2 of the second device, and setting the Minor value to the identification ID1 of the first device.

[0117] Step 205: The system service in the second device performs beacon monitoring based on the identification value, the identification of the first device and the identification of the second device.

[0118] In an embodiment of the present application, after the second application registers for beacon monitoring based on the identification value, the identification of the first device and the identification of the second device, the system service in the second device can further perform beacon monitoring based on the identification value, the identification of the first device and the identification of the second device.

[0119] It is understandable that in the embodiment of the present application, after the BLE service receives the registration event of the second application, it can monitor the broadcast of the BLE beacon, and the monitoring can be achieved even after the application is exited.

[0120] That is to say, in the embodiment of the present application, after completing the registration of beacon monitoring, the second device can perform beacon monitoring regardless of whether the first device and the second device are in a connected state.

[0121] Exemplarily, in some embodiments, after the second application registers beacon monitoring with the system BLE service, the system BLE service can continue to perform beacon monitoring according to the registered information, that is, the system BLE service performs beacon monitoring based on identifier UUID1, Major value ID2, and Minor value ID1.

[0122] Furthermore, in an embodiment of the present application, when determining the first identifier, the primary device identifier and the secondary device identifier, the first identifier can be determined based on the identifier value; the primary device identifier can be determined based on the identifier of the first device; and the secondary device identifier can be determined based on the identifier of the second device.

[0123] That is to say, in an embodiment of the present application, when registering for beacon monitoring, the second device can choose to set the Major value based on the ID of the local device, that is, the identifier of the second device, and set the Minor value based on the ID of the opposite device, that is, the identifier of the first device. In contrast, when it is determined that a connection needs to be reestablished with the first device, the second device can choose to set the primary device identifier (Major value) based on the ID of the opposite device, that is, the identifier of the first device, and set the secondary device identifier (Minor value) based on the ID of the local device, that is, the identifier of the second device.

[0124] Step 202: Send a beacon connection broadcast to the first device to re-establish a connection with the first device; wherein the beacon connection broadcast carries the first identifier, the primary device identifier, and the secondary device identifier.

[0125] In an embodiment of the present application, if it is determined to reconnect to the first device, after determining the first identifier, the primary device identifier and the secondary device identifier, the second device may further send a beacon connection broadcast to the first device to reestablish a connection with the first device.

[0126] It can be understood that, in the embodiment of the present application, the beacon connection broadcast sent by the second device is used to re-establish a connection with the first device, rather than establishing an initial connection with the first device.

[0127] Further, in an embodiment of the present application, the beacon connection broadcast may carry information and data, including but not limited to the first identifier, the primary device identifier, and the secondary device identifier.

[0128] It can be understood that in an embodiment of the present application, the secondary device identifier carried in the beacon connection broadcast sent by the second device may include the identifier of the second device, that is, the secondary device identifier in the beacon connection broadcast is used to indicate the identifier of the second device sending the beacon connection broadcast.

[0129] It is understood that in the embodiment of the present application, the primary device identifier may be the identifier of the device receiving the beacon connection broadcast, and the secondary device identifier may be the identifier of the device sending the beacon connection broadcast, such as the identifier of the second device. The device receiving the beacon connection broadcast is a historically connected device that has established a connection with the second device, including but not limited to the first device.

[0130] For the sender of the beacon connection broadcast, such as the second device, when registering for beacon monitoring, the Major value is set to the second device's ID2, and the Minor value is set to the first device's ID1. When sending a beacon connection broadcast, the Major value carried is the first device's ID1, and the Minor value is the second device's ID2.

[0131] For the receiver of the beacon connection broadcast, such as the first device, the information carried in the received beacon connection broadcast is consistent with the information when registering for beacon monitoring, that is, the Major value is the identifier ID1 of the first device, and the Minor value is the identifier ID2 of the second device.

[0132] That is to say, the communication method proposed in the embodiment of the present application redefines the format of BLE beacon so that the non-directional broadcast message is designed as a directional broadcast, thereby achieving precise control of the connection of historical devices.

[0133] That is to say, in an embodiment of the present application, if it is necessary to re-establish a connection with the first device, the second device can choose to set the primary device identifier carried in the beacon connection broadcast according to the identifier of the first device obtained and stored, and set the secondary device identifier carried in the beacon connection broadcast according to its own identifier, and set the first identifier carried in the beacon connection broadcast according to the identifier value agreed with the first device.

[0134] Accordingly, in an embodiment of the present application, after sending a beacon connection broadcast, the second device can enable the first device to compare the information and data carried in the received beacon connection broadcast with the information and data obtained and stored by the first device when registering for beacon monitoring. If the two are consistent, it can be determined that the reconnection request indicated by the beacon connection broadcast is accurate, thereby achieving reconnection of the devices at both ends.

[0135] For example, in some embodiments, if it is necessary to re-establish a connection with the first device, the second application in the second device may choose to determine the agreed identification value determined when the two parties first connected as the first identifier, that is, set the first identifier UUID to the identification value UUID1, set the main device identifier, that is, the Major value, to the identifier ID1 of the first device, and set the secondary device identifier, that is, the Minor value, to the identifier ID2 of the second device. Then, a beacon connection broadcast may be sent based on the determined first identifier, main device identifier, and secondary device identifier to achieve reconnection with the first device.

[0136] Furthermore, in an embodiment of the present application, since the second application in the second device also registers for beacon monitoring with the system BLE service, the system BLE service can perform beacon monitoring according to the registered information. Therefore, the beacon connection broadcast used to indicate the re-establishment of the connection can also be sent by the first device to the second device. That is, if the first device determines that it needs to re-establish the connection with the second device, it can also determine the first identifier, the main device identifier, and the secondary device identifier, and send a beacon connection broadcast to the second device based on the determined first identifier, the main device identifier, and the secondary device identifier to achieve reconnection with the second device.

[0137] In summary, the communication method proposed in the embodiment of the present application can, on the one hand, set the beacon information of the historically connected device, and on the other hand, perform system-level BLE beacon monitoring. In other words, the automatic reconnection between historically connected devices can be achieved by setting the beacon information and monitoring the beacon broadcast.

[0138] It can be seen that the communication method proposed in the embodiment of the present application can realize automatic triggering of historical device connections by redefining the format content of BLE beacon, and can automatically launch the application without manually launching the application, thereby realizing fast connection between historical devices.

[0139] For example, in some embodiments, Figure 6 A schematic diagram of the communication method proposed in the embodiment of the present application is shown in FIG. Figure 6As shown, for the second device, after the second application establishes the first connection with the first application of the first device, it can register beacon monitoring with the system BLE service, wherein, when registering beacon monitoring, the identifier UUID can be set to the identifier value UUID1 agreed upon during the first connection, the Major value is set to the ID of the local device, that is, the identifier of the second device, and the Minor value is set to the ID of the opposite device, that is, the identifier of the first device. After receiving the registration event of the application, the system BLE service starts to monitor the broadcast of the BLEbeacon. Subsequently, even if the first application is disconnected from the second application, the system BLE service continues to monitor the broadcast of the BLEbeacon. If it is determined that it is necessary to re-establish a connection with the first device, the second device can send a beacon connection broadcast to the first device, such as beacon1, wherein the identifier UUID included in beacon1 is UUID1, the Major value is the ID of the local device, that is, the identifier of the first device, and the Minor value is the ID of the opposite device, that is, the identifier of the second device, to achieve reconnection with the first device.

[0140] An embodiment of the present application proposes a communication method, in the case of determining to reconnect to the first device, determining a first identifier, a primary device identifier and a secondary device identifier; wherein the first device is a historically connected device that has established a connection with the second device; sending a beacon connection broadcast to the first device to reestablish a connection with the first device; wherein the beacon connection broadcast carries the first identifier, the primary device identifier and the secondary device identifier. That is to say, in the present application, for the two end devices that have established a connection, the reconnection initiator can send a beacon connection broadcast carrying the first identifier, the primary device identifier and the secondary device identifier to the opposite end device, so that the opposite end device reconnects based on the first identifier, the primary device identifier and the secondary device identifier. It can be seen that in the present application, the two end devices can automatically achieve reconnection by setting and monitoring the beacon connection broadcast carrying the first identifier, the primary device identifier and the secondary device identifier, thereby improving the connection efficiency and connection success rate between devices and improving communication performance.

[0141] Based on the above embodiments, another embodiment of the present application proposes a communication method, which can be applied to a communication system including a first device and a second device, wherein the first device and the second device can achieve automatic reconnection based on BLE beacon technology.

[0142] Furthermore, in the embodiments of the present application, Figure 7 This is a schematic diagram of the implementation process of the communication method proposed in the embodiment of the present application, such as Figure 7 As shown, when the first device and the second device communicate, the following steps may be included:

[0143] Step 301: A first application of a first device establishes an initial connection with a second application of a second device.

[0144] In an embodiment of the present application, when the first device and the second device are connected for the first time, a series of handshake or authentication processes are required to confirm the identity of the other party.

[0145] Step 302: The first device and the second device agree on an identification value, record the identification of the second device, and synchronize the identification of the first device to the second device.

[0146] In an embodiment of the present application, when establishing an initial connection between a first application and a second application of a second device, the first device may first determine an identifier of the second device and simultaneously agree on an identifier value with the second device.

[0147] Accordingly, the second device may first determine the identification of the first device, and simultaneously agree on an identification value with the first device.

[0148] Step 303: The first application of the first device registers beacon monitoring with the system BLE service based on the identification value, the identification of the first device and the identification of the second device.

[0149] In an embodiment of the present application, the first application may send a registration request for beacon monitoring to the system BLE service, and register beacon monitoring with the system BLE service. Among them, the first device may choose to determine the agreed identification value determined when the two parties are first connected as the identifier, and may set the Major value according to the identification of the local device, that is, the identification of the first device, and may also set the Minor value according to the identification of the opposite device, that is, the identification of the second device.

[0150] Step 304: The second application of the second device registers beacon monitoring with the system BLE service based on the identification value, the identification of the first device and the identification of the second device.

[0151] In an embodiment of the present application, the second application can send a registration request for beacon monitoring to the system BLE service, and register beacon monitoring with the system BLE service. Among them, the first device can choose to determine the agreed identification value determined when the two parties are first connected as the identifier, and can set the Major value according to the identification of the local device, that is, the identification of the second device, and can also set the Minor value according to the identification of the opposite device, that is, the identification of the first device.

[0152] Step 305: The system BLE service of the first device performs beacon monitoring.

[0153] In an embodiment of the present application, after the BLE service receives the registration event of the first application, it can monitor the broadcast of the BLE beacon, and the monitoring can be achieved even after the first application exits.

[0154] Step 306: The system BLE service of the second device performs beacon monitoring.

[0155] In an embodiment of the present application, after the BLE service receives the registration event of the second application, it can monitor the broadcast of the BLE beacon, and the monitoring can be achieved even after the second application exits.

[0156] Step 307: The first device is disconnected from the second device.

[0157] Step 308: When it is determined that the connection with the second device is to be reestablished, the first device sends a beacon connection broadcast to the second device.

[0158] In an embodiment of the present application, if the first device determines to re-establish a connection with the second device, it can first determine the first identifier, the primary device identifier and the secondary device identifier, and then send a beacon connection broadcast carrying the first identifier, the primary device identifier and the secondary device identifier to the second device.

[0159] In an embodiment of the present application, the primary device identifier may be an identifier of a device that receives a beacon connection broadcast, such as an identifier of a second device, and the secondary device identifier may be an identifier of a device that sends a beacon connection broadcast, such as an identifier of a first device.

[0160] Step 309: If the first identifier, the primary device identifier, and the secondary device identifier carried in the beacon connection broadcast meet the reconnection condition, the second device launches the second application.

[0161] In an embodiment of the present application, the second device can determine whether the reconnection condition is met based on the first identifier, the main device identifier and the secondary device identifier carried in the beacon connection broadcast, wherein the second device can compare the first identifier with the identification value determined at the first connection, the main device identifier with the identifier of the second device, and the secondary device identifier with the identifier of the first device determined at the first connection, so as to determine whether the reconnection condition is met.

[0162] If the first identifier is the same as the identification value, the primary device identification is the same as the identification of the second device, and the secondary device identification is the same as the identification of the first device, then it can be determined that the reconnection condition is met, and the second application can be selected to run.

[0163] Step 310: The first application of the first device re-establishes a connection with the second application of the second device.

[0164] In an embodiment of the present application, based on the setting and monitoring of the beacon, the first application of the first device and the second application of the second device can re-establish a connection.

[0165] Furthermore, in the embodiments of the present application, Figure 8 This is a schematic diagram of the implementation process of the communication method proposed in the embodiment of the present application, such as Figure 8 As shown, when the first device and the second device communicate, the following steps may be included:

[0166] Step 301: A first application of a first device establishes an initial connection with a second application of a second device.

[0167] Step 302: The first device and the second device agree on an identification value, record the identification of the second device, and synchronize the identification of the first device to the second device.

[0168] Step 303: The first application of the first device registers beacon monitoring with the system BLE service based on the identification value, the identification of the first device and the identification of the second device.

[0169] Step 304: The second application of the second device registers beacon monitoring with the system BLE service based on the identification value, the identification of the first device and the identification of the second device.

[0170] Step 305: The system BLE service of the first device performs beacon monitoring.

[0171] Step 306: The system BLE service of the second device performs beacon monitoring.

[0172] Step 307: The first device is disconnected from the second device.

[0173] Step 311: When it is determined that the connection with the first device is to be reestablished, the second device sends a beacon connection broadcast to the first device.

[0174] In an embodiment of the present application, if the second device determines to re-establish a connection with the first device, it can first determine the first identifier, the primary device identifier and the secondary device identifier, and then send a beacon connection broadcast carrying the first identifier, the primary device identifier and the secondary device identifier to the first device.

[0175] In an embodiment of the present application, the primary device identifier may be an identifier of a device that receives a beacon connection broadcast, such as an identifier of a first device, and the secondary device identifier may be an identifier of a device that sends a beacon connection broadcast, such as an identifier of a second device.

[0176] Step 312: If the first identifier, the primary device identifier, and the secondary device identifier carried in the beacon connection broadcast meet the reconnection condition, the first device launches the first application.

[0177] In an embodiment of the present application, the first device can determine whether the reconnection condition is met based on the first identifier, the main device identifier and the secondary device identifier carried in the beacon connection broadcast, wherein the first device can compare the first identifier with the identification value determined at the first connection, the main device identifier with the identifier of the first device, and the secondary device identifier with the identifier of the second device determined at the first connection, so as to determine whether the reconnection condition is met.

[0178] If the first identifier is the same as the identification value, the primary device identification is the same as the identification of the first device, and the secondary device identification is the same as the identification of the second device, then it can be determined that the reconnection condition is met, and the first application can be selected to run.

[0179] Step 310: The first application of the first device re-establishes a connection with the second application of the second device.

[0180] In an embodiment of the present application, based on the setting and monitoring of the beacon, the first application of the first device and the second application of the second device can re-establish a connection.

[0181] In summary, the communication method proposed in the embodiment of the present application can, on the one hand, set the beacon information of the historically connected device, and on the other hand, perform system-level BLE beacon monitoring. In other words, the automatic reconnection between historically connected devices can be achieved by setting the beacon information and monitoring the beacon broadcast.

[0182] It can be seen that the communication method proposed in the embodiment of the present application can realize automatic triggering of historical device connections by redefining the format content of BLE beacon, and can automatically launch the application without manually launching the application, thereby realizing fast connection between historical devices.

[0183] The embodiment of the present application proposes a communication method, where the two end devices that have established a connection can send a beacon connection broadcast carrying a first identifier, a primary device identifier, and a secondary device identifier to the opposite end device, so that the opposite end device reconnects based on the first identifier, the primary device identifier, and the secondary device identifier. It can be seen that in the present application, the two end devices can automatically achieve reconnection by setting and monitoring the beacon connection broadcast carrying the first identifier, the primary device identifier, and the secondary device identifier, thereby improving the connection efficiency and connection success rate between devices and improving communication performance.

[0184] Based on the above embodiments, another embodiment of the present application proposes a communication method. In order to solve the problem in common technologies that the corresponding application or service needs to be manually launched to initiate a non-first connection, as well as subsequent processing, if the application of the other end is not launched, the application of the local device cannot actively initiate a connection and subsequent processing with the other end device. The embodiment of the present application can realize automatic reconnection of historically connected devices based on BLE's beacon technology.

[0185] That is to say, another embodiment of the present application proposes a communication method, which is a communication method for historically connected devices based on BLE beacon technology, wherein the communication method based on BLE beacon mainly includes the following two parts: the first part is to implement system-level BLE beacon monitoring; the second part is to set the beacon information of the historically connected device for the connected device so that the target historical device can recognize and process it.

[0186] Furthermore, when implementing system-level BLE beacon monitoring, BLE beacons have multiple formats, such as open source ALT beacon, iOS iBeacon, etc., all of which contain the beacon's UUID, Major, and Minor, where Major and Minor are both 2 bytes, which are used to distinguish different types of data of the same UUID beacon.

[0187] Among them, after registering the service to monitor beacon, even if the application is killed, it can still monitor the beacon in the background, and after monitoring, it can launch the application that registered to monitor the beacon.

[0188] Among them, for system platforms that do not implement system-level BLE beacon monitoring, the beacon registered by the application is sent to the system layer. When the system layer monitors the beacon, the application registered to monitor the beacon is pulled up.

[0189] For example, in some embodiments, Fig. 9 This is a schematic diagram of the implementation of registration and monitoring proposed in the embodiment of the present application, such as Fig. 9As shown, the application in the device, such as application 1, can register the beacon monitoring service with the BLE service of the system layer, that is, the system BLE service, wherein the relevant information of the registration may include the identifier UUID agreed upon by the devices at both ends, the Major value determined based on the ID of the local device, and the Minor value ID1 determined based on the ID of the peer device. The subsequent system BLE service can continue to perform beacon monitoring according to the registered information, that is, the system BLE service performs beacon monitoring based on the identifier UUID1, Major value, and Minor value. If the system BLE service scans the specific beacon, it can start the service through application management to start application 1.

[0190] Furthermore, in an embodiment of the present application, when setting the beacon information of a historically connected device, the setting method of the local device and the peer device can be the same. Among them, after the first connection, the local application records the device ID of the peer application, and registers the beacon of the agreed UUID for monitoring. The Major value is the ID of the local device, and the Minor value is the ID of the peer device. When the local device needs to initiate a connection or other processing to the historically connected device again, it sends the agreed beacon value. When the system layer of the peer device scans the beacon, it pulls up the application that registered the beacon. After the peer application is pulled up, subsequent connections or other processing can be performed.

[0191] For example, in some embodiments, Fig.10 A schematic diagram of the communication method proposed in the embodiment of the present application is shown in FIG. Fig.10 As shown, when device 1 and device 2 communicate, they can perform the following process:

[0192] 1. First connection.

[0193] The two-end devices complete the first connection. The first connection refers to the connection method agreed upon by the two-end applications, including but not limited to BT, BLE, Wi-Fi connection, etc. After the connection, the local end can obtain the device ID of the other end.

[0194] 2. Register beacon monitoring.

[0195] Register beacon monitoring with the system BLE service. UUID is a fixed UUID value agreed upon by both parties, such as UUID1, Major is the device ID of this end, and Minor is the device ID of the other end. If the device ID exceeds the 2-byte limit, the Hash algorithm can be used to process it into 2-byte data.

[0196] 3. Beacon monitoring.

[0197] After receiving the registration event from the application, the system BLE service starts to monitor the broadcast of the BLE beacon, and can monitor even after the application exits.

[0198] 4. Disconnect.

[0199] The devices at both ends are disconnected.

[0200] 5. Send beacon broadcast.

[0201] When the connection is disconnected, when the application of device 1 wants to initiate a connection to the other device, it sends a specific beacon, where the UUID is the fixed UUID value agreed upon by both parties, the Major value is the device ID of the other end, and the Minor value is the device ID of this end.

[0202] 6. Scan beacon broadcasts.

[0203] The system BLE service of device 2 scans the specific beacon.

[0204] 7. Launch the application.

[0205] The system BLE service of device 2 launches the application that registers the beacon.

[0206] 8. Connect again.

[0207] After both applications are running, they start connecting using the agreed upon connection method.

[0208] It can be seen that the communication method proposed in the embodiment of the present application realizes automatic triggering of historical device connection by redefining the format content of BLE beacon. The application can be automatically launched without the user manually launching the application, thereby realizing fast connection between historical devices.

[0209] It can be understood that the communication method proposed in the embodiment of the present application redefines the format of BLE beacon so that the non-directional broadcast message is designed as a directional broadcast, thereby achieving precise control of the connection of historical devices.

[0210] The embodiment of the present application proposes a communication method, where the two end devices that have established a connection can send a beacon connection broadcast carrying a first identifier, a primary device identifier, and a secondary device identifier to the opposite end device, so that the opposite end device reconnects based on the first identifier, the primary device identifier, and the secondary device identifier. It can be seen that in the present application, the two end devices can automatically achieve reconnection by setting and monitoring the beacon connection broadcast carrying the first identifier, the primary device identifier, and the secondary device identifier, thereby improving the connection efficiency and connection success rate between devices and improving communication performance.

[0211] Based on the above embodiment, in another embodiment of the present application, Fig.11 This is a schematic diagram of the composition structure of the first communication device proposed in the embodiment of the present application, such as Fig.11 As shown, the first communication device 110 proposed in this embodiment of the present application may include:

[0212] The receiving unit 1101 is configured to receive a beacon connection broadcast sent by a second device when performing beacon monitoring; wherein the beacon connection broadcast carries a first identifier, a primary device identifier, and a secondary device identifier, and the second device is a historically connected device that has established a connection with the first device;

[0213] The connecting unit 1102 is configured to re-establish a connection with the second device when the first identifier, the primary device identifier, and the secondary device identifier satisfy a reconnection condition.

[0214] In the embodiments of the present application, further, Fig.12 This is a schematic diagram of the structure of the second communication device proposed in the embodiment of the present application, such as Fig.12 As shown, the second communication device 120 proposed in the embodiment of the present application may include:

[0215] The determining unit 1201 is used to determine the first identifier, the primary device identifier and the secondary device identifier when determining to reconnect to the first device; wherein the first device is a historically connected device that has established a connection with the second device;

[0216] The sending unit 1202 is used to send a beacon connection broadcast to the first device to re-establish a connection with the first device; wherein the beacon connection broadcast carries the first identifier, the primary device identifier, and the secondary device identifier.

[0217] In the embodiments of the present application, further, Fig.13 This is a schematic diagram of the structure of the computer device proposed in the embodiment of the present application, such as Fig.13 As shown, the computer device 130 proposed in the embodiment of the present application may include a processor 1301 , a memory 1302 , a communication interface 1303 , and a bus 1304 for connecting the processor 1301 , the memory 1302 , and the communication interface 1303 .

[0218] In the embodiment of the present application, the above-mentioned processor 1301 can be at least one of an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a digital signal processor (Digital Signal Processor, DSP), a digital signal processing device (Digital Signal Processing Device, DSPD), a programmable logic device (ProgRAMmable Logic Device, PLD), a field programmable gate array (Field ProgRAMmable Gate Array, FPGA), a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, and a microprocessor. It can be understood that for different devices, the electronic device used to implement the above-mentioned processor function can also be other, and the embodiment of the present application is not specifically limited. The computer device 130 can also include a memory 1302, which can be connected to the processor 1301, wherein the memory 1302 is used to store executable program code, the program code includes computer operation instructions, and the memory 1302 may include a high-speed RAM memory, and may also include a non-volatile memory, for example, at least two disk memories.

[0219] In the embodiment of the present application, the bus 1304 is used to connect the communication interface 1303, the processor 1301 and the memory 1302, as well as the mutual communication between these devices.

[0220] In practical applications, the memory 1302 may be a volatile memory, such as a random access memory (RAM); or a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above types of memories, and provide instructions and data to the processor 1301.

[0221] Further, in an embodiment of the present application, the processor 1301 is used to receive a beacon connection broadcast sent by a second device while performing beacon monitoring; wherein the beacon connection broadcast carries a first identifier, a primary device identifier, and a secondary device identifier, and the second device is a historically connected device that has established a connection with the first device; and when the first identifier, the primary device identifier, and the secondary device identifier meet the reconnection conditions, re-establish a connection with the second device.

[0222] Further, in an embodiment of the present application, the processor 1301 is used to determine a first identifier, a primary device identifier, and a secondary device identifier when determining to reconnect to the first device; wherein the first device is a historically connected device that has established a connection with the second device; and send a beacon connection broadcast to the first device to reestablish a connection with the first device; wherein the beacon connection broadcast carries the first identifier, the primary device identifier, and the secondary device identifier.

[0223] In addition, each functional module in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software functional modules.

[0224] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method of this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0225] An embodiment of the present application provides a computer-readable storage medium on which a program is stored. When the program is executed by a processor, the communication method as described above is implemented.

[0226] Specifically, the program instructions corresponding to a communication method in this embodiment may be stored on a storage medium such as a CD, a hard disk, or a USB flash drive. When the program instructions corresponding to a communication method in the storage medium are read or executed by an electronic device, the following steps are included:

[0227] In the case of performing beacon monitoring, receiving a beacon connection broadcast sent by the second device; wherein the beacon connection broadcast carries the first identifier, the primary device identifier, and the secondary device identifier, and the second device is a historically connected device that has established a connection with the first device;

[0228] When the first identifier, the primary device identifier, and the secondary device identifier satisfy the reconnection condition, re-establishing the connection with the second device.

[0229] Specifically, the program instructions corresponding to a communication method in this embodiment may be stored on a storage medium such as a CD, a hard disk, or a USB flash drive. When the program instructions corresponding to a communication method in the storage medium are read or executed by an electronic device, the following steps are included:

[0230] In the case of determining to reconnect the first device, determining the first identifier, the primary device identifier, and the secondary device identifier; wherein the first device is a historically connected device that has established a connection with the second device;

[0231] A beacon connection broadcast is sent to the first device to re-establish a connection with the first device; wherein the beacon connection broadcast carries the first identifier, the primary device identifier, and the secondary device identifier.

[0232] The embodiment of the present application also provides a computer program product.

[0233] In some embodiments, the computer program product may include a computer program or instructions.

[0234] In some embodiments, the computer program product can be applied to the computer device in the embodiments of the present application, and the computer program instructions enable the computer to execute the corresponding processes implemented by the computer device in the various methods of the embodiments of the present application. For the sake of brevity, they will not be repeated here.

[0235] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0236] The present application is described with reference to implementation flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0237] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which is implemented in the implementation flow diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0238] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing the steps in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0239] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A communication method, characterized in that: Applied to a first device, the method includes: In the case of performing beacon monitoring, receiving a beacon connection broadcast sent by a second device; wherein the beacon connection broadcast carries a first identifier, a primary device identifier, and a secondary device identifier, and the second device is a historically connected device that has established a connection with the first device; When the first identifier, the primary device identifier, and the secondary device identifier satisfy a reconnection condition, reestablishing a connection with the second device.

2. The method according to claim 1, characterized in that Before receiving the beacon connection broadcast sent by the second device, the method further includes: In a case where the first application establishes an initial connection with the second application of the second device, determining an identifier of the second device and determining an identifier value between the first application and the second device; The first application registers beacon monitoring with a system service in the first device based on the identification value, the identification of the first device, and the identification of the second device; The system service in the first device performs beacon monitoring based on the identification value, the identification of the first device and the identification of the second device.

3. The method according to claim 2, characterized in that The method further comprises: In a case where the first identifier is the same as the identification value, the primary device identification is the same as the identification of the first device, and the secondary device identification is the same as the identification of the second device, determining that a reconnection condition is met; In the case that the first identifier is different from the identification value, or the primary device identification is different from the identification of the first device, or the secondary device identification is different from the identification of the second device, it is determined that the reconnection condition is not met.

4. The method according to claim 2 or 3, characterized in that: The re-establishing connection with the second device includes: Run the first application to re-establish connection with the second device.

5. The method according to any one of claims 1 to 3, characterized in that: The master device identifier is an identifier of a device that receives the beacon connection broadcast; wherein the device that receives the beacon connection broadcast is a historically connected device that has established a connection with the second device; The secondary device identifier is the identifier of the second device that sends the beacon connection broadcast.

6. A communication method, characterized in that: Applied to the second device, the method includes: In the case of determining to reconnect the first device, determining a first identifier, a primary device identifier, and a secondary device identifier; wherein the first device is a historically connected device that has established a connection with the second device; Send a beacon connection broadcast to the first device to re-establish a connection with the first device; wherein the beacon connection broadcast carries the first identifier, the primary device identifier, and the secondary device identifier.

7. The method according to claim 6, characterized in that The method further comprises: In a case where the first connection is established between the second application and the first application in the first device, determining an identifier of the first device and an identifier value between the second application and the first device; The second application registers beacon monitoring with a system service in the second device based on the identification value, the identification of the first device and the identification of the second device; The system service in the second device performs beacon monitoring based on the identification value, the identification of the first device and the identification of the second device.

8. The method according to claim 7, characterized in that The determining of the first identifier, the primary device identifier, and the secondary device identifier includes: determining a first identifier based on the identification value; Determine the master device identifier based on the identifier of the first device; The secondary device identification is determined based on the identification of the second device.

9. The method according to any one of claims 6 to 8, characterized in that: The master device identifier is an identifier of a device that receives the beacon connection broadcast; wherein the device that receives the beacon connection broadcast is a historically connected device that has established a connection with the second device; The secondary device identifier is the identifier of the second device that sends the beacon connection broadcast.

10. A first communication device, characterized in that: The first communication device comprises: A receiving unit, configured to receive a beacon connection broadcast sent by a second device when performing beacon monitoring; wherein the beacon connection broadcast carries a first identifier, a primary device identifier, and a secondary device identifier, and the second device is a historically connected device that has established a connection with the first device; A connection unit is used to re-establish a connection with the second device when the first identifier, the primary device identifier and the secondary device identifier meet a reconnection condition.

11. A second communication device, characterized in that: The second communication device comprises: A determination unit, configured to determine a first identifier, a primary device identifier, and a secondary device identifier when determining to reconnect to a first device; wherein the first device is a historically connected device that has established a connection with the second device; A sending unit is used to send a beacon connection broadcast to the first device to re-establish a connection with the first device; wherein the beacon connection broadcast carries the first identifier, the primary device identifier, and the secondary device identifier.

12. A computer device, characterized in that: The computer device is applied to the first device or the second device, and the computer device includes a processor and a memory storing instructions executable by the processor. When the instructions are executed by the processor, the method described in any one of claims 1-5 or 6-9 is implemented.

13. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the method described in any one of claims 1 to 5 or 6 to 9 is implemented.