Multi-device scene BLE fast networking online method and electronic device
By alternating between sending connectable and non-connectable non-directional broadcasts and waiting for a specified time, the problem of SCAN_RSP packet loss in multi-device Bluetooth networking is solved, improving the success rate of Bluetooth networking and device online performance.
Patent Information
- Application Number
- CN202411050871.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2026-02-03
AI Technical Summary
In multi-device Bluetooth networking scenarios, especially when there are a large number of devices, SCAN_RSP packets are prone to loss, resulting in a low success rate of broadcast packet transmission and reception, which affects the networking success rate.
Electronic devices alternately send connectable and non-connectable non-directional broadcasts, and wait for a random amount of time between broadcasts to alleviate air interface congestion and improve broadcast transmission and reception success rate.
By alternating between sending different types of broadcasts and waiting for a certain duration, the success rate of Bluetooth networking is significantly improved, especially in multi-device scenarios, effectively mitigating packet loss issues and enhancing overall networking performance.
Smart Images

Figure CN121462984A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic equipment technology, and in particular to a method for rapid BLE networking in multi-device scenarios and an electronic device. Background Technology
[0002] A necessary process in current multi-device Bluetooth networking schemes is that when an electronic device initiates Bluetooth networking, it must send a connectable undirected advertising event (ADVIND) packet of a specific duration. Other electronic devices, upon receiving this ADVIND packet, can send a scanning request (SCAN_REQ) packet of a specific duration. The electronic device initiating the Bluetooth networking, upon receiving the SCAN_REQ packets from other electronic devices, can reply with a scanning response (SCAN_RSP) packet. The information contained in the ADVIND, SCAN_REQ, and SCAN_RSP packets can be used for Bluetooth networking.
[0003] In the above method, when there are a large number of electronic devices participating in Bluetooth networking, SCAN_RSP packet loss is likely to occur, which will affect the success rate of broadcast packet transmission and reception in multi-device networking scenarios, resulting in a low success rate of multi-device Bluetooth networking. Summary of the Invention
[0004] This application provides a method and electronic device for rapid BLE networking in multi-device scenarios to improve the efficiency of multi-device Bluetooth networking.
[0005] In a first aspect, embodiments of this application provide a method for rapid BLE networking in a multi-device scenario, applied to a first electronic device. The method includes: sending a first broadcast; wherein the first broadcast includes either a connectable non-directional broadcast or a non-connectable non-directional broadcast, the non-connectable non-directional broadcast including information for indicating whether to connect to the network without connection; sending a second broadcast; wherein the second broadcast includes either the connectable non-directional broadcast or the non-connectable non-directional broadcast that is different from the first broadcast.
[0006] In this method, connectable non-directional broadcasts can be used for Bluetooth networking. Non-connectable non-directional broadcasts contain information indicating whether to connect without a connection and can also be used for Bluetooth networking. Based on this method, the first electronic device can alternately send connectable and non-connectable non-directional broadcasts, thus eliminating the need for the first electronic device to rely entirely on connectable non-directional broadcasts to achieve Bluetooth networking. Compared to existing methods that rely solely on connectable non-directional broadcasts for Bluetooth networking, the method provided in this application, where the first electronic device sends non-connectable non-directional broadcasts, effectively improves the success rate of Bluetooth networking. Alternating between connectable and non-connectable non-directional broadcasts helps alleviate the problem of low broadcast transmission and reception success rates caused by high packet loss rates when sending connectable non-directional broadcasts, thereby improving the overall broadcast transmission and reception success rate and ultimately increasing the success rate of Bluetooth networking. Especially in multi-device Bluetooth networking scenarios (air interface congestion scenarios, such as scenarios where there are many networkable devices around the first electronic device), the method provided in this application can effectively improve the success rate of Bluetooth networking.
[0007] In one possible design, after sending the first broadcast and before sending the second broadcast, the method further includes: waiting for a first duration.
[0008] In this method, by waiting for a certain period of time between sending different broadcasts, the first electronic device can avoid receiving a large number of response messages in a short period of time, or minimize the number of response messages received by the first electronic device in a short period of time. This allows the first electronic device to reserve a certain amount of time to process the received response messages, which helps to alleviate air interface congestion on the first electronic device side, thereby improving the success rate of broadcast transmission and reception, and further improving the success rate of Bluetooth networking.
[0009] In one possible design, the first duration is a duration randomly selected within a set first duration range.
[0010] Based on this method, the waiting time between sending different broadcasts by the first electronic device can be random, which can improve the flexibility of the first electronic device in sending broadcasts. For example, time can be flexibly reserved for the first electronic device to process broadcast messages from other electronic devices.
[0011] In one possible design, after sending the second broadcast, the method further includes sending a third broadcast; wherein the third broadcast includes one of the connectable non-directional broadcast and the non-connectable non-directional broadcast that is different from the second broadcast.
[0012] Based on the above method, the first electronic device can repeatedly and alternately send connectable non-directional broadcasts and non-connectable non-directional broadcasts, which helps to further improve the success rate of broadcast transmission and reception.
[0013] In one possible design, after sending the second broadcast and before sending the third broadcast, the method further includes: waiting for a second duration.
[0014] In this method, the first electronic device waits for a certain period of time between sending different broadcasts, which allows the first electronic device to process broadcast messages from other electronic devices. This helps to alleviate air interface congestion on the first electronic device side, thereby improving the success rate of broadcast transmission and reception, and further improving the success rate of Bluetooth networking.
[0015] In one possible design, the second duration is a duration randomly selected within a set second duration range.
[0016] Based on this method, the waiting time between sending different broadcasts by the first electronic device can be random, which can improve the flexibility of the first electronic device in sending broadcasts.
[0017] In one possible design, sending the first broadcast includes sending the first broadcast for a third duration; sending the second broadcast includes sending the second broadcast for a fourth duration. Optionally, the third duration is the same as the fourth duration, or the third duration is different from the fourth duration.
[0018] In this method, the first electronic device can send broadcasts for different types of broadcasts according to their respective durations, offering high flexibility and practicality.
[0019] In one possible design, sending the first broadcast for a third duration includes: sending the first broadcast once every fifth duration until the total duration reaches the third duration; sending the second broadcast for a fourth duration includes: sending the second broadcast once every sixth duration until the total duration reaches the fourth duration. Optionally, the fifth duration and the sixth duration are the same, or the fifth duration and the sixth duration are different.
[0020] In this method, the first electronic device can send broadcasts according to the corresponding interval duration for different types of broadcast transmission processes, which is highly flexible and practical.
[0021] In one possible design, after sending the first broadcast, or after sending the second broadcast, the method further includes: receiving a first message; wherein the first message includes one of a scan request from the second device and a non-connectivity non-directional broadcast from the second device; wherein the non-connectivity non-directional broadcast from the second device includes information indicating whether a connectionless networking is online.
[0022] In this method, the first electronic device can establish a Bluetooth network connection with the second electronic device by receiving a first message from the second electronic device. A scan request or a non-directional broadcast from the second electronic device can serve as a response message to the first or second broadcast, further improving the success rate of broadcast transmission and reception, and thus increasing the success rate of Bluetooth network establishment.
[0023] Secondly, embodiments of this application provide a method for rapid BLE networking in a multi-device scenario, applied to a second electronic device. The method includes: sending a first message in response to a received first broadcast; wherein the first message is one of a scan request and a non-connectable non-directional broadcast; sending a second message in response to a received second broadcast; wherein the second message is one of the scan request and the non-connectable non-directional broadcast that is different from the first message; wherein the first broadcast and the second broadcast respectively include one of a connectable non-directional broadcast from the first electronic device and a non-connectable non-directional broadcast from the first electronic device; any non-connectable non-directional broadcast includes information indicating whether to connect without a connection.
[0024] In this method, the scan request sent by the second electronic device can be used to achieve Bluetooth network connection based on connectable non-directional broadcasts. The non-connectable non-directional broadcast sent by the second electronic device contains information indicating whether connectionless network connection is required, and can also be used to achieve Bluetooth network connection based on non-connectable non-directional broadcasts. Based on the above method, the second electronic device can alternately send scan requests and non-connectable non-directional broadcasts, so the second electronic device does not need to rely entirely on the scan request corresponding to the connectable non-directional broadcast to achieve Bluetooth network connection. Compared with the existing methods that only rely on the scan request corresponding to the connectable non-directional broadcast to achieve Bluetooth network connection, the method provided in this application embodiment can effectively improve the success rate of Bluetooth network connection by sending non-connectable non-directional broadcasts. By alternately sending scan requests and non-connectable non-directional broadcasts, the second electronic device helps to alleviate the problem of low broadcast transmission and reception success rate caused by high packet loss rate of the peer device (i.e., the receiving end of the scan request) in the scenario of sending scan requests, thus improving the overall broadcast transmission and reception success rate, and thereby improving the success rate of Bluetooth network connection. Especially in multi-device Bluetooth networking scenarios (air interface congestion scenarios, such as scenarios where there are many networkable devices around the second electronic device), the method provided in the embodiments of this application can effectively improve the success rate of Bluetooth networking.
[0025] In one possible design, before sending a first message in response to a received first broadcast, the method further includes: waiting for a first duration when the first broadcast is received.
[0026] In this method, the second electronic device waits for a certain period of time after receiving a broadcast from the first electronic device, allowing the first electronic device time to process the message. This helps alleviate air interface congestion on the first electronic device's side, thereby improving the success rate of the first electronic device sending a response message to the first message and the success rate of the second device receiving the response message. Therefore, this method can improve the overall success rate of broadcast transmission and reception, and further improve the success rate of Bluetooth networking.
[0027] In one possible design, the first duration is a duration randomly selected within a set first duration range.
[0028] Based on this method, the waiting time for the second electronic device after receiving a broadcast from the first electronic device and before sending a corresponding response message can be random. This minimizes the possibility of the second electronic device and other devices receiving the broadcast from the first electronic device simultaneously sending response messages, thereby reducing the likelihood of the first electronic device receiving a large number of response messages at the same time. This method ensures that the first electronic device has sufficient processing time for each received response message, thus improving the success rate of broadcast transmission and reception on the first electronic device side, and further improving the overall success rate of broadcast transmission and reception.
[0029] In one possible design, before sending a second message in response to a received second broadcast, the method further includes: waiting for a second duration upon receiving the second broadcast. Optionally, the first duration is the same as the second duration, or the first duration is different from the second duration.
[0030] In this method, the second electronic device waits for a certain period of time after receiving a broadcast from the first electronic device, allowing the first electronic device time to process the message. This helps alleviate air interface congestion on the first electronic device's side, thereby improving the success rate of the first electronic device sending a response message to the first message and the success rate of the second device receiving the response message. Therefore, this method can improve the overall success rate of broadcast transmission and reception, and further improve the success rate of Bluetooth networking.
[0031] In one possible design, the second duration is a duration randomly selected within a set second duration range. Optionally, the first duration range is the same as the second duration range, or the first duration range is different from the second duration range.
[0032] Based on this method, the waiting time for the second electronic device after receiving a broadcast from the first electronic device and before sending a corresponding response message can be random. This minimizes the possibility of the second electronic device and other devices receiving the broadcast from the first electronic device simultaneously sending response messages, thereby reducing the likelihood of the first electronic device receiving a large number of response messages at the same time. This method ensures that the first electronic device has sufficient processing time for each received response message, thus improving the success rate of broadcast transmission and reception on the first electronic device side, and further improving the overall success rate of broadcast transmission and reception.
[0033] In one possible design, after sending a second message in response to a received second broadcast, the method further includes: sending a third message in response to a received third broadcast; wherein the third broadcast includes one of a connectable non-directional broadcast from the first electronic device and a non-connectable non-directional broadcast from the first electronic device; the third message is one of a scan request and a non-connectable non-directional broadcast that differs from the second message; and any non-connectable non-directional broadcast includes information indicating whether a connectionless networking is online.
[0034] Based on the above method, the second electronic device can send scan requests and unconnectable non-directional broadcasts alternately multiple times, which helps to further improve the success rate of broadcast transmission and reception.
[0035] In one possible design, before sending a third message in response to a received third broadcast, the method further includes: waiting for a third duration when the third broadcast is received.
[0036] In one possible design, the third duration is a duration randomly selected within a set third duration range. Optionally, the third duration is the same as the first duration or the second duration, or the third duration is different from both the first duration and the second duration.
[0037] In one possible design, sending the first message includes sending a first message of a fourth duration; sending the second message includes sending a second message of a fifth duration. Optionally, the fourth duration is the same as the fifth duration, or the fourth duration is different from the fifth duration.
[0038] In this method, the second electronic device can send messages according to the corresponding duration for different types of messages, which is highly flexible and practical.
[0039] In one possible design, sending the first message of the fourth duration includes: sending the first message once every sixth duration until the total duration reaches the fourth duration; sending the second message of the fifth duration includes: sending the second message once every seventh duration until the total duration reaches the fifth duration. Optionally, the sixth duration and the seventh duration are the same, or the sixth duration and the seventh duration are different.
[0040] In this method, the second electronic device can send messages according to the corresponding intervals for different types of messages, which is highly flexible and practical.
[0041] Thirdly, this application provides a Bluetooth networking system, which includes at least the first electronic device described in the first aspect and the second electronic device described in the second aspect. In one possible design, the system may further include at least one other electronic device, wherein each of the at least one other electronic device may refer to the second electronic device described in the second aspect.
[0042] Fourthly, this application provides an electronic device, the electronic device including a memory and one or more processors; wherein the memory is used to store computer program code, the computer program code including computer instructions; when the computer instructions are executed by the one or more processors, the electronic device causes the electronic device to perform the method described in the first aspect or any possible design of the first aspect, or to perform the method described in the second aspect or any possible design of the second aspect.
[0043] Fifthly, this application provides a computer-readable storage medium storing a computer program that, when run on an electronic device, causes the electronic device to perform the method described in the first aspect or any possible design of the first aspect, or to perform the method described in the second aspect or any possible design of the second aspect.
[0044] Sixthly, this application provides a computer program product comprising a computer program or instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect or any possible design of the first aspect, or to perform the method described in the second aspect or any possible design of the second aspect.
[0045] Seventhly, this application provides a chip system including a processor and a memory, wherein the memory stores instructions; when the instructions are executed by the processor, they implement the methods described in the first aspect or any possible design of the first aspect, or implement the methods described in the second aspect or any possible design of the second aspect. The chip system may be composed of chips or may include chips and other discrete devices.
[0046] The beneficial effects of the third to seventh aspects mentioned above can be found in the beneficial effects of the first or second aspects mentioned above, and will not be repeated here. Attached Figure Description
[0047] Figure 1 This is a schematic diagram of a Bluetooth networking method based on ADV_IND;
[0048] Figure 2This is a schematic diagram of a Bluetooth networking method based on ADV_IND;
[0049] Figure 3 A schematic diagram of the hardware architecture of an electronic device provided in an embodiment of this application;
[0050] Figure 4 A schematic diagram of the software architecture of an electronic device provided in an embodiment of this application;
[0051] Figure 5 A schematic diagram of an ADV_IND data structure provided in an embodiment of this application;
[0052] Figure 6 A schematic diagram of an ADV_NONCONN_IND data structure provided in an embodiment of this application;
[0053] Figure 7 A schematic diagram illustrating an ADV_IND transmission and reception process provided in an embodiment of this application;
[0054] Figure 8 A schematic diagram illustrating the ADV_NONCONN_IND transmission and reception process provided in an embodiment of this application;
[0055] Figure 9 A schematic diagram illustrating a Bluetooth networking method provided in an embodiment of this application;
[0056] Figure 10 A schematic diagram illustrating a Bluetooth networking method provided in an embodiment of this application;
[0057] Figure 11 A schematic diagram illustrating a Bluetooth networking method provided in an embodiment of this application;
[0058] Figure 12 A schematic diagram illustrating a Bluetooth networking method provided in an embodiment of this application;
[0059] Figure 13 A schematic diagram illustrating a Bluetooth networking method provided in an embodiment of this application;
[0060] Figure 14 A schematic diagram illustrating a Bluetooth networking method provided in an embodiment of this application;
[0061] Figure 15 A schematic diagram illustrating a Bluetooth networking method provided in an embodiment of this application;
[0062] Figure 16 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0063] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0064] In the description of the embodiments of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first" and "second" may explicitly or implicitly include one or more of that feature.
[0065] It should be understood that in the embodiments of this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, or a, b, and c, where a, b, and c can be single or multiple.
[0066] Bluetooth networking is a wireless networking method based on Bluetooth Low Energy (BLE) technology. Bluetooth networking allows the creation of a self-organizing network that can accommodate a large number of nodes, enabling many-to-many connections and communication between different devices. Currently, there are two main scenarios for multi-device Bluetooth networking. One is in the initial networking scenario, where different devices can establish a link and go online based on BLE broadcast. Establishing a link means setting up a wireless communication link, which can also be understood as establishing a connection. The other is in subsequent networking scenarios, where different devices can go online based on BLE broadcast.
[0067] The relevant Bluetooth standards define four types of broadcasts: connectable undirected advertisying event (ADV_DIRECT_IND), non-connectable undirected advertisying event (ADV_NONCONN_IND), and scannable undirected advertisying event (ADV_SCAN_IND). ADV_IND is the most widely used and common type of broadcast. ADV_IND includes a broadcast data packet (ADV_IND packet) and a scan response data packet (SCAN_REQ packet). ADV_IND can indicate that the current device is open to connection requests from any device. A device broadcasting ADV_IND can be scanned by other devices or can establish a connection upon receiving a connection request. ADV_IND can be sent even without a connection being established. ADV_IND, consisting of the ADV_IND packet and the SCAN_REQ packet, can be understood as a combination of the ADV_IND and SCAN_REQ packets. ADV_IND can also be called non-directional connectable broadcast, ADV_DIRECT_IND can also be called directional connectable broadcast, ADV_NONCONN_IND can also be called non-directional non-connectable broadcast, and ADV_SCAN_IND can also be called non-directional scanable broadcast or non-directional scan broadcast.
[0068] Current multi-device Bluetooth networking solutions require the presence of ADV_IND to simultaneously support BLE broadcast link establishment and BLE broadcast online in both scenarios. Figure 1 This is a schematic diagram of the current Bluetooth networking method based on ADV_IND. (Example) Figure 1As shown in diagram (a) in the current Bluetooth networking scheme, device A, acting as the network initiator, can send a network heartbeat broadcast, namely ADV_IND, for a specified duration (e.g., 10 seconds). Within these 10 seconds, device A can send ADV_IND at specified time intervals. For example, within 10 seconds, device A can send ADV_IND every 50ms. Each ADV_IND transmission by device A includes sending an ADVIND packet and, in response to a received SCAN_REQ packet, sending a SCAN_RSP packet. The ADVIND packet is used to negotiate Bluetooth network online information, and the SCAN_RSP packet carries information indicating whether connectionless network online is permitted. The device receiving the SCAN_RSP packet can determine whether to proceed with connectionless network online based on this information. Figure 1 As shown in diagram (b), after receiving the ADV_IND from device A, device B, located near device A, can broadcast a response packet for a specified duration (e.g., 2 seconds). Within these 2 seconds, device B can send response packets at specified time intervals. For example, within 2 seconds, device B can send a response packet every 50ms. The response packet sent by device B is a SCAN_REQ packet.
[0069] For ease of description, in the following embodiments of this application, the ADVIND packet will be abbreviated as ADVIND, the SCAN_RSP packet as SCAN_RSP, and the SCAN_REQ packet as SCAN_REQ.
[0070] Reference Figure 2 ,exist Figure 1 In the scenario shown, within 10 seconds, device A first sends an ADVIND packet each time it sends an ADVIND packet. If device B receives this ADVIND packet, device B can send a SCAN_REQ packet. After receiving the SCAN_REQ packet, device A can send a SCAN_RSP packet. Based on this method, when there are many devices around device A, each device around device A sends a SCAN_REQ packet after receiving device A's ADVIND packet. Therefore, device A needs to receive a large number of SCAN_REQ packets and send corresponding SCAN_RSP packets in a very short time. This process easily leads to SCAN_RSP packet loss, reducing the success rate of broadcast transmission and reception. Therefore, when the number of networked devices is large, there is a problem of low success rate in device broadcast transmission and reception, which affects device online performance and results in a low network success rate. For example, in practical application scenarios such as homes and the Internet of Things, practical experience with multi-device Bluetooth networking shows that when the number of networked devices is greater than 4, the device online performance becomes poor, and when the number of networked devices is greater than 8, it is almost impossible for multiple devices to go online simultaneously.
[0071] To address the above issues and improve the success rate of Bluetooth networking, this application provides a method for rapid BLE networking in multi-device scenarios and an electronic device. In this solution, in a multi-device Bluetooth networking scenario, the electronic device can improve the broadcast transmission and reception success rate by alternately sending ADV_IND and ADV_NONCONN_IND. By improving the broadcast transmission and reception success rate, the performance of device networking during Bluetooth networking can be improved, thereby increasing the overall success rate of Bluetooth networking.
[0072] The technical solutions provided in this application can be executed by any electronic device with BLE communication capabilities.
[0073] In some embodiments of this application, the electronic device can be a portable device, such as a mobile phone, tablet computer, wearable device with wireless communication capabilities (e.g., watch, bracelet, etc.), in-vehicle terminal device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), smart home device (e.g., smart TV, smart speaker, etc.), smart robot, workshop equipment, wireless terminal in self-driving, wireless terminal in remote medical surgery, wireless terminal in smart grid, wireless terminal in transportation safety, wireless terminal in smart city, or wireless terminal in smart home, flying equipment (e.g., smart robot, drone, airplane), etc. Wearable devices are portable devices that users can wear directly on their body or integrate into their clothing or accessories.
[0074] In some embodiments of this application, the electronic device may also be a portable terminal device that includes other functions. Exemplary embodiments of the portable terminal device include, but are not limited to, those described above. Alternatively, it could be a portable terminal device with another operating system. The aforementioned portable terminal device could also be other portable terminal devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of this application, the aforementioned electronic device may not be a portable terminal device, but rather a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0075] See below. Figure 3 The structure of the electronic device to which the method provided in the embodiments of this application is applicable will be described.
[0076] like Figure 3 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a USB interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a SIM card interface 195, etc.
[0077] The sensor module 180 may include a gyroscope sensor, an accelerometer, a proximity sensor, a fingerprint sensor, a touch sensor, a temperature sensor, a pressure sensor, a distance sensor, a magnetic sensor, an ambient light sensor, a barometric pressure sensor, a bone conduction sensor, etc.
[0078] Understandable, Figure 3 The electronic device 100 shown is merely an example and does not constitute a limitation on the electronic device. The electronic device may have more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. Figure 3 The various components shown can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0079] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, memory, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). Different processing units may be independent devices or integrated into one or more processors. The controller may serve as the central nervous system and command center of the electronic device 100. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0080] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0081] The execution of the multi-device scenario BLE rapid networking method provided in this application embodiment can be controlled by the processor 110 or called by other components. For example, it can call the processing program of this application embodiment stored in the internal memory 121, or call the processing program of this application embodiment stored in a third-party device through the external memory interface 120 to control the wireless communication module 160 to perform data communication with other devices, thereby improving the intelligence and convenience of the electronic device 100 and enhancing the user experience. The processor 110 may include different devices. For example, when integrating a CPU and a GPU, the CPU and GPU can cooperate to execute the multi-device scenario BLE rapid networking method provided in this application embodiment. For example, in the multi-device scenario BLE rapid networking method, some algorithms are executed by the CPU and others are executed by the GPU to achieve faster processing efficiency.
[0082] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled LED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays screens 194, where N is a positive integer greater than 1. Display screen 194 can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces (GUIs). For example, display screen 194 can display photos, videos, web pages, or documents, etc.
[0083] In this embodiment of the application, the display screen 194 can be a single flexible display screen, or it can be a splicing display screen composed of two rigid screens and a flexible screen located between the two rigid screens.
[0084] Camera 193 (a front-facing camera or a rear-facing camera, or a single camera that can function as both) is used to capture still images or videos. Typically, camera 193 may include a photosensitive element such as a lens assembly and an image sensor. The lens assembly includes multiple lenses (convex or concave lenses) for collecting light signals reflected from the object being photographed and transmitting these signals to the image sensor. The image sensor generates a raw image of the object being photographed based on the light signals.
[0085] The internal memory 121 can be used to store computer executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The program storage area can store the operating system, application program code (such as the functions corresponding to the scheme in this application), etc. The data storage area can store data created during the use of the electronic device 100.
[0086] The internal memory 121 may also store one or more computer programs corresponding to the algorithm of this application. The one or more computer programs are stored in the internal memory 121 and configured to be executed by one or more processors 110. The one or more computer programs include instructions that can be used to perform the various steps in the following embodiments.
[0087] In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0088] Of course, the algorithm code of the embodiment of this application can also be stored in external memory. In this case, the processor 110 can run the algorithm code of the embodiment of this application stored in external memory through the external memory interface 120.
[0089] A touch sensor, also known as a "touch panel," can be located on the display screen 194. The touch sensor and display screen 194 together form a touch display screen, also called a "touch screen." The touch sensor detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor may also be located on the surface of the electronic device 100, in a different position than the display screen 194.
[0090] For example, the display screen 194 of the electronic device 100 can display a main interface, which includes icons for multiple applications (such as a camera application, a fitness and health application, etc.). For instance, a user can tap the camera application icon on the main interface using a touch sensor, triggering the processor 110 to launch the camera application and open the camera 193. The display screen 194 then displays the camera application's interface, such as the viewfinder.
[0091] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0092] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with tuning switches.
[0093] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device. In this embodiment, the mobile communication module 150 can also be used for information interaction with other devices.
[0094] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0095] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (WiFi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2. In this embodiment, the wireless communication module 160 can be used to establish connections with other electronic devices for data interaction. Alternatively, the wireless communication module 160 can be used to access access point devices, send control commands to other electronic devices, or receive data from other electronic devices.
[0096] In addition, the electronic device 100 can implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, and an application processor, such as music playback and recording. The electronic device 100 can receive input from buttons 190, generating key signal inputs related to user settings and function control. The electronic device 100 can use a motor 191 to generate vibration alerts (such as vibration alerts for incoming calls). The indicator 192 in the electronic device 100 can be an indicator light, used to indicate charging status, battery level changes, messages, missed calls, notifications, etc. The SIM card interface 195 in the electronic device 100 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the electronic device 100.
[0097] It should be understood that, in practical applications, electronic device 100 may include more than Figure 3 The number of more or fewer components shown is not limited in the embodiments of this application. The illustrated electronic device 100 is merely an example, and the electronic device 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have different component configurations. The various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0098] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. A layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. For example, ... Figure 4 As shown, the software architecture can be divided into four layers, from top to bottom: the application layer, the application framework layer (framework, FWK), the runtime and system libraries, and the (Linux) kernel layer.
[0099] The application layer is the top layer of the operating system and includes native operating system applications such as camera, gallery, calendar, Bluetooth, music, video, and messaging applications, as well as third-party applications. The applications discussed in this application embodiment are referred to as applications (APPs), which are software programs capable of performing one or more specific functions. Typically, multiple applications can be installed on an electronic device, such as camera applications and email applications. The applications mentioned below can be system applications pre-installed on the electronic device at the factory, or third-party applications downloaded by the user from the network or obtained from other electronic devices during the use of the electronic device.
[0100] Of course, for developers, they can write applications and install them into this layer. In one possible implementation, the application can be developed using the Java language, by calling the application programming interface (API) provided by the application framework layer. Developers can then interact with the underlying operating system (such as the kernel layer) through the application framework to develop their own applications.
[0101] The application framework layer provides the API and programming framework for the application layer. It can include predefined functions. The application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0102] The window manager is used to manage window programs. The window manager can obtain the screen size, determine if a status bar is present, lock the screen (or display), and capture the screen, among other things.
[0103] Content providers are used to store and retrieve data, and make that data accessible to applications. This data may include files (e.g., documents, videos, images, audio), text, and other information.
[0104] A view system includes visual controls, such as controls that display text, images, documents, and other content. View systems can be used to build applications. An interface in a display window can consist of one or more views. For example, a display interface including a text message notification icon could include a view that displays text and a view that displays images.
[0105] The phone manager provides communication functionality for electronic devices. The notification manager allows applications to display notification information in the status bar; it can be used to convey informative messages and can disappear automatically after a short pause without user interaction.
[0106] The runtime includes the core libraries and the virtual machine. The runtime is responsible for system scheduling and management.
[0107] The system's core library consists of two parts: one part contains the functionalities that the Java language needs to call, and the other part is the system's core library. The application layer and application framework layer run in a virtual machine. Taking Java as an example, the virtual machine executes the Java files in the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0108] The system library can include multiple functional modules. Examples include: a surface manager, a media library, a 3D graphics processing library (e.g., OpenGL ES), a 2D graphics engine (e.g., SGL), and an image processing library. The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.564, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing library implements 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.
[0109] The kernel layer provides core system services for the operating system, such as security, memory management, process management, network protocol stack, and driver models, all of which are implemented based on the kernel layer. The kernel layer also serves as an abstraction layer between the hardware and software stacks. This layer contains many drivers related to electronic devices, including: display drivers; keyboard drivers as input devices; Flash drivers for memory-based devices; camera drivers; audio drivers; Bluetooth drivers; and WiFi drivers.
[0110] It is important to understand that the functional services described above are just an example. In practical applications, electronic devices may be divided into more or fewer functional services based on other factors, or the functions of each service may be divided in other ways, or they may not be divided into functional services but work as a whole.
[0111] The solution provided in this application can be applied to a communication system composed of multiple electronic devices. The electronic devices in this communication system can employ the aforementioned... Figure 3 and / or Figure 4 The architecture shown may be used, or other architectures may be adopted; no specific limitations are imposed on the embodiments of this application. Each electronic device in this communication system can communicate with other electronic devices based on the scheme provided in the embodiments of this application, thereby realizing Bluetooth networking.
[0112] Optionally, electronic devices in the communication system may or may not be connected to a network (e.g., a mobile network or a wireless local area network). Different electronic devices may connect to the same network (e.g., a wireless local area network under the same access point AP) or to different networks; no specific restrictions are imposed in this embodiment.
[0113] For ease of explanation, in the following embodiments, the device that initiates Bluetooth networking in the communication system is referred to as the first electronic device, and the device that can form a Bluetooth network with the first electronic device in the communication system is referred to as the second electronic device.
[0114] In the solution provided in this application embodiment, when the first electronic device initiates Bluetooth networking, it can alternately send ADV_IND and ADV_NONCONN_IND in stages, and the second electronic device can respond based on the broadcast packets received from the first electronic device. This method can improve the success rate of broadcast transmission and reception, thereby improving Bluetooth networking efficiency. Specifically, for the first electronic device, the stage where it sends ADV_IND can be called the ADV_IND transmission stage, and the stage where it sends ADV_NONCONN_IND can be called the ADV_NONCONN_IND transmission stage. For the second electronic device, the stage where it responds to the ADV_IND sent by the first electronic device can be called the ADV_IND response stage, and the stage where it responds to the ADV_NONCONN_IND sent by the first electronic device can be called the ADV_NONCONN_IND response stage.
[0115] The following sections, in conjunction with Parts 1 through 4, provide a detailed introduction to the multi-device scenario BLE rapid networking and deployment methods corresponding to the ADV_IND sending phase, ADV_NONCONN_IND sending phase, ADV_IND response phase, and ADV_NONCONN_IND response phase.
[0116] Part 1: ADV_IND Sending Phase
[0117] In the embodiments of this application, such as Figure 5 As shown, ADV_IND includes two broadcast packets: ADVIND and SCAN_RSP. ADVIND includes a negotiation field, which is used to negotiate information related to Bluetooth networking. SCAN_RSP is used for data synchronization before going online. SCAN_RSP includes a status field, which indicates whether connectionless networking is allowed. Devices receiving SCAN_RSP can determine the networking method based on the status field.
[0118] In this embodiment of the application, ADV_IND can be abbreviated as AB packet, ADV_IND included in ADV_IND can be abbreviated as connectable A packet, and SCAN_RSP included in ADV_IND can be abbreviated as B packet.
[0119] In this embodiment, on the first electronic device side, each ADV_IND transmission phase can have a corresponding transmission duration (or duration). Optionally, different ADV_IND transmission phases can correspond to the same or different transmission durations; this embodiment does not impose specific limitations. During each ADV_IND transmission phase, the first electronic device can repeatedly transmit ADV_IND within the corresponding transmission duration of that ADV_IND transmission phase, i.e., the first electronic device can repeatedly transmit ADV_IND until the total duration reaches the transmission duration corresponding to that ADV_IND transmission phase. The value of the transmission duration corresponding to each ADV_IND transmission phase can be preset; this embodiment does not impose limitations on the value of the transmission duration corresponding to each ADV_IND transmission phase. Under normal circumstances, each ADV_IND transmission operation by the first electronic device may include: transmitting ADVIND, and, in response to the received SCAN_REQ, transmitting SCAN_RSP. Under abnormal circumstances (e.g., packet loss scenarios), the ADV_IND transmission operation by the first electronic device may include both of the above-mentioned normal operations, or it may only include transmitting ADVIND.
[0120] In some embodiments of this application, on the first electronic device side, each ADV_IND transmission phase may have a corresponding interval duration. Optionally, different ADV_IND transmission phases may correspond to the same or different interval durations, and this application embodiment does not impose specific limitations. The first electronic device may transmit ADV_IND within the transmission duration corresponding to each ADV_IND transmission phase, according to the interval duration corresponding to that ADV_IND transmission phase. That is, the first electronic device may transmit ADV_IND once every interval duration corresponding to that ADV_IND transmission phase until the total duration reaches the transmission duration corresponding to that ADV_IND transmission phase. The value of the interval duration corresponding to each ADV_IND transmission phase may be preset, and this application embodiment does not impose limitations on the value of the interval duration corresponding to each ADV_IND transmission phase.
[0121] For example, in a scenario where the transmission duration of any ADV_IND transmission phase is 2 seconds and the interval is 50 ms, the first electronic device can send ADV_IND once every 50 ms until the total duration reaches 2 seconds.
[0122] Part Two: ADV_NONCONN_IND Transmission Phase
[0123] In this embodiment of the application, ADV_NONCONN_IND can be used as a deployment packet, enabling rapid device deployment. For example... Figure 6As shown, the ADV_NONCONN_IND data structure can include a negotiation field and a status field. The negotiation field is used to negotiate information related to Bluetooth networking, while the status field indicates whether connectionless networking is allowed. Devices receiving the ADV_NONCONN_IND data structure can complete Bluetooth networking based on the negotiation and status fields.
[0124] In this embodiment of the application, ADV_NONCONN_IND can be simply referred to as the non-connectable A packet.
[0125] In this embodiment, on the first electronic device side, each ADV_NONCONN_IND transmission phase can have a corresponding transmission duration (or duration). Optionally, different ADV_NONCONN_IND transmission phases can correspond to the same or different transmission durations; this embodiment does not impose specific restrictions. During each ADV_NONCONN_IND transmission phase, the first electronic device can repeatedly transmit ADV_NONCONN_IND within the corresponding transmission duration of that ADV_NONCONN_IND transmission phase, that is, the first electronic device can repeatedly transmit ADV_NONCONN_IND until the total duration reaches the corresponding transmission duration of that ADV_NONCONN_IND transmission phase. The value of the transmission duration corresponding to each ADV_NONCONN_IND transmission phase can be preset; this embodiment does not impose restrictions on the value of the transmission duration corresponding to each ADV_NONCONN_IND transmission phase.
[0126] Optionally, the transmission duration corresponding to the ADV_NONCONN_IND transmission phase and the transmission duration corresponding to the ADV_IND transmission phase can be the same or different.
[0127] In some embodiments of this application, on the first electronic device side, each ADV_NONCONN_IND transmission phase may have a corresponding interval duration. Optionally, different ADV_NONCONN_IND transmission phases may correspond to the same or different interval durations; no specific limitation is made in this application embodiment. The first electronic device may transmit ADV_NONCONN_IND according to the interval duration corresponding to each ADV_NONCONN_IND transmission phase within the transmission duration corresponding to that ADV_NONCONN_IND transmission phase. That is, the first electronic device may transmit ADV_NONCONN_IND once every interval duration corresponding to that ADV_NONCONN_IND transmission phase until the total duration reaches the transmission duration corresponding to that ADV_NONCONN_IND transmission phase. The value of the interval duration corresponding to each ADV_NONCONN_IND transmission phase may be preset; no limitation is made on the value of the interval duration corresponding to each ADV_NONCONN_IND transmission phase in this application embodiment.
[0128] For example, in a scenario where the transmission duration of any ADV_NONCONN_IND transmission phase is 3 seconds and the interval is 100 ms, the first electronic device can send ADV_NONCONN_IND once every 100 ms until the total duration reaches 3 seconds.
[0129] Part Three: ADV_IND Response Phase
[0130] In the first possible approach, on the second electronic device side, when the second electronic device receives the ADVIND sent by the first electronic device, the second electronic device can enter the ADV_IND response phase. In this approach, the ADV_IND response phase has a corresponding transmission duration (which can also be understood as a duration), and this duration can be preset; in this embodiment, the value of this duration is not limited. When the second electronic device receives the ADVIND sent by the first electronic device, the second electronic device can repeatedly send SCAN_REQ within the transmission duration corresponding to the ADV_IND response phase. That is, the second electronic device can repeatedly send SCAN_REQ until the total duration reaches the transmission duration corresponding to the ADV_IND response phase.
[0131] In some embodiments of this application, the ADV_IND response phase also has a corresponding interval duration, which can be preset, and the value of this duration is not limited in the embodiments of this application. When the second electronic device receives the ADVIND sent by the first electronic device, the second electronic device can send SCAN_REQ within the sending duration corresponding to the ADV_IND response phase, according to the interval duration corresponding to the ADV_IND response phase. That is, the second electronic device can send SCAN_REQ once every interval duration corresponding to the ADV_IND response phase until the total duration reaches the sending duration corresponding to the ADV_IND response phase.
[0132] Based on the above method, a successful ADV_IND transmission and reception process between the first electronic device and the second electronic device can be referred to... Figure 7 .like Figure 7 As shown, the process includes:
[0133] S701: The first electronic device sends ADVIND.
[0134] S702: After receiving ADVIND, the second electronic device sends SCAN_REQ.
[0135] Optionally, SCAN_REQ can be used to indicate information related to the second electronic device, such as the device identifier of the second electronic device, etc., and no specific restrictions are imposed in this embodiment.
[0136] S703: After receiving the SCAN_REQ, the first electronic device sends a SCAN_RSP.
[0137] The first electronic device and the second electronic device can determine the online method based on SCAN_RSP and complete the online connection of the peer device on their own end according to the determined online method.
[0138] In the second possible solution, on the second electronic device side, when the second electronic device receives the ADV_NONCONN_IND sent by the first electronic device, the second electronic device can enter the aforementioned ADV_IND response phase. That is, after receiving the ADV_NONCONN_IND sent by the first electronic device, the second electronic device can send a SCAN_REQ according to the method corresponding to the ADV_IND response phase. In this scenario, when the first electronic device receives the SCAN_REQ sent by the second electronic device, it can send a SCAN_RSP.
[0139] Part Four: ADV_NONCONN_IND Response Phase
[0140] In the first possible solution, on the second electronic device side, when the second electronic device receives the ADV_NONCONN_IND sent by the first electronic device, the second electronic device can enter the ADV_NONCONN_IND response phase. In this solution, the ADV_NONCONN_IND response phase has a corresponding transmission duration (which can also be understood as a duration), and this duration can be preset; in this embodiment, the value of this duration is not limited. When the second electronic device receives the ADV_NONCONN_IND sent by the first electronic device, the second electronic device can repeatedly send the ADV_NONCONN_IND within the transmission duration corresponding to the ADV_NONCONN_IND response phase. That is, the second electronic device can repeatedly send the ADV_NONCONN_IND until the total duration reaches the transmission duration corresponding to the ADV_NONCONN_IND response phase. The ADV_NONCONN_IND sent by the first electronic device can be used to enable the first electronic device to go online in the second electronic device. The ADV_NONCONN_IND sent by the second electronic device can be used to enable the second electronic device to go online in the first electronic device.
[0141] In some embodiments of this application, the ADV_NONCONN_IND response phase also has a corresponding interval duration, which can be preset. The value of this duration is not limited in this embodiment. When the second electronic device receives the ADV_NONCONN_IND sent by the first electronic device, the second electronic device can send ADV_NONCONN_IND within the sending duration corresponding to the ADV_NONCONN_IND response phase, according to the interval duration corresponding to the ADV_NONCONN_IND response phase. That is, the second electronic device can send ADV_NONCONN_IND once every interval corresponding to the ADV_NONCONN_IND response phase until the total duration reaches the sending duration corresponding to the ADV_NONCONN_IND response phase.
[0142] Based on the above method, a successful ADV_NONCONN_IND transmission and reception process between the first electronic device and the second electronic device can be referred to... Figure 8 .like Figure 8 As shown, the process includes:
[0143] S801: The first electronic device sends ADV_NONCONN_IND.
[0144] S802: After receiving ADV_NONCONN_IND, the second electronic device sends ADV_NONCONN_IND.
[0145] In the second possible approach, on the second electronic device side, when the second electronic device receives the ADVIND sent by the first electronic device, the second electronic device can enter the aforementioned ADV_NONCONN_IND response phase. That is, after receiving the ADVIND sent by the first electronic device, the second electronic device can send ADV_NONCONN_IND in accordance with the method corresponding to the ADV_NONCONN_IND response phase.
[0146] In some embodiments of this application, in a Bluetooth networking scenario, the first electronic device can alternately execute the method corresponding to the ADV_IND transmission phase described in the first part and the method corresponding to the ADV_NONCONN_IND transmission phase described in the second part. If the second electronic device can receive the ADVIND or ADV_NONCONN_IND sent by the first electronic device, the second electronic device can execute the method corresponding to the ADV_IND response phase described in the third part, or execute the method corresponding to the ADV_NONCONN_IND response phase described in the fourth part.
[0147] In some embodiments of this application, on the first electronic device side, the order in which the methods corresponding to the ADV_IND sending phase described in the first part and the methods corresponding to the ADV_NONCONN_IND sending phase described in the second part are executed alternately can be arbitrary. For example, the methods corresponding to the ADV_IND sending phase can be executed first, followed by the methods corresponding to the ADV_NONCONN_IND sending phase, and this order can be repeated. Alternatively, the methods corresponding to the ADV_NONCONN_IND sending phase can be executed first, followed by the methods corresponding to the ADV_IND sending phase, and this order can be repeated.
[0148] In some embodiments of this application, during the alternating execution of the methods corresponding to the ADV_IND transmission phase and the ADV_NONCONN_IND transmission phase, the total number and / or total duration of ADV_IND transmission phases completed by the first electronic device can be preset, and this application does not impose specific limitations on this.
[0149] In the above scheme, both the first and second electronic devices can achieve the Bluetooth networking online process based on ADV_NONCONN_IND when handling broadcast transmission and reception. Therefore, it is not necessary to completely rely on ADVIND and SCAN_RSP in ADV_IND to achieve the Bluetooth networking online process. Thus, by alternately executing the methods corresponding to the ADV_IND transmission phase and the ADV_NONCONN_IND transmission phase, on the one hand, the amount of SCAN_RSP transmission and reception can be reduced, thereby reducing the packet loss rate of SCAN_RSP and helping to improve the success rate of broadcast transmission and reception during Bluetooth networking, thereby improving the success rate of Bluetooth networking. On the other hand, it can support Bluetooth networking online based on ADV_NONCONN_IND, thereby effectively improving the success rate of Bluetooth networking.
[0150] The method provided in the above embodiments will be illustrated by example with reference to the following Example 1.
[0151] Example 1: In this example, on the first electronic device side, taking the scenario where the method corresponding to the ADV_IND sending phase and the method corresponding to the ADV_NONCONN_IND sending phase are executed alternately for a total duration of 10 seconds, and the duration of each phase is the same (i.e., the execution time of the method corresponding to each sending phase is 2 seconds each time or the sending time of each phase is 2 seconds each time), and the method corresponding to the ADV_IND sending phase is executed first during the alternation process, on the second electronic device side, taking the scenario where the response method adopted by the second electronic device is the first possible scheme described in the third part and the second possible scheme described in the fourth part, and the execution time of each response phase is 1 second (i.e., the sending time corresponding to each response phase is 1 second), the solution provided in the above embodiment is illustrated by example.
[0152] like Figure 9 As shown in diagram (a) above, a possible communication process on the side of the first electronic device in this scenario may include the following steps A1 to A5:
[0153] A1: The first electronic device sends ADV_IND for 2 seconds.
[0154] The data structure of ADV_IND sent by the first electronic device can be referred to as follows. Figure 5 This will not be repeated here.
[0155] The first electronic device can refer to the method corresponding to the ADV_IND transmission phase described in the first part above and send ADV_IND for 2 seconds, which will not be described in detail here.
[0156] A2: The first electronic device sends ADV_NONCONN_IND for 2 seconds.
[0157] The data structure of ADV_NONCONN_IND sent by the first electronic device can be referred to as follows. Figure 7 This will not be repeated here.
[0158] The first electronic device can refer to the method corresponding to the ADV_NONCONN_IND transmission phase described in Part II above to send ADV_NONCONN_IND for 2 seconds, which will not be described in detail here.
[0159] A3: The first electronic device sends ADV_IND for 2 seconds.
[0160] Regarding step A3, please refer to step A1 above, which will not be repeated here.
[0161] A4: The first electronic device sends ADV_NONCONN_IND for 2 seconds.
[0162] Regarding step A4, please refer to step A2 above, which will not be repeated here.
[0163] A5: The first electronic device sends ADV_IND for 2 seconds.
[0164] Regarding step A5, please refer to step A1 above, which will not be repeated here.
[0165] like Figure 9 As shown in diagram (b) above, a possible communication flow on the second electronic device side in this scenario may include the following steps B1-B2 and / or B3-B4:
[0166] B1: The second electronic device receives ADVIND sent by the first electronic device.
[0167] B2: The second electronic device sends a 1-second SCAN_REQ.
[0168] The first electronic device is based on Figure 9 During the alternating transmission of ADV_IND and ADV_NONCONN_IND as shown in diagram (a), the second electronic device can receive ADV_IND and ADV_NONCONN_IND transmitted by the first electronic device. Specifically, when the second electronic device receives ADVIND from the first electronic device, it can send a 1-second SCAN_REQ, referring to the method described in the first part above for the ADV_IND response phase.
[0169] B3: The second electronic device receives ADV_NONCONN_IND sent by the first electronic device.
[0170] B4: The second electronic device sends ADV_NONCONN_IND for 1 second.
[0171] The first electronic device is based on Figure 9 In the process of alternately sending ADV_IND and ADV_NONCONN_IND as shown in diagram (a), the second electronic device can receive ADV_IND and ADV_NONCONN_IND sent by the first electronic device. Specifically, when the second electronic device receives ADV_NONCONN_IND sent by the first electronic device, the second electronic device can send 1 second of ADV_NONCONN_IND, referring to the method corresponding to the ADV_NONCONN_IND response phase described in Part II above.
[0172] In one example, based on Figure 9 The method shown illustrates a possible air interface interaction between the first electronic device and the second electronic device. Figure 10 .like Figure 10 As shown, within the 2-second duration of the first phase (including the first ADV_IND transmission phase and the ADV_IND response phase), the first electronic device and the second electronic device can perform at least one of the following interactions: the first electronic device sends ADVIND, the second electronic device responds to the received ADV_IND by sending SCAN_REQ, the first electronic device responds to the received SCAN_REQ by sending SCAN_RSP, and the second electronic device receives the SCAN_RSP sent by the first electronic device. Within the 2-second duration of the second phase (including the first ADV_NONCONN_IND transmission phase and the ADV_NONCONN_IND response phase), the first electronic device and the second electronic device can perform at least one of the following interactions: the first electronic device sends ADV_NONCONN_IND, the second electronic device responds to the received ADV_NONCONN_IND by sending ADV_NONCONN_IND, and the first electronic device receives the ADV_NONCONN_IND sent by the second electronic device. Within the 2-second duration of the third phase (including the second ADV_IND transmission phase and the ADV_IND response phase), the first electronic device and the second electronic device can perform an interaction similar to that in the first phase. This process can be repeated in five stages.
[0173] The method described in Example 1 is the same as described above. Figure 1 Compared to the existing solution, by splitting the existing 10-second connectable broadcast into three 2-second connectable broadcasts and two 2-second non-connectable broadcasts and sending them alternately, the success rate of broadcast data packet transmission and reception in multi-device scenarios can be improved, thereby increasing the success rate of Bluetooth networking.
[0174] It should be noted that the various values (such as time values, number of executions, etc.) and application scenarios in Example 1 are only used as examples to help understand the solutions provided in the embodiments of this application, and do not represent the information that must be used or the scenarios that must be applied in the solutions provided in the embodiments of this application, and therefore do not limit the solutions provided in the embodiments of this application.
[0175] Based on the above method, this application also provides a dynamic start-stop scheme with random delay. This scheme may include the following scheme 1 and / or scheme 2:
[0176] Solution 1: In some embodiments of this application, on the first electronic device side, during the alternating execution of the method corresponding to the ADV_IND transmission phase and the method corresponding to the ADV_NONCONN_IND transmission phase, after the first electronic device completes broadcast transmission and reception in any phase, it can wait for a random duration before starting broadcast transmission and reception in the next phase. For example, when the first electronic device first executes the method corresponding to the ADV_IND transmission phase, it can randomly generate a waiting duration after sending SCAN_RSP, and after the waiting duration has elapsed, continue executing the method corresponding to the ADV_NONCONN_IND transmission phase. After executing the method corresponding to the ADV_NONCONN_IND transmission phase, the first electronic device can randomly generate another waiting duration, and after the waiting duration has elapsed, continue executing the method corresponding to the ADV_IND transmission phase. This process continues until the entire alternation process is completed. Optionally, the random duration that the first electronic device waits before starting the next phase after each phase is completed can be a duration randomly selected within a set duration range.
[0177] In this scheme, the first electronic device can reserve a certain amount of time to process broadcast response packets from other electronic devices by waiting for a random duration between two adjacent stages, which helps to improve the success rate of Bluetooth networking.
[0178] Option 2: In some embodiments of this application, on the second electronic device side, after the second electronic device receives a broadcast packet (ADVIND or ADV_NONCONN_IND) sent by the first electronic device, the second electronic device can wait for a random duration before starting to execute the method corresponding to the corresponding response stage. For example, each time the second electronic device receives ADVIND sent by the first electronic device, it can randomly generate a waiting duration, and after the waiting duration has elapsed, it can send SCAN_REQ. Alternatively, each time the second electronic device receives ADV_NONCONN_IND sent by the first electronic device, it can randomly generate a waiting duration, and after the waiting duration has elapsed, it can send ADV_NONCONN_IND. Optionally, the random waiting duration for the second electronic device each time can be a duration randomly selected within a set duration range.
[0179] This scheme minimizes the possibility of the second electronic device simultaneously sending broadcast response packets along with other devices receiving broadcast packets from the first electronic device. When there are a large number of devices in a Bluetooth network, it effectively prevents the first electronic device from simultaneously receiving broadcast response packets from a large number of devices, thus avoiding broadcast storms. This method also helps reduce packet loss during communication, thereby improving the success rate of Bluetooth networking.
[0180] The method provided in the above embodiments will be illustrated by example with reference to Example 2 below.
[0181] Example 2: Combining the scenarios described in Scheme 1, Scheme 2, and Example 1, such as... Figure 11 As shown in diagram (a) above, a possible communication process on the side of the first electronic device in this scenario may include the following steps C1 to C5:
[0182] C1: The first electronic device sends ADV_IND for 2 seconds.
[0183] C2: Random waiting time for the first electronic device.
[0184] C3: The first electronic device sends ADV_NONCONN_IND for 2 seconds.
[0185] C4: Random waiting time for the first electronic device.
[0186] C5: The first electronic device sends ADV_IND for 2 seconds.
[0187] C6: The first electronic device waits for a random duration.
[0188] C7: The first electronic device sends ADV_NONCONN_IND for 2 seconds.
[0189] C8: The first electronic device waits for a random duration.
[0190] C9: The first electronic device sends ADV_IND for 2 seconds.
[0191] In steps C2, C4, and C7, the random duration in each step can be randomly determined by the first electronic device. The random duration in each step may be the same as or different from the random duration in other steps, and this embodiment does not impose any restrictions. For example, taking the set duration range of 100ms to 500ms as described in Scheme 1 and Scheme 2 above, in steps C2, C4, C6, and C8 above, the first electronic device can randomly determine the required waiting duration within the range of 100ms to 500ms.
[0192] For steps C1, C5, and C9 mentioned above, please refer to step A1 above; they will not be repeated here. For steps C3 and C7 mentioned above, please refer to step A2 above; they will not be repeated here.
[0193] like Figure 11 As shown in diagram (b) above, a possible communication flow on the second electronic device side in this scenario may include the following steps D1 to D3 and / or D4 to D6:
[0194] D1: The second electronic device receives ADVIND sent by the first electronic device.
[0195] D2: Random waiting time for the second electronic device.
[0196] D3: The second electronic device sends a 1-second SCAN_REQ.
[0197] Regarding step D3, please refer to step B2 mentioned above, and it will not be repeated here.
[0198] D4: The second electronic device receives ADV_NONCONN_IND sent by the first electronic device.
[0199] D5: Random waiting time for the second electronic device.
[0200] D6: The second electronic device sends ADV_NONCONN_IND for 1 second.
[0201] Regarding step D6, please refer to step B4 mentioned above, and it will not be repeated here.
[0202] For example, taking the set duration range of 100ms to 500ms as described in Scheme 1 and Scheme 2 above as an example, in steps D2 and D5 above, the second electronic device can randomly determine the required waiting duration within 100ms to 500ms.
[0203] In one example, based on Figure 11The method shown illustrates a possible air interface interaction between the first electronic device and the second electronic device. Figure 12 .like Figure 12 As shown, during the 2-second duration of the first phase (including the first ADV_NONCONN_IND transmission phase and the ADV_NONCONN_IND response phase), the first electronic device and the second electronic device can perform at least one of the following interaction processes: the first electronic device sends ADV_NONCONN_IND, the second electronic device sends ADV_NONCONN_IND in response to the received ADV_NONCONN_IND, and the first electronic device receives the ADV_NONCONN_IND sent by the second electronic device. During the 2-second duration of the second phase (including the first ADV_IND transmission phase and the ADV_IND response phase), the first electronic device and the second electronic device can perform at least one of the following interaction processes: the first electronic device sends ADVIND, the second electronic device sends SCAN_REQ in response to the received ADV_IND, the first electronic device sends SCAN_RSP in response to the received SCAN_REQ, and the second electronic device receives the SCAN_RSP sent by the first electronic device. During the second two-second period of the third phase (which includes the second ADV_NONCONN_IND transmission phase and the ADV_NONCONN_IND response phase), the first and second electronic devices can perform an interaction process similar to that in the first phase. This process can be repeated to complete a five-phase interaction.
[0204] The method described in Example 2 is the same as described above. Figure 1 Compared to existing solutions, the current 10-second connectable broadcast can be split into three 2-second connectable broadcasts and two 2-second non-connectable broadcasts, which are then sent alternately. By randomly waiting a certain amount of time before alternating, the success rate of broadcast data packet transmission and reception in multi-device scenarios can be improved, while further reducing air interface congestion, thus significantly enhancing the Bluetooth networking success rate. Experimental results show that, while maintaining online performance, the above method can support an increase in the number of devices simultaneously going online via Bluetooth from the current 4 to over 20.
[0205] The method provided in the above embodiments will be illustrated by way of example 3 below.
[0206] Example 3: In this example, the total execution time of the method corresponding to the ADV_IND sending phase and the method corresponding to the ADV_NONCONN_IND sending phase is 10 seconds. During the alternation, the method corresponding to the ADV_NONCONN_IND sending phase is executed first. The example shows a scenario where the duration of some phases is the same and the duration of other phases is different. This example illustrates the solution provided by the above embodiment.
[0207] like Figure 13 As shown in diagram (a) above, a possible communication flow on the first electronic device side in this scenario may include the following steps E1 to E9:
[0208] E1: The first electronic device sends ADV_NONCONN_IND for 4 seconds.
[0209] E2: Random waiting time for the first electronic device.
[0210] E3: The first electronic device sends ADV_IND for 2 seconds.
[0211] E4: The first electronic device waits for a random amount of time.
[0212] E5: The first electronic device sends ADV_NONCONN_IND for 2 seconds.
[0213] E6: The first electronic device waits for a random amount of time.
[0214] E7: The first electronic device sends ADV_IND for 2 seconds.
[0215] In steps E2, E4, and E6 above, the random duration in each step can be randomly determined by the first electronic device. The random duration in each step may be the same as or different from the random duration in other steps, and this embodiment of the application does not impose any restrictions. For example, taking the set duration range of 100ms to 300ms as described in Scheme 1 and Scheme 2 above as an example, in steps E2, E4, and E6 above, the first electronic device can randomly determine the required waiting duration within the range of 100ms to 300ms.
[0216] For the specific implementation methods of steps E1 and E5 mentioned above, please refer to step A1 above, and they will not be repeated here. For steps E3 and E7 mentioned above, please refer to step A2 above, and they will not be repeated here.
[0217] like Figure 13 As shown in diagram (b) above, a possible communication flow on the second electronic device side in this scenario may include the following steps F1 to F3 and / or F4 to F6:
[0218] F1: The second electronic device receives ADVIND or ADV_NONCONN_IND sent by the first electronic device.
[0219] F2: Random waiting time for the second electronic device.
[0220] F3: The second electronic device sends ADV_NONCONN_IND for 2 seconds.
[0221] Regarding step F3, please refer to step B4 mentioned above, which will not be repeated here.
[0222] F4: The second electronic device receives ADVIND or ADV_NONCONN_IND sent by the first electronic device.
[0223] F5: Random waiting time for the second electronic device.
[0224] F6: The second electronic device sends a 1-second SCAN_REQ.
[0225] Regarding step F6, please refer to step B2 above, which will not be repeated here.
[0226] It should be understood that the implementation processes provided in the above embodiments are merely illustrative examples of the applicable method processes in the embodiments of this application. The execution order of each step in each process can be adjusted according to actual needs, and other steps can be added or some steps can be removed. The execution order between steps that are not temporally related in the embodiments can be arbitrary, and this application does not impose any restrictions on this.
[0227] It should be noted that the application scenarios provided in the above embodiments are merely illustrative examples of the applicable scenarios of the embodiments of this application, and do not limit the applicable scenarios of the solutions of this application. Some methods or the same technical concepts provided in any of the above embodiments can also be applied in other embodiments or other scenarios, or can be combined with the methods provided in other embodiments. Specifically, they can be applied in combination with specific embodiments or specific scenarios, and will not be listed and described one by one in this application.
[0228] Based on the above embodiments and the same technical concept, this application also provides a method for rapid BLE networking in multi-device scenarios, such as... Figure 14 As shown, the method may include:
[0229] S1401: The first electronic device sends a first broadcast; wherein the first broadcast includes either a connectable non-directional broadcast or a non-connectable non-directional broadcast, and the non-connectable non-directional broadcast includes information indicating whether a connectionless network is online.
[0230] The connectable non-directional broadcast can be referred to ADV_IND in the previous embodiment, and the non-connectable non-directional broadcast can be referred to ADV_NONCONN_IND in the previous embodiment (wherein, the information included in the non-connectable non-directional broadcast to indicate whether the connectionless network is online can be the status field in the previous embodiment), which will not be described in detail here.
[0231] Optionally, the process of the first electronic device sending the first broadcast each time includes at least: the first electronic device sending a connectable non-directional broadcast packet (i.e., an ADVIND packet). In addition, the process of the first electronic device sending the first broadcast each time may further include: sending a scan response in response to a received scan request. The scan request can be referred to as SCAN_REQ in the preceding embodiments, and the scan response can be referred to as SCAN_RSP in the preceding embodiments; details will not be elaborated here.
[0232] For example, the first electronic device may be the first electronic device described in the foregoing embodiments.
[0233] In some embodiments of this application, the first electronic device may send a first broadcast in the following manner: the first electronic device sends a first broadcast for a third duration. Specifically, the first electronic device may send a first broadcast every fifth duration within the third duration. That is, the first electronic device may send a first broadcast every fifth duration until the total duration reaches the third duration. Optionally, the third duration and the fifth duration may be pre-configured durations for the first electronic device, or durations that can be preset by the user. The fifth duration is shorter than the third duration. Based on the above method, step S1401 can also be understood as: the first electronic device sends at least one first broadcast; wherein the time interval between two consecutive first broadcasts sent by the first electronic device is the fifth duration, and the total duration of the first electronic device sending at least one first broadcast is the third duration; the first broadcast includes either a connectable non-directional broadcast or a non-connectable non-directional broadcast, and the non-connectable non-directional broadcast includes information indicating whether a connectionless network is online.
[0234] For example, when the first broadcast is a connectable non-directional broadcast, the process of the first electronic device sending the first broadcast can be implemented with reference to the method described in the first part above, and will not be described in detail here. When the first broadcast is a non-connectable non-directional broadcast, the process of the first electronic device sending the first broadcast can be implemented with reference to the method described in the second part above, and will not be described in detail here.
[0235] S1402: The first electronic device sends a second broadcast; wherein the second broadcast includes one of a connectable non-directional broadcast and an unconnectable non-directional broadcast that is different from the first broadcast.
[0236] In some embodiments of this application, the first electronic device can send a second broadcast in the following manner: sending a second broadcast of a fourth duration. Specifically, the first electronic device can send a second broadcast every sixth duration within the fourth duration. That is, the first electronic device can send a second broadcast every sixth duration until the total duration reaches the fourth duration. The fourth and sixth durations can be pre-configured durations for the first electronic device, or durations that can be preset by the user. The sixth duration is shorter than the fourth duration. Optionally, the fourth duration can be the same as or different from the third duration mentioned above. Optionally, the sixth duration can be the same as or different from the fifth duration mentioned above. Based on the above method, step S1402 can also be understood as: the first electronic device sends at least one second broadcast; wherein the time interval between two consecutive second broadcasts sent by the first electronic device is the sixth duration, and the total duration of the first electronic device sending at least one second broadcast is the fourth duration; the second broadcast includes either a connectable non-directional broadcast or a non-connectable non-directional broadcast that is different from the first broadcast.
[0237] In some embodiments of this application, after executing step S1401 and before executing step S1402, the first electronic device may wait for a first duration. That is, after executing step S1401, the first electronic device may wait for a first duration before executing step S1402. Optionally, the first duration may be a duration pre-configured by the first electronic device or the user, or the first duration may be a duration randomly selected within a set first duration range. The first duration range may be a duration range pre-configured by the electronic device or the user. For example, the first duration range may be the set duration range described in the aforementioned Scheme 1 or Scheme 2, etc.
[0238] In one possible implementation, the first electronic device may repeatedly and alternately execute steps S1401 and S1402. Optionally, the number of times the first electronic device alternately executes steps S1401 and S1402 can be a predetermined number, or the total duration for which the first electronic device alternately executes steps S1401 and S1402 can be a predetermined duration. For example, this predetermined duration can be 10 seconds as described in the foregoing embodiment.
[0239] For example, the method by which the first electronic device alternately performs steps S1401 and S1402 can be described with reference to the method described in Example 1 above (e.g. Figure 9 The method shown in (a) of the diagram or the method described in Example 2 (e.g.) Figure 11 The method shown in (a) of the diagram or the method described in Example 3 (e.g.) Figure 13 The method shown in diagram (a) is implemented.
[0240] Based on the above method, in one example, such as Figure 14 As shown, after performing step S1402, the first electronic device can continue to perform the following step S1403.
[0241] S1403: The first electronic device sends a third broadcast; wherein the third broadcast includes one of a connectable non-directional broadcast and an inconnectable non-directional broadcast that differs from the second broadcast.
[0242] The sending of the third broadcast by the first electronic device can also be understood as the first electronic device sending the first broadcast again. For a detailed implementation of step S1403, please refer to the detailed implementation of step S1401 or step S1402; it will not be described in detail in this application embodiment.
[0243] In some embodiments of this application, after executing step S1402 and before executing step S1403, the first electronic device may wait for a second duration. Optionally, the second duration may be the same as or different from the first duration. Optionally, the second duration may be a duration pre-configured by the electronic device or the user, or the second duration may be a duration randomly selected within a set second duration range. The second duration range may be a duration range pre-configured by the first electronic device or the user. Optionally, the second duration range may be the same as or different from the first duration range.
[0244] And so on, in yet another example, such as Figure 14 As shown, after performing step S1403, the first electronic device can continue to perform the following step S1404.
[0245] S1404: The first electronic device sends a fourth broadcast; wherein the fourth broadcast includes one of connectable non-directional broadcasts and non-connectable non-directional broadcasts that differs from the third broadcast.
[0246] The sending of the fourth broadcast by the first electronic device can also be understood as the first electronic device sending the second broadcast again. For a detailed implementation of step S1404, please refer to the detailed implementation of steps S1402 or S1403; these details will not be elaborated further in this application embodiment.
[0247] For example, the process of the first electronic device performing the above steps S1401 to S1404 can be referred to Figure 9 The method shown in diagram (a) in the figure or Figure 11 The method shown in diagram (a) in the figure or Figure 13 The method shown in diagram (a) is implemented as described in this embodiment and will not be detailed further.
[0248] In some embodiments of this application, after performing each of steps S1401 to S1404, the first electronic device may further perform the following step: receiving a first message. The first message includes one of a scan request from the second device and a non-connectable non-directional broadcast from the second device, wherein the non-connectable non-directional broadcast may include information indicating whether a connectionless network is online.
[0249] The specific steps performed by the first electronic device in the above method can be found in the relevant descriptions in the foregoing embodiments, and will not be repeated here.
[0250] Based on the above embodiments and the same technical concept, this application also provides a method for rapid BLE networking in multi-device scenarios, such as... Figure 15 As shown, the method may include:
[0251] S1501: The second electronic device responds to the received first broadcast by sending a first message; wherein the first broadcast includes one of a connectable non-directional broadcast and a non-connectable non-directional broadcast from the first electronic device, the first message is one of a scan request and a non-connectable non-directional broadcast, and any non-connectable non-directional broadcast includes information indicating whether a connectionless network is online.
[0252] Specifically, the connectable non-directional broadcast can be referred to as ADV_IND in the aforementioned embodiments, and the non-connectable non-directional broadcast can be referred to as ADV_NONCONN_IND in the aforementioned embodiments (wherein, the information included in the non-connectable non-directional broadcast to indicate whether the connectionless network is online can be the status field described in the aforementioned embodiments), and the scan request can be referred to as SCAN_REQ in the aforementioned embodiments, which will not be described in detail here.
[0253] Optionally, the second electronic device can send the first message by sending a first message of a fourth duration. Specifically, the second electronic device can send the first message every sixth duration within the fourth duration. That is, the second electronic device can send the first message every sixth duration until the total duration reaches the fourth duration. Optionally, the fourth duration and the sixth duration can be pre-configured durations for the first electronic device, or durations that can be preset by the user. The sixth duration is shorter than the fourth duration. Based on the above method, step S1501 can also be understood as: the second electronic device sends at least one first message; wherein the time interval between two consecutive first message transmissions by the second electronic device is the sixth duration, and the total duration of the second electronic device sending at least one first message is the fourth duration; the first broadcast includes one of connectable non-directional broadcasts and non-connectable non-directional broadcasts from the first electronic device, the first message is one of a scan request and a non-connectable non-directional broadcast, and any non-connectable non-directional broadcast includes information indicating whether a connectionless network is online.
[0254] For example, when the first message is a scan request, the process of the second electronic device sending the first message can be implemented with reference to the method described in Part Three above, and will not be described in detail here. When the first message is a non-directional broadcast that cannot be connected, the process of the second electronic device sending the first message can be implemented with reference to the method described in Part Four above, and will not be described in detail here.
[0255] In some embodiments of this application, before executing step S1501, the second electronic device further performs the following step: receiving a first broadcast. Optionally, upon receiving the first broadcast, the second electronic device may wait for a first duration before executing step S1501. Optionally, the first duration may be a duration pre-configured by the second electronic device or the user, or the first duration may be a duration randomly selected within a set first duration range. The first duration range may be a duration range pre-configured by the electronic device or the user. For example, the first duration range may be the set duration range described in the aforementioned Scheme 1 or Scheme 2, etc.
[0256] S1502: In response to the received second broadcast, the second electronic device sends a second message; wherein the second broadcast includes one of a connectable non-directional broadcast and a non-connectable non-directional broadcast from the first electronic device; the second message is one of a scan request and a non-connectable non-directional broadcast that is different from the first message.
[0257] In some embodiments of this application, the second electronic device may send a second message in the following manner: sending a second message of a fifth duration. Specifically, the second electronic device may send a second message every seventh duration within the fifth duration. That is, the second electronic device may send a second message every seventh duration until the total duration reaches the fifth duration. The fifth and seventh durations may be pre-configured durations for the second electronic device, or durations that can be preset by the user. The seventh duration is shorter than the fifth duration. Optionally, the fifth duration may be the same as or different from the fourth duration mentioned above. Optionally, the seventh duration may be the same as or different from the sixth duration mentioned above. Based on the above method, step S1502 can also be understood as: the second electronic device sending at least one second message; wherein the time interval between two consecutive second message transmissions by the second electronic device is the seventh duration, and the total duration of the second electronic device sending at least one second message is the fifth duration; the second broadcast includes one of a connectable non-directional broadcast and an unconnectable non-directional broadcast from the first electronic device; the second message is a scan request and an unconnectable non-directional broadcast that differs from the first message.
[0258] In some embodiments of this application, before executing step S1502, the second electronic device further performs the following step: receiving a second broadcast. Optionally, upon receiving the second broadcast, the second electronic device may wait for a second duration before executing step S1502. The second duration may be a duration pre-configured by the second electronic device or the user, or it may be a duration randomly selected within a set second duration range. Optionally, the second duration may be the same as or different from the first duration. The second duration range may be a duration range pre-configured by the electronic device or the user. Optionally, the second duration range may be the same as or different from the first duration range. For example, the second duration range may be the set duration range described in the aforementioned Scheme 1 or Scheme 2, etc.
[0259] In one possible implementation, the second electronic device may repeatedly and alternately execute steps S1501 and S1502 as described above. For example, the method by which the second electronic device alternately executes steps S1501 and S1502 can be referenced to the method described in Example 1 above (e.g., Figure 9 The method shown in (b) of the diagram or the method described in Example 2 (e.g.) Figure 11 The method shown in (b) of the diagram or the method described in Example 3 (e.g.) Figure 13 The method shown in diagram (a) is implemented.
[0260] Based on the above method, in one example, such as Figure 15 As shown, after performing step S1502, the first electronic device can continue to perform the following step S1503.
[0261] S1503: The second electronic device responds to the received third broadcast by sending a third message; wherein the third broadcast includes one of a connectable non-directional broadcast and a non-connectable non-directional broadcast from the first electronic device; the third message is one of a scan request and a non-connectable non-directional broadcast that is different from the second message.
[0262] In this context, the second electronic device sending the third message can also be understood as the second electronic device sending the first message again.
[0263] In some embodiments of this application, before executing step S1503, the first electronic device further performs the following step: receiving a third broadcast. Optionally, upon receiving the third broadcast, the second electronic device may wait for a third duration before executing step S1503. The third duration may be a duration pre-configured by the second electronic device or the user, or it may be a duration randomly selected within a set third duration range. Optionally, the third duration may be the same as or different from the first or second duration. The third duration range may be a duration range pre-configured by the second electronic device or the user. Optionally, the third duration range may be the same as or different from the first or second duration range. For example, the third duration range may be a set duration range as described in the aforementioned Scheme 1 or Scheme 2, etc.
[0264] For the specific implementation of step S1503, please refer to the specific implementation of step S1501 or step S1502. It will not be described in detail in the embodiments of this application.
[0265] And so on, in yet another example, such as Figure 15 As shown, after performing step S1503, the first electronic device can continue to perform the following step S1504.
[0266] S1504: In response to the received fourth broadcast, the second electronic device sends a fourth message; wherein the fourth broadcast includes one of a connectable non-directional broadcast and a non-connectable non-directional broadcast from the first electronic device; the fourth message is one of a scan request and a non-connectable non-directional broadcast that is different from the third message.
[0267] In this context, the second electronic device sending the fourth message can also be understood as the second electronic device sending the second message again. For a detailed implementation of step S1504, please refer to the specific implementation of step S1504 or step S1503; it will not be described in detail in this application embodiment.
[0268] For example, the process of the second electronic device performing the above steps S1501 to S1504 can be referred to Figure 9The method shown in diagram (b) or Figure 11 The method shown in diagram (b) or Figure 13 The method shown in diagram (b) is implemented as described in this embodiment and will not be detailed further.
[0269] The specific steps performed by the second electronic device in the above method can be found in the relevant descriptions in the foregoing embodiments, and will not be repeated here.
[0270] Based on the above embodiments and the same technical concept, this application also provides an electronic device for implementing the multi-device scenario BLE rapid networking method for a first electronic device or a second electronic device provided in this application. Figure 16 As shown, electronic device 1600 may include: memory 1601, one or more processors 1602, and one or more computer programs (not shown). These devices may be coupled via one or more communication buses 1603. Optionally, electronic device 1600 may also include a display screen 1604.
[0271] The memory 1601 stores one or more computer programs (code), and the one or more computer programs include computer instructions; one or more processors 1602 call the computer instructions stored in the memory 1601, causing the electronic device 1600 to execute the multi-device scenario BLE rapid networking online method for a first electronic device or a second electronic device provided in the embodiments of this application.
[0272] In a specific implementation, memory 1601 may include high-speed random access memory and may also include non-volatile memory, such as one or more disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. Memory 1601 may store an operating system (hereinafter referred to as the system), such as embedded operating systems like Android, iOS, Windows, or Linux. Memory 1601 can be used to store implementation programs of the embodiments of this application. Memory 1601 may also store network communication programs, which can be used to communicate with one or more additional devices, one or more user devices, or one or more network devices.
[0273] One or more processors 1602 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of programs according to the present application.
[0274] Display screen 1604 is used to display application interfaces and other related user interfaces.
[0275] It should be noted that, Figure 16 This is merely one implementation of the electronic device 1600 provided in this application embodiment. In practical applications, the electronic device 1600 may include more or fewer components, as detailed in the following references. Figure 3 The specific structure and description shown are not limited here.
[0276] Based on the above embodiments and the same technical concept, this application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the method provided in the above embodiments for use in a first electronic device or a second electronic device.
[0277] Based on the above embodiments and the same technical concept, this application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the computer performs the method provided in the above embodiments for use in a first electronic device or a second electronic device.
[0278] Based on the above embodiments and the same technical concept, this application also provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the computer performs the method provided in the above embodiments for use in a first electronic device or a second electronic device.
[0279] The methods provided in this application can be implemented, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, they can be implemented, in whole or in part, in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of the present invention is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user equipment, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. A computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs), or semiconductor media (e.g., SSDs), etc.
[0280] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for rapid BLE networking in a multi-device scenario, applied to a first electronic device, characterized in that, The method includes: Send a first broadcast; wherein the first broadcast includes either a connectable non-directional broadcast or a non-connectable non-directional broadcast, the non-connectable non-directional broadcast including information indicating whether a connectionless network is online; Send a second broadcast; wherein the second broadcast includes one of the connectable non-directional broadcast and the non-connectable non-directional broadcast that is different from the first broadcast.
2. The method as described in claim 1, characterized in that, After sending the first broadcast and before sending the second broadcast, the method further includes: waiting for a first duration.
3. The method as described in claim 2, characterized in that, The first duration is a duration randomly selected within a set first duration range.
4. The method according to any one of claims 1 to 3, characterized in that, After sending the second broadcast, the method further includes: Send a third broadcast; wherein the third broadcast includes one of the connectable non-directional broadcast and the non-connectable non-directional broadcast that is different from the second broadcast.
5. The method as described in claim 4, characterized in that, After sending the second broadcast and before sending the third broadcast, the method further includes: Waiting for the second period of time.
6. The method as described in claim 5, characterized in that, The second duration is a duration randomly selected within the set second duration range.
7. The method according to any one of claims 1 to 6, characterized in that, The sending of the first broadcast includes: sending the first broadcast for a third duration; The sending of the second broadcast includes: sending the second broadcast for a fourth duration.
8. The method as described in claim 7, characterized in that, The sending of the first broadcast for the third duration includes: sending the first broadcast once every fifth duration until the total duration reaches the third duration; Sending the second broadcast for the fourth duration includes: sending the second broadcast once every sixth duration until the total duration reaches the fourth duration.
9. The method according to any one of claims 1 to 8, characterized in that, After sending the first broadcast, or after sending the second broadcast, the method further includes: Receive a first message; wherein the first message includes one of a scan request from the second device and a non-connectable non-directional broadcast from the second device; wherein the non-connectable non-directional broadcast from the second device includes information indicating whether a connectionless network is online.
10. A method for rapid BLE networking in multi-device scenarios, applied to a second electronic device, characterized in that, The method includes: In response to the received first broadcast, a first message is sent; wherein the first message is one of a scan request and a non-connectable non-directional broadcast; In response to the received second broadcast, a second message is sent; wherein the second message is different from the first message in either the scan request or the unconnectable non-directional broadcast; Wherein, the first broadcast and the second broadcast each include one of a connectable non-directional broadcast from the first electronic device and a non-connectable non-directional broadcast from the first electronic device; Any non-connectable, non-directional broadcast includes information indicating whether a connectionless network is online.
11. The method as described in claim 10, characterized in that, Before sending a first message in response to a received first broadcast, the method further includes: waiting for a first duration when the first broadcast is received.
12. The method as described in claim 11, characterized in that, The first duration is a duration randomly selected within a set first duration range.
13. The method according to any one of claims 10 to 12, characterized in that, Before sending a second message in response to a received second broadcast, the method further includes: When the second broadcast is received, wait for the second duration.
14. The method as described in claim 13, characterized in that, The second duration is a duration randomly selected within the set second duration range.
15. The method according to any one of claims 10 to 14, characterized in that, After sending a second message in response to a received second broadcast, the method further includes: In response to the received third broadcast, a third message is sent; wherein the third broadcast includes one of a connectable non-directional broadcast from the first electronic device and a non-connectable non-directional broadcast from the first electronic device; the third message is one of a scan request and a non-connectable non-directional broadcast that is different from the second message; any non-connectable non-directional broadcast includes information indicating whether a connectionless networking is online.
16. The method as described in claim 15, characterized in that, Before sending a third message in response to a received third broadcast, the method further includes: Upon receiving the third broadcast, wait for a third duration.
17. The method as described in claim 16, characterized in that, The third duration is a duration randomly selected within the set third duration range.
18. The method according to any one of claims 10 to 17, characterized in that, Sending the first message includes: sending the first message for a fourth duration; Sending the second message includes sending the second message for a fifth duration.
19. The method as described in claim 18, characterized in that, Sending the first message for the fourth duration includes: sending the first message once every sixth duration until the total duration reaches the fourth duration; Sending the second message for the fifth duration includes sending the second message once every seventh duration until the total duration reaches the fifth duration.
20. An electronic device, characterized in that, The electronic device includes a memory and one or more processors; The memory is used to store computer program code, which includes computer instructions; when the computer instructions are executed by the one or more processors, the electronic device performs the method as described in any one of claims 1 to 9, or performs the method as described in any one of claims 10 to 19.
21. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1 to 9, or the method as described in any one of claims 10 to 19.
22. A computer program product, characterized in that, The computer program product includes a computer program or instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1 to 9, or to perform the method as described in any one of claims 10 to 19.