Broadcast method for short-range wireless communication, and related apparatus

By mapping Bluetooth broadcast tasks into subtasks with different rate modes and scheduling them in parallel, the problems of high latency and low success rate of Bluetooth broadcasting are solved, achieving more efficient resource utilization and improved success rate.

WO2026061431A1PCT designated stage Publication Date: 2026-03-26HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2026-03-26

AI Technical Summary

Technical Problem

Short-range wireless communication technologies such as Bluetooth are prone to problems such as resource congestion, chip overload, packet loss, high broadcast transmission and reception latency, and low success rate when multiple services are broadcast concurrently.

Method used

Broadcast tasks are mapped to subtasks with different rate modes and added to the corresponding broadcast queues. Subtasks with different rate modes are scheduled separately and executed in parallel using multiple broadcast channels to avoid resource waste and long waiting times.

Benefits of technology

It effectively reduced broadcast latency, improved broadcast success rate, and enhanced the overall performance of Bluetooth broadcasting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025122155_26032026_PF_FP_ABST
    Figure CN2025122155_26032026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a broadcast method for short-range wireless communication, and a related apparatus. The method comprises: determining a first sub-task in a first rate mode and a second sub-task in a second rate mode, which first sub-task and second sub-task correspond to a first broadcast task, wherein a broadcast cycle of the first sub-task in the first rate mode is less than a broadcast cycle of the second sub-task in the second rate mode; adding the first sub-task to a target broadcast queue, wherein the target broadcast queue is a first broadcast queue corresponding to the first rate mode or a second broadcast queue corresponding to the second rate mode; adding the second sub-task to the second broadcast queue; and separately scheduling sub-tasks in the first broadcast queue and the second broadcast queue. In this way, the broadcast delay can be shortened, thereby effectively improving the overall performance of Bluetooth broadcast.
Need to check novelty before this filing date? Find Prior Art

Description

Broadcast method of close-range wireless communication and related apparatus

[0001] The present application claims priority to the Chinese patent application No. 202411319644.7, filed on September 20, 2024, entitled "Broadcast method of close-range wireless communication and related apparatus", the content of which is incorporated herein by reference in its entirety. The present application claims priority to the Chinese patent application No. 202411482110.6, filed on October 22, 2024, entitled "Broadcast method of close-range wireless communication and related apparatus", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the field of electronic technology, and in particular to a broadcast method of close-range wireless communication and related apparatus. BACKGROUND

[0003] With the development of wireless communication technology, more and more electronic devices communicate through close-range wireless communication technologies such as Bluetooth, wireless fidelity (WiFi), etc. In the case where no connection is established between electronic devices, close-range wireless communication technologies usually use broadcast channels to send and receive broadcast packets, so that electronic devices can discover other electronic devices around or establish a connection with a certain electronic device.

[0004] Due to the limited resources of the broadcast channel of close-range wireless communication technologies (such as Bluetooth low energy (BLE)), the processing capability of the hardware / chip of some electronic devices is limited. When multiple services broadcast concurrently, problems such as resource congestion, chip busy, packet loss, high broadcast transmission delay, and low success rate may occur.

[0005] At present, how to broadcast to reduce the above problems, reduce the broadcast delay, and improve the broadcast success rate still needs further research. SUMMARY

[0006] The embodiments of the present application provide a broadcast method of close-range wireless communication and related apparatus, which can reduce the broadcast delay, improve the broadcast success rate, and effectively improve the overall performance of Bluetooth broadcast.

[0007] In a first aspect, the present application provides a broadcasting method of close-range wireless communication, applied to an electronic device, and characterized in that the method comprises: determining a first subtask of a first rate mode and a second subtask of a second rate mode corresponding to a first broadcasting task; the broadcasting period of the first subtask in the first rate mode is less than the broadcasting period of the second subtask in the second rate mode; adding the first subtask to a target broadcasting queue, which is a first broadcasting queue corresponding to the first rate mode or a second broadcasting queue corresponding to the second rate mode; adding the second subtask to the second broadcasting queue; and scheduling the subtasks in the first broadcasting queue and the second broadcasting queue respectively.

[0008] wherein the broadcasting period in different rate modes has different value ranges; and the value in the value range of the broadcasting period in the first rate mode is less than the value in the value range of the broadcasting period in the second rate mode.

[0009] The smaller the broadcasting period is, the greater the demand for broadcasting resources in a unit of time is, and the higher the transmission rate of broadcasting is. A broadcasting task is mapped to subtasks in different rate modes (for example, a first subtask in a first rate mode and a second subtask in a second rate mode), that is, subtasks in different broadcasting periods, and the subtasks in each rate mode are added to the broadcasting queue corresponding to the rate mode. In one implementation, the first subtask in the first rate mode is added to the first broadcasting queue in the first rate mode, and the second subtask in the second rate mode is added to the first broadcasting queue in the second rate mode. When the subtask of the first broadcasting task in the first broadcasting queue is not scheduled, the subtask of the first broadcasting task in the second broadcasting queue can be scheduled to use the broadcasting resource corresponding to the second broadcasting queue for broadcasting. In this way, the waiting time of the subtask can be reduced, the broadcasting delay can be effectively reduced, and the success rate of broadcasting can be improved. In another implementation, if other broadcasting tasks continuously occupy the broadcasting queue in the first rate mode, the subtask in the first rate mode can be added to the second broadcasting queue and scheduled in the second broadcasting queue. In this way, the waiting time of the subtask can be reduced, thereby reducing the broadcasting delay. Compared with scheduling broadcasting tasks by using a single dimension of priority, the embodiments of the present application can reduce the broadcasting delay, improve the success rate of broadcasting, and effectively improve the overall performance of broadcasting.

[0010] In an implementation manner, the first subtask of the first rate mode and the second subtask of the second rate mode corresponding to the first broadcast task comprise: determining the first subtask of the first rate mode and the second subtask of the second rate mode corresponding to the first broadcast task according to the first broadcast type and the first file corresponding to the first broadcast task; the first file indicates the broadcast period of the one or more subtasks of the rate mode mapped by the broadcast task of each broadcast type. In the embodiment of the application, different strategies are set for different broadcast types in the first file, and the broadcast parameters of the one or more subtasks of the rate mode corresponding to different broadcast types are specifically indicated; in this way, according to the broadcast type and the first file, the broadcast tasks of different broadcast types can be mapped to different subtasks.

[0011] In an implementation manner, the method further comprises: executing the subtask scheduled in the second broadcast queue when the subtask scheduled in the first broadcast queue is executed; the broadcast task corresponding to the subtask scheduled in the first broadcast queue and the subtask scheduled in the second broadcast queue is different. It can be understood that simultaneously invoking different subtasks of the same broadcast task in different broadcast queues will cause repeated broadcasting and waste of broadcast resources; in the embodiment of the application, the subtasks of different broadcast tasks are scheduled in the first broadcast queue and the second broadcast queue in the same time period, so that the above-mentioned waste of broadcast resources can be avoided.

[0012] In an implementation manner, the first broadcast channel is used to execute the subtask scheduled in the first broadcast queue; and the second broadcast channel is used to execute the subtask scheduled in the second broadcast queue. In the embodiment of the application, the subtasks scheduled in the broadcast queues of different rate modes are executed in parallel on different broadcast channels, so that the subtasks of multiple broadcast tasks can be executed in parallel; in this way, in the concurrent multiple broadcast task scenario, the broadcast method of the short-range wireless communication provided in the first aspect can effectively reduce the broadcast delay, improve the broadcast success rate, and improve the overall performance of the broadcast.

[0013] In an implementation manner, before the first subtask is added to the target broadcast queue, the method further comprises: adding the first broadcast task to a task queue; the task queue comprises multiple broadcast tasks. In the embodiment of the application, in the scenario of concurrent multiple broadcast tasks, the broadcast delay can be reduced, the broadcast success rate can be improved, and the overall performance of the broadcast can be effectively improved.

[0014] In an implementation manner, the adding the first sub-task into the target broadcast queue comprises: if the first broadcast queue is not full, adding the first sub-task into the first broadcast queue; if the first broadcast queue is full, adding the first sub-task into the second broadcast queue if the second broadcast queue is not full, or deleting a first sub-task of the first rate mode added earliest in the first broadcast queue and then adding the first sub-task into the first broadcast queue. The embodiment of the present application can reduce the waiting time of the sub-task, thereby reducing the broadcast delay.

[0015] In an implementation manner, after the first sub-task is added into the second broadcast queue, the method further comprises: if the first broadcast queue is not full, transferring the first sub-task of the first rate mode in the second broadcast queue to the first broadcast queue. The value in the value range of the broadcast period in the first rate mode is smaller than the value in the value range of the broadcast period in the second rate mode; the broadcast period of the sub-task executed in the first broadcast queue is generally smaller than the broadcast period of the sub-task executed in the second broadcast queue; the corresponding broadcast resource of the first sub-task in the first broadcast queue is more than the corresponding broadcast resource of the first sub-task in the second broadcast queue. The embodiment of the present application can timely transfer the first sub-task to the first broadcast queue when the first broadcast queue is idle after the first sub-task is added into the second broadcast queue, so as to facilitate the execution of the first sub-task according to the corresponding broadcast resource in the first broadcast queue in time; in this way, the broadcast delay can be reduced and the broadcast success rate can be improved.

[0016] In an implementation manner, the method further comprises: if the first sub-task is added into the second broadcast queue, the electronic device executes a third sub-task of the second rate mode in the second broadcast queue on the second broadcast channel, the first sub-task interrupts and preoccupies the third sub-task executed on the second broadcast channel. The embodiment of the present application can execute the first sub-task of the first rate mode with higher broadcast priority than the sub-task of the second rate mode; in the same broadcast queue, the first sub-task with higher broadcast priority is preferentially executed.

[0017] In an implementation manner, after the first sub-task interrupts and preoccupies the third sub-task executed on the second broadcast channel, the method further comprises: when the first sub-task on the second broadcast channel ends, the third sub-task interrupted continues to be executed on the second broadcast channel.

[0018] In an implementation manner, the first broadcast task is a broadcast task of the first short-distance wireless communication; when the sub-tasks in the first broadcast queue and the second broadcast queue are respectively scheduled, the method further comprises: limiting the transmission rate of the data packet transmitted by the first short-distance wireless communication. The embodiment of the present application can provide more broadcast resources for broadcast by limiting the transmission rate of the data packet when the sub-tasks are scheduled and executed, thereby reducing the transmission delay of the Bluetooth broadcast and improving the success rate of the Bluetooth broadcast.

[0019] In an implementation manner, the limiting the transmission rate of the data packet using the first short-range wireless communication includes: when the subtask in the first broadcast queue is scheduled, the transmission rate of the data packet is reduced to a first transmission rate; when the subtask in the second broadcast queue is scheduled and the subtask in the first broadcast queue is not scheduled, the transmission rate of the data packet is reduced to a second transmission rate, and the first transmission rate is lower than the second transmission rate. The first transmission rate can be a speed limit gear corresponding to a first speed mode, and the second transmission rate can be a speed limit gear corresponding to a second speed mode. By implementing the embodiment of the application, the smaller the broadcast period is, the higher the demand for broadcast resources is; therefore, the smaller the broadcast period of the executed subtask is, the smaller the speed limit of the data packet is; the broadcast queue of each speed mode corresponds to a transmission rate after speed limit, and the transmission rate of the data packet after speed limit is determined as the minimum value in the transmission rates after speed limit corresponding to the broadcast queue currently scheduled.

[0020] In an implementation manner, before the determining the first subtask corresponding to the first speed mode and the second subtask corresponding to the second speed mode of the first speed mode of the first broadcast task according to the first broadcast type corresponding to the first broadcast task and the first file, the method further includes: obtaining a first broadcast service request; and determining, based on the first broadcast service request, that the broadcast type of the first broadcast task corresponding to the first broadcast service request is the first broadcast type. By implementing the embodiment of the application, the broadcast type can be determined according to the broadcast service request, and then the subtask corresponding to the broadcast task is determined.

[0021] In an implementation manner, the first file indicates a first broadcast period of the first subtask of the first speed mode corresponding to the first broadcast type, and also indicates a value range of the broadcast period in the first speed mode, and the first broadcast service request includes an expected minimum period; when the expected minimum period does not exceed the maximum value of the value range of the broadcast period in the first speed mode, the broadcast period of the first subtask is the maximum value of the first broadcast period and the expected minimum period. By implementing the embodiment of the application, the broadcast period and the value range of the broadcast period are set in the first file, so as to avoid that the expected minimum period of the subtask is too small, that is, to avoid that the subtask occupies too much broadcast resource.

[0022] In an implementation manner, when the expected minimum period exceeds the maximum value of the value range of the broadcast period in the first speed mode, the subtask corresponding to the first broadcast task does not include the subtask of the first speed mode.

[0023] In an implementation manner, the first file indicates a first duration of a first subtask of a first rate mode corresponding to a broadcast task of a first broadcast type, and the first broadcast service request comprises an expected sending duration; the duration of the first subtask is the minimum value of the first duration and the expected sending duration. By implementing the embodiment of the present application, the first file sets the duration, thereby avoiding that the expected sending duration of the subtask is too large, i.e., avoiding that the subtask occupies too many broadcast resources.

[0024] In an implementation manner, the first file further indicates a value range of a broadcast period in each rate mode, and the method further comprises: when the first subtask is added to the second broadcast queue, the broadcast period of the first subtask is modified from the broadcast period of the first subtask in the first rate mode to an initial broadcast period of the second rate mode, and the initial broadcast period of the second rate mode is within the value range of the broadcast period of the second rate mode. In this way, when the first subtask in the second broadcast queue is called subsequently, the first subtask is allocated with broadcast resources matching the second rate mode. When the first subtask in the second broadcast queue is transferred to the first broadcast queue, the broadcast period of the first subtask is modified to the broadcast period of the first subtask in the first rate mode. In this way, when the first subtask in the first broadcast queue is called subsequently, the first subtask is allocated with broadcast resources matching the first rate mode.

[0025] In an implementation manner, the service priority of the first broadcast task is higher than the service priority of the second broadcast task, and the method further comprises: when the second subtask is added to the second broadcast queue, if the electronic device executes a fourth subtask of the second rate mode of the second broadcast task on the second broadcast channel, the second subtask interrupts and preoccupies the fourth subtask executed on the second broadcast channel. By implementing the embodiment of the present application, on the basis that the same broadcast task can map subtasks of multiple rate modes, different service priorities can be set for different broadcast tasks, and multi-dimensional broadcast scheduling can better meet the differentiated needs of different broadcast tasks.

[0026] In an implementation manner, after the second subtask interrupts and preoccupies the fourth subtask executed on the second broadcast channel, the method further comprises: when the second subtask on the second broadcast channel ends, the fourth subtask that is interrupted continues to be executed on the second broadcast channel.

[0027] In an implementation manner, the electronic device supports multiple second broadcast channels, and the second broadcast channel is used to execute a subtask scheduled in the second broadcast queue; when the broadcast task of the first close-range wireless communication of the electronic device only comprises the first broadcast task, the second subtask is executed on the multiple second broadcast channels respectively. By implementing the embodiment of the present application, when there is no multiple broadcast tasks concurrently, the same subtask is executed on the multiple second broadcast channels respectively, which can reduce the broadcast delay and improve the broadcast success rate.

[0028] In an implementation manner, the close-range wireless communication is Bluetooth communication, and the broadcast task is a broadcast task of Bluetooth communication. By implementing the embodiment of the application, when Bluetooth is broadcasted, the broadcast delay can be reduced, the broadcast success rate can be improved, and the overall performance of Bluetooth broadcast can be effectively improved.

[0029] In an implementation manner, the first file indicates a broadcast period of the subtasks corresponding to each broadcast type in the white list; the method further comprises: in a case where a second broadcast type corresponding to a third broadcast task belongs to the white list, determining one or more rate mode subtasks corresponding to the second broadcast task according to the second broadcast type and the first file; and in a case where the second broadcast type does not belong to the white list, determining a minimum rate mode subtask corresponding to the third broadcast task. For example, the minimum rate mode is a rate mode with the minimum broadcast period corresponding to the second broadcast type.

[0030] In an implementation manner, the first broadcast task comprises part or all of the following: a broadcast task identification ID, a subtask corresponding to the first broadcast task, and a current action; the current action indicates a currently executed subtask; the subtask corresponding to the first broadcast task comprises part or all of the following: a broadcast task ID of the first broadcast task, a subtask ID, a current action timer, a broadcast period, and a duration.

[0031] In an implementation manner, the electronic device supports a plurality of first broadcast channels, and the first broadcast channels are used to execute the subtasks in the first broadcast queue; the first broadcast queue comprises a first subtask and a fifth subtask; the above-mentioned execution of the scheduled subtasks in the first broadcast queue on the first broadcast channels comprises: scheduling the first subtask from the first broadcast queue and executing the first subtask on one first broadcast channel; and scheduling the fifth subtask from the first broadcast queue and executing the fifth subtask on another first broadcast channel. By implementing the embodiment of the application, the electronic device can support a plurality of first broadcast channels, and a plurality of subtasks can be scheduled from the first broadcast queue and executed on the plurality of first broadcast channels respectively.

[0032] In an implementation manner, the electronic device supports at most F broadcast channels, and F is a positive integer; when the number of subtasks currently executed by the electronic device reaches F, the subtasks in the broadcast queue of each rate mode wait to be scheduled.

[0033] In a second aspect, embodiments of this application provide an electronic device, the electronic device including: a processor and a memory, the memory being coupled to the processor, the memory being used to store computer program code, the computer program code including computer instructions, wherein when the processor reads the computer instructions from the memory, the electronic device causes the electronic device to perform a short-range wireless communication broadcasting method in any possible implementation of the first aspect.

[0034] Thirdly, embodiments of this application provide a computer storage medium including computer instructions that, when executed on an electronic device, cause a communication device to perform a broadcast method for short-range wireless communication in any of the possible implementations of any of the above aspects.

[0035] Fourthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to execute a short-range wireless communication broadcasting method in any of the possible implementations of any of the above aspects. Attached Figure Description

[0036] Figure 1A is a schematic diagram of the system architecture of a communication system provided in an embodiment of this application;

[0037] Figures 1B and 1C are schematic diagrams of two usage scenarios provided by embodiments of this application;

[0038] Figure 2 is a schematic diagram of the architecture of a software system provided in an embodiment of this application;

[0039] Figure 3 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0040] Figure 4 is a schematic diagram of a broadcast management module provided in an embodiment of this application;

[0041] Figure 5 is a schematic diagram of a broadcast service request, broadcast task, and subtask provided in an embodiment of this application;

[0042] Figure 6 is a schematic diagram of task mapping in a task queue provided in an embodiment of this application;

[0043] Figure 7 is a flowchart illustrating a short-range wireless communication broadcasting method provided in an embodiment of this application;

[0044] Figures 8A to 8D are schematic diagrams illustrating the changes in a broadcast queue provided in an embodiment of this application;

[0045] Figure 9 is a schematic diagram of executing subtasks on various broadcast channels according to an embodiment of this application;

[0046] Figure 10 is a flowchart illustrating a short-range wireless communication broadcasting method provided in an embodiment of this application. DETAILED DESCRIPTION

[0047] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " represents the meaning of or, for example, A / B can represent A or B; the "and / or" in the text only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0048] Hereinafter, the terms "first" and "second" are only used for description purposes, and cannot be understood as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more features, and in the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two.

[0049] Due to the limited resources of the broadcast channel of the short-range wireless communication technology (such as BLE), the processing capacity of the hardware / chip of part of the electronic device is limited, when multiple services are concurrently broadcasted (for example, BLE broadcast), resource congestion, chip busy, packet loss, high broadcast transceiver delay, and low success rate may occur.

[0050] In a broadcast method of short-range wireless communication, the broadcast concurrency capability of the hardware / chip of the electronic device is continuously enhanced, the broadcast bandwidth of the short-range wireless communication is improved, the broadcast delay is reduced, and the broadcast success rate is improved. However, this method has the following problems: frequent hardware updates greatly increase the cost of the device, and the hardware of the commercially available electronic device cannot be updated.

[0051] In another broadcast method of short-range wireless communication, the electronic device identifies the service priority of the service, and then preoccupies the broadcast resource based on the service priority, that is, the broadcast task is scheduled according to the service priority from high to low. However, this method has the following problems: if there is a high-priority and long-duration broadcast task in execution, other broadcast tasks with the same high priority may not be scheduled for a long time.

[0052] In another broadcast method of short-range wireless communication, the electronic device periodically alternately executes different broadcast tasks by time division multiplexing. However, this method has the following problems: in the case of many concurrent services, time division multiplexing will greatly increase the broadcast delay, which will seriously affect the services with high delay requirements.

[0053] The embodiment of the present application provides a broadcasting method of close-range wireless communication, which can further map a broadcasting task into sub-tasks of different rate modes according to a broadcasting type, and then add the sub-tasks of each rate mode into a broadcasting queue of the corresponding rate mode; then, the sub-tasks in the broadcasting queue of each rate mode are called respectively, and the sub-tasks in the broadcasting queue of the rate mode are executed on a broadcasting channel corresponding to the rate mode. In this way, in the case of concurrent broadcasting tasks (for example, Bluetooth broadcasting) of close-range wireless communication, broadcasting congestion can be prevented, the same broadcasting task can be prevented from continuously occupying broadcasting resources, the utilization rate of broadcasting resources can be improved, the broadcasting delay can be reduced, the success rate of broadcasting can be improved, and the overall performance of broadcasting of close-range wireless communication can be effectively improved. The broadcasting method of close-range wireless communication is described in detail below.

[0054] First, the communication system 10 related to the broadcasting method of close-range wireless communication provided by the embodiment of the present application is introduced.

[0055] FIG. 1A exemplarily shows the system architecture of the communication system 10 provided in the embodiment of the present application. As shown in FIG. 1A, the communication system 10 includes at least one broadcasting sending end (for example, an electronic device 100) and at least one broadcasting receiving end (for example, an electronic device 200 and an electronic device 300), the broadcasting sending end can send a broadcast by using close-range wireless communication technology 1, and the broadcasting receiving end can scan and receive the broadcast by using close-range wireless communication technology 1.

[0056] The close-range wireless communication technology 1 can be WiFi communication technology, Bluetooth communication (for example, classic Bluetooth (Basic Rate / Enhanced Date Rate, BR / EDR) or Bluetooth Low Energy (BLE)) technology, Ultra Wide Band (UWB) communication technology, Near Field Communication (NFC) technology or ZigBee communication technology, and the like, which is not limited in the embodiment of the present application. The broadcasting service related to the subsequent embodiment can be a broadcasting service of any close-range wireless communication technology, for example, a Bluetooth broadcasting service. The subsequent embodiment will be exemplarily described by taking the close-range wireless communication technology 1 as Bluetooth communication.

[0057] In some embodiments, the electronic device 200 and the electronic device 300 can also send Bluetooth broadcasting as the broadcasting sending end, and the electronic device 100 can also receive Bluetooth broadcasting as the broadcasting receiving end.

[0058] In some embodiments, the broadcast sending end and the broadcast receiving end can each include a Bluetooth broadcast service (which can also be referred to as a Bluetooth broadcast service), a broadcast management module for dynamically managing and scheduling the Bluetooth broadcast, and a Bluetooth communication module for supporting the electronic device to transmit the Bluetooth broadcast. The Bluetooth communication module can include part or all of the BLE-related protocol stack, hardware, and chips. Among them, in the broadcast receiving end, the broadcast management module is optional.

[0059] For example, the electronic device 100 includes Bluetooth broadcast service 1 to Bluetooth broadcast service F. When multiple Bluetooth broadcast services are concurrent, the broadcast management module of the electronic device 100 can manage and schedule the Bluetooth broadcast between devices in the communication system 10, effectively improve the success rate of Bluetooth broadcast, and reduce the Bluetooth broadcast delay in the multi-service concurrent Bluetooth broadcast scenario.

[0060] The above-mentioned broadcast sending end and broadcast receiving end can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device (such as a smart bracelet), a vehicle-mounted device, a smart home device (such as a smart TV, a smart screen, a large screen device, etc.), a smart city device, and / or any device that can communicate using Bluetooth. The device types of the broadcast sending end and the broadcast receiving end can be the same or different. The specific type of the broadcast sending end and the broadcast receiving end is not specially limited in the embodiments of the present application.

[0061] It should be understood that FIG. 1A is only a schematic diagram of the system structure of the communication system provided by the embodiments of the present application, and does not constitute a specific limitation on the communication system 10. The communication system 10 can include more or fewer devices than illustrated.

[0062] In the embodiments of the present application, the use scenario of the communication system 10 is a Bluetooth broadcast service scenario in which a user implements Bluetooth broadcast through multiple devices, including but not limited to: a cross-device distributed scenario (such as a wireless screen projection, file sharing, multi-screen collaboration, application connection, etc.), an audio call scenario, an audio playback scenario, a device-to-device speed measurement, distance measurement, heartbeat keep-alive, clipboard, etc.

[0063] For example, FIG. 1B shows a schematic diagram of a use scenario of the communication system 10. As shown in FIG. 1B, the mobile phone communicates with the surrounding tablet, TV and PC respectively through Bluetooth broadcast to realize functions such as file sharing, wireless projection or multi-screen collaboration. In an implementation, the mobile phone can send a probe signal through Bluetooth broadcast to probe the nearby electronic devices (for example, the tablet, the TV or the PC), or send a response signal through Bluetooth broadcast to respond to the probe signal from the nearby electronic devices (for example, the tablet, the TV or the PC), so that the mobile phone can discover the nearby electronic devices through the BLE wireless communication protocol, establish a BLE connection with the nearby electronic devices, and transmit data to the nearby electronic devices, thereby realizing functions such as file sharing, wireless projection or multi-screen collaboration.

[0064] For example, FIG. 1C shows another schematic diagram of a use scenario of the communication system 10. As shown in FIG. 1C, the user carries the mobile phone in the vehicle, and the mobile phone of the user communicates with the Bluetooth headset and the smart watch respectively through Bluetooth broadcast to realize functions such as audio playing and file sharing; meanwhile, the vehicle-mounted device communicates with the mobile phone of the user and the Bluetooth headset respectively through Bluetooth broadcast to realize functions such as audio playing and file sharing. It can be understood that in the use scenario shown in FIG. 1C, the mobile phone can act as both a broadcast sending end and a broadcast receiving end.

[0065] In the embodiments of the present application, the software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture or a cloud architecture. The embodiments of the present application take the Android system with a layered architecture as an example to exemplarily illustrate the software structure of the electronic device 100.

[0066] Referring to FIG. 2, FIG. 2 shows a software structure block diagram of an electronic device exemplarily provided in the embodiments of the present application. The electronic device 100 can map one broadcast task into subtasks in different rate modes, and the broadcast queues in different rate modes are respectively scheduled and executed; in this way, broadcast congestion can be prevented, the same broadcast task can be prevented from continuously occupying broadcast resources, the utilization rate of broadcast resources can be improved, thereby effectively reducing the broadcast delay and improving the broadcast success rate.

[0067] As shown in FIG. 2, the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system can be divided into an application layer, an application framework layer, a system library, a hardware abstraction layer (HAL) layer and a kernel layer from top to bottom. Among them:

[0068] The application layer includes a series of application packages, such as a call application, a music application, a screen projection application, and the like. A plurality of broadcast services of the applications in the application layer can concurrently broadcast a short-range wireless communication, such as Bluetooth broadcast service 1 to Bluetooth broadcast service F.

[0069] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The API is used to implement communication between the application layer and the protocol stack, the HAL layer, and the kernel layer. The application framework layer includes some pre-defined functions.

[0070] As shown in FIG. 2, the application framework layer can mainly include a system service (System Server). The system service is a background service component in the Android operating system, which is used to provide access to system resources and functions. Common system services include an activity manager (ActivityManager), a window manager (WindowManager), a package manager (PackageManager), and the like. In the embodiment of the present application, the system service (System Server) can also include a broadcast management module, which is used to dynamically control and schedule Bluetooth broadcasts.

[0071] The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application layer and the application framework layer into binary files. The virtual machine is used to perform functions such as management of object life cycle, stack management, thread management, security and exception management, and garbage collection.

[0072] The system library is a support for the application framework layer, and is a link between the application framework layer and the kernel layer. The system library can include a plurality of functional modules, such as a Bluetooth protocol stack.

[0073] The HAL layer and the kernel layer are used to respond to functions called by the system service in the application framework layer, and perform corresponding operations. The kernel layer is a layer between hardware and software. The kernel layer can include a Bluetooth chip driver, and can also include an audio driver, a sensor driver, and the like. The Bluetooth chip driver can drive the Bluetooth chip to send a Bluetooth broadcast.

[0074] The structure of an electronic device 100 provided in an embodiment of the present application is described below. The structures of electronic devices 200 and 300 can refer to the related descriptions of the electronic device 100, and will not be described again.

[0075] Exemplarily, FIG. 3 shows a structural schematic diagram of the electronic device 100. The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (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 loudspeaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, and the like. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.

[0076] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0077] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), and the like. Different processing units can be independent devices, or can be integrated in one or more processors.

[0078] The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching instructions and executing instructions.

[0079] The processor 110 can also include a memory that stores instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The cache memory can hold instructions or data that the processor 110 has recently used or is likely to use again. If the processor 110 needs to use the instructions or data again, it can be retrieved directly from the cache memory. This avoids repeated accesses to the main memory, reducing the latency of the processor 110 and thus improving the efficiency of the system.

[0080] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0081] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 can include multiple sets of I2C buses. The processor 110 can be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example, the processor 110 can be coupled to the touch sensor 180K through an I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface and implement the touch function of the electronic device 100.

[0082] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple sets of I2S buses. The processor 110 can be coupled to the audio module 170 through the I2S bus, enabling communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the I2S interface, enabling the function of answering a phone call through a Bluetooth headset.

[0083] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 can be coupled with the wireless communication module 160 through a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 through the PCM interface, realizing the function of answering a phone call through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0084] The UART interface is a general-purpose serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is usually used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface, realizing the Bluetooth function. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 through the UART interface, realizing the function of playing music through a Bluetooth headset.

[0085] The MIPI interface can be used to connect the processor 110 and peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes the camera serial interface (CSI), the display screen serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface, realizing the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface, realizing the display function of the electronic device 100.

[0086] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 and the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0087] The USB interface 130 is an interface that conforms to the USB standard specification, which can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0088] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a limitation on the structure of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection modes or a combination of multiple interface connection modes in the above embodiments.

[0089] The charging management module 140 is configured to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 can charge the battery 142 and also supply power to the electronic device through the power management module 141.

[0090] The power management module 141 is configured to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to supply power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be configured to monitor parameters such as battery capacity, battery cycle count, battery health status (leakage, impedance), and the like. In some other embodiments, the power management module 141 can also be arranged in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be arranged in the same device.

[0091] The wireless communication function of the electronic device 100 can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, and the like.

[0092] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0093] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transfer to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor, and radiate as electromagnetic waves through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the same device as at least part of the modules of the processor 110.

[0094] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a 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. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the microphone 170B, etc.), or displays an image or a video through the display screen 194. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110, and disposed in the same device as the mobile communication module 150 or other functional modules.

[0095] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, demodulates and filters the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, frequency-modulate it, amplify it, and radiate it as an electromagnetic wave via the antenna 2.

[0096] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).

[0097] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.

[0098] The display screen 194 is configured to display images, videos, and the like. The 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 flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diodes (QLED), or the like. In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.

[0099] The electronic device 100 can implement the photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor.

[0100] The ISP is configured to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing to convert it into an image visible to the naked eye. The ISP can also algorithmically optimize the noise and brightness of the image. The ISP can also optimize the exposure, color temperature, and other parameters of the shooting scene. In some embodiments, the ISP can be disposed in the camera 193.

[0101] The camera 193 is configured to capture still images or videos. An object generates an optical image through a lens and projects it onto a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device 100 can include one or N cameras 193, where N is a positive integer greater than 1.

[0102] The digital signal processor is used to process digital signals, in addition to being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 is in frequency point selection, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0103] The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0104] The NPU is a neural-network (NN) computing processor, which can quickly process input information by drawing on the structure of a biological neural network, such as drawing on the transmission mode between human brain neurons, and can also constantly self-learn. Through the NPU, the electronic device 100 can realize intelligent cognitive applications, such as: image recognition, face recognition, voice recognition, text understanding, etc.

[0105] The internal memory 121 can include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs).

[0106] The random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, such as the fifth generation DDR SDRAM commonly referred to as DDR5 SDRAM), etc.; the non-volatile memory can include a magnetic disk storage device, a flash memory.

[0107] According to the operation principle, the flash memory can include NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. According to the potential order of the storage unit, the flash memory can include single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. According to the storage specification, the flash memory can include universal flash storage (UFS), embedded multi media Card (eMMC), etc.

[0108] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of an operating system or other programs running, and can also be used to store data of users and application programs, etc.

[0109] The non-volatile memory can also store executable programs and store data of users and application programs, etc., and can be loaded into the random access memory in advance for direct reading and writing by the processor 110.

[0110] The external memory interface 120 can be used to connect an external non-volatile memory, to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, files such as music and video are saved in the external non-volatile memory.

[0111] The electronic device 100 can realize audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.

[0112] The audio module 170 is used to convert digital audio information into analog audio signals, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals.

[0113] The speaker 170A, also known as a "loudspeaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0114] The receiver 170B, also known as a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a call or a voice message, the receiver 170B can be held close to the ear to listen to the voice.

[0115] The microphone 170C, also referred to as a "microphone", "microphone", is used to convert a sound signal into an electrical signal. When making a call or sending a voice message, a user can make a sound by approaching the microphone 170C with his mouth, and input a sound signal to the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C.

[0116] The earphone interface 170D is used to connect a wired earphone.

[0117] The pressure sensor 180A is used to sense a pressure signal, and can convert the pressure signal into an electrical signal.

[0118] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B.

[0119] The barometric sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude, assists positioning and navigation by the air pressure value measured by the barometric sensor 180C.

[0120] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can detect the opening and closing of a flip cover with the magnetic sensor 180D.

[0121] The acceleration sensor 180E can detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes).

[0122] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance by infrared or laser.

[0123] The proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode can be an infrared light emitting diode.

[0124] The ambient light sensor 180L is used to sense ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display 194 according to the sensed ambient light brightness.

[0125] The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locking, fingerprint photographing, fingerprint answering, and the like.

[0126] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 performs a temperature handling strategy using the temperature detected by the temperature sensor 180J.

[0127] The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it.

[0128] The bone conduction sensor 180M can obtain a vibration signal.

[0129] The keys 190 include a power-on key, a volume key, and the like. The electronic device 100 can receive a key input and generate a key signal input related to user settings and function control of the electronic device 100.

[0130] The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts and also for touch vibration feedback.

[0131] The indicator 192 can be an indicator light and can be used to indicate a charging state, a power change message, a missed call, a notification, and the like.

[0132] The SIM card interface 195 is used to connect a SIM card.

[0133] In some embodiments, as shown in FIGS. 2 and 4, the above-mentioned broadcast management module can specifically include a broadcast identification module, a broadcast scheduling module, a broadcast coordination module, and a broadcast execution module. In the embodiments of the present application, the electronic device 100 sets multiple rate modes of Bluetooth broadcast, and each rate mode corresponds to a broadcast priority.

[0134] The broadcast identification module is configured to perform entry control on a broadcast service request, identify a broadcast type corresponding to the broadcast service request, map a broadcast task corresponding to the broadcast service request to a subtask of one or more rate modes according to the identified broadcast type and a broadcast strategy configuration file, and control broadcast parameters (such as a continuous time length, a broadcast period, etc.) of the broadcast task in different rate modes. In the subtasks of the same broadcast task, the subtask in the rate mode with a higher broadcast priority has a smaller broadcast period, that is, more broadcast resources are allocated in a unit of time, and the transmission rate is higher.

[0135] The above-mentioned broadcast strategy configuration file indicates the broadcast parameters of the subtasks of each rate mode mapped by each broadcast type corresponding to the broadcast task. For ease of description, the broadcast task can also be referred to as a task.

[0136] The broadcast scheduling module is configured to manage a task queue of broadcast tasks, map each subtask of each broadcast task in the task queue to a corresponding broadcast queue of a rate mode, and dynamically schedule the subtasks in the broadcast queues of the rate modes. In this way, the same broadcast task can be scheduled in different rate modes, and a subtask with a high broadcast priority can preempt a subtask with a low broadcast priority. The broadcast scheduling module can also schedule a timer to time the duration of a task or a subtask.

[0137] The broadcast execution module is configured to execute the subtasks scheduled by the broadcast scheduling module, and implement actual processing of Bluetooth broadcast.

[0138] In some embodiments, as shown in FIG. 2 and FIG. 4, the broadcast management module can further include a broadcast coordination module.

[0139] The broadcast scheduling module is further configured to determine whether to instruct the broadcast coordination module to start coordination based on the currently scheduled subtask.

[0140] The broadcast coordination module is configured to limit the transmission rate of a Bluetooth data packet to increase the broadcast resource of Bluetooth broadcast when coordination is started.

[0141] It should be noted that the division of the modules in the embodiments of the present application is exemplary, and is only a logical function division. Another division manner can be used in actual implementation.

[0142] Referring to FIG. 2, the embodiment of the present application provides a broadcasting method of close-range wireless communication, comprising: a broadcasting identification module can receive a broadcasting service request from a Bluetooth broadcasting service; the broadcasting identification module can identify a broadcasting type corresponding to the broadcasting service request, and map a broadcasting task corresponding to the broadcasting service request into one or more sub-tasks of rate modes based on the broadcasting type and a broadcasting strategy configuration file; a broadcasting scheduling module can obtain the broadcasting task from the broadcasting identification module, and add the broadcasting task into a task queue, the broadcasting task comprising the mapped sub-tasks; the broadcasting scheduling module can also add each sub-task into a broadcasting queue of a corresponding rate mode, and schedule the sub-tasks in the broadcasting queue of each rate mode respectively; the broadcasting scheduling module can send indication information to a broadcasting execution module to instruct the broadcasting execution module to execute a currently scheduled sub-task; based on the indication information, the broadcasting execution module executes the currently scheduled sub-task in the broadcasting queue of the rate mode on a broadcasting channel of the rate mode. By implementing the embodiment of the present application, the broadcasting parameters of the same broadcasting task are different in different rate modes, and the electronic device 100 can control the same broadcasting task to be scheduled and executed in different rate modes respectively; in this way, when multiple broadcasting tasks are concurrent, broadcasting congestion can be prevented, the same broadcasting task can be prevented from continuously occupying broadcasting resources, the utilization rate of broadcasting resources can be improved, the broadcasting delay can be reduced, the broadcasting success rate can be improved, and thus the overall performance of Bluetooth broadcasting can be effectively improved.

[0143] In some embodiments, the method further comprises: the broadcasting scheduling module determines whether to start / cancel the cooperation; if it is determined to start the cooperation, the broadcasting scheduling module instructs the broadcasting cooperation module to limit the transmission rate of the Bluetooth data packet; if it is determined to cancel the cooperation in the case that the cooperation has been started, the broadcasting scheduling module instructs the broadcasting cooperation module to cancel the limitation on the transmission rate of the Bluetooth data packet. By implementing the embodiment of the present application, when Bluetooth broadcasting is performed, the transmission rate of the Bluetooth data packet can be limited to allocate more broadcasting resources to Bluetooth broadcasting, so as to reduce the broadcasting delay and improve the broadcasting success rate.

[0144] In the following, Bluetooth broadcasting service is taken as an example to introduce how to map the sub-tasks corresponding to the broadcasting task corresponding to the broadcasting service request.

[0145] In the embodiment of the present application, the broadcasting service request sent by the Bluetooth broadcasting service is used to request to perform Bluetooth broadcasting; the broadcasting identification module can identify the broadcasting type of the Bluetooth broadcasting according to the broadcasting service request, and determine the one or more sub-tasks of rate modes mapped by the broadcasting task corresponding to the broadcasting service request according to the broadcasting type. For example, FIG. 5 shows a broadcasting service request, a broadcasting task corresponding to the broadcasting service request, and sub-tasks mapped by the broadcasting task. For ease of description, in the embodiment of the present application, the sub-tasks mapped by the broadcasting task can also be referred to as the sub-tasks corresponding to the broadcasting task.

[0146] In some embodiments, as shown in FIG. 5, the broadcast service request 1 can include the following parts or all of the following contents: an application ID, a broadcast type ID, an expected transmission duration, an expected minimum period, broadcast IND data, broadcast RSP data, and action indication information. The application ID indicates the application that sends the broadcast service request 1, and the broadcast type ID indicates the broadcast type of the Bluetooth broadcast. The expected transmission duration indicates the duration of the Bluetooth broadcast expected by the Bluetooth broadcast service. The expected minimum period indicates the minimum broadcast period of the Bluetooth broadcast expected by the Bluetooth broadcast service. The broadcast IND data can include the broadcast packet of the Bluetooth broadcast. The broadcast RSP data includes the scan response data of the Bluetooth broadcast. The action indication information is used to indicate the action category of the Bluetooth broadcast, which can be starting broadcast, stopping broadcast, or updating broadcast content.

[0147] In some embodiments, the broadcast service request 1 includes a broadcast type ID, and the broadcast identification module determines the broadcast type corresponding to the broadcast service request 1 according to the broadcast type ID.

[0148] Without being limited to the broadcast type ID, the embodiments of the present application can also identify the broadcast type corresponding to the broadcast service request through other manners. For example, the broadcast service request includes an application ID of an application, and the electronic device 100 stores a corresponding relationship between the application ID and the broadcast type. The electronic device 100 can determine the broadcast type corresponding to the broadcast service request according to the application ID and the above-mentioned corresponding relationship.

[0149] In the embodiments of the present application, the broadcast identification module can determine the sub-tasks corresponding to the broadcast task of the broadcast type according to the identified broadcast type and the broadcast strategy configuration file.

[0150] The broadcast strategy configuration file indicates a plurality of rate modes that can be mapped by the broadcast task, the value range of the broadcast period in each rate mode, and the strategy corresponding to each broadcast type. The strategy of each broadcast type specifically indicates the broadcast parameters of the sub-tasks of one or more rate modes mapped by the broadcast task corresponding to the broadcast type. The above-mentioned broadcast parameters can include the duration and / or the broadcast period.

[0151] For example, the embodiments of the present application can provide X rate modes, which in sequence include a first-level rate mode, a second-level rate mode, …, and an X-level rate mode. Each rate mode can correspond to a broadcast priority. In the plurality of rate modes corresponding to the same broadcast type, the rate mode with a higher broadcast priority has a smaller broadcast period of the Bluetooth broadcast, that is, a larger Bluetooth broadcast resource allocated in a unit of time, and a higher transmission rate of the corresponding Bluetooth broadcast. It can be understood that the strategy of the broadcast type can also be referred to as the priority strategy of the broadcast type. X is a positive integer greater than 1, and the embodiments of the present application do not specifically limit the value of X. For example, X is equal to 2, X is equal to 3, or X is a positive integer greater than 3.

[0152] In an implementation manner, the X rate modes correspond to X broadcast priorities one by one. In an implementation manner, one or more of the X rate modes can correspond to one broadcast priority.

[0153] In some embodiments, the higher the broadcast priority of the rate mode in the plurality of rate modes, the shorter the duration of the Bluetooth broadcast. In this way, the subtask with high broadcast priority can be prevented from occupying too many broadcast resources for a long time. In the embodiments of the present application, the size relationship of the duration in each rate mode is not specifically limited; for example, the duration of the rate mode with different broadcast priorities can also be the same, and the duration of the rate mode with higher broadcast priority can also be longer.

[0154] In the embodiments of the present application, the broadcast periods of different broadcast types in the same rate mode can be different or the same, and the duration of different broadcast types in the same rate mode can be different or the same, which is not specifically limited here.

[0155] It should be noted that the broadcast content of the Bluetooth broadcast requested by the subtask in different rate modes of the same broadcast task is the same; different broadcast parameters are set for the subtask in different rate modes to allocate different broadcast resources.

[0156] For example, the broadcast strategy configuration file can be the broadcast strategy configuration table shown in Table 1. In subsequent embodiments, Table 1 is mainly taken as an example to exemplarily describe the broadcast strategy configuration file.

[0157] Table 1

[0158] The broadcast strategy configuration table shown in Table 1 specifically indicates that the rate modes that can be mapped include a high-speed mode, a medium-speed mode and a low-speed mode, and the order from high to low is the high-speed mode, the medium-speed mode and the low-speed mode according to the broadcast priority; the broadcast strategy configuration table also indicates the value range of the broadcast period in each rate mode, and the value in the value range of the broadcast period corresponding to the rate mode with higher broadcast priority is smaller, for example, the value range of the high-speed mode is 20ms to 30ms, the value range of the medium-speed mode is 40ms to 50ms, and the value range of the low-speed mode is 60ms to 200ms; the broadcast strategy configuration table also indicates the priority strategy corresponding to each broadcast type (for example, broadcast type A to broadcast type H). Optionally, for the broadcast period and the duration in each rate mode of the same broadcast type, the high-speed mode is smaller than the medium-speed mode, and the medium-speed mode is smaller than the low-speed mode. The duration of the low-speed mode can also be "long-term background residence". In the embodiments of the present application, the value range of the broadcast period and the value range of the duration in each rate mode are not specifically limited.

[0159] Referring to Table 1, a broadcast task can be mapped to only one subtask of a rate mode. For example, the priority policy of broadcast type A indicates that the broadcast task corresponding to the broadcast type A can be mapped to only a subtask of the high-speed mode, and the subtask has a broadcast period of 20 ms (i.e., 50 Bluetooth broadcasts can be sent in 1 s) and a duration of 5 s. For example, the priority policy of broadcast type H indicates that the broadcast task corresponding to the broadcast type H can be mapped to only a subtask of the low-speed mode, and the subtask has a broadcast period of 180 ms (i.e., only 5 Bluetooth broadcasts can be sent in 1 s) and a duration of "long-term background stay". A broadcast task can also be mapped to subtasks of two rate modes. For example, the priority policy of broadcast type E indicates that the broadcast task corresponding to the broadcast type E can be mapped to a subtask of the high-speed mode and a subtask of the low-speed mode; the subtask of the high-speed mode has a broadcast period of 30 ms and a duration of 5 s, and the subtask of the low-speed mode has a broadcast period of 60 ms and a duration of 55 s. A broadcast task can also be mapped to subtasks of each rate mode. For example, the priority policy of broadcast type G indicates that the broadcast task corresponding to the broadcast type G can be mapped to a subtask of the high-speed mode, a subtask of the medium-speed mode, and a subtask of the low-speed mode; the subtask of the high-speed mode has a broadcast period of 20 ms and a duration of 2 s, the subtask of the medium-speed mode has a broadcast period of 40 ms and a duration of 8 s, and the subtask of the low-speed mode has a broadcast period of 80 ms and a duration of 50 s.

[0160] It should be noted that the present embodiment does not make a specific limitation on how to divide the broadcast types of broadcasts, and the electronic device 100 can divide the broadcast types according to actual needs, or can define the broadcast types based on broadcast services. For example, the broadcast types of Bluetooth broadcasts are divided according to specific functions of the Bluetooth broadcasts and Bluetooth broadcast services corresponding to the Bluetooth broadcasts. The present application will be described below in combination with examples.

[0161] In some embodiments, different broadcast service requests of the same Bluetooth broadcast service can correspond to different broadcast types, and broadcast service requests of different Bluetooth broadcast services can also correspond to the same broadcast type.

[0162] For example, the Bluetooth broadcast service is a wireless projection service. The wireless projection service of the electronic device 100 can request to send a probe broadcast 1, which is used to probe a receiving end device that can perform wireless projection in the vicinity. When a probe broadcast for projection sent by a device in the vicinity is scanned, the wireless projection service of the electronic device 100 can also request to send a Bluetooth response broadcast 1 to respond to the probe broadcast, so as to establish a Bluetooth communication connection with the device in the vicinity.

[0163] In an implementation, the probe broadcast 1 and the response broadcast 1 of the wireless projection service can correspond to different broadcast types. For example, the probe broadcast 1 is actively sent by the electronic device 100, and for fast probing of nearby devices, the broadcast task corresponding to the broadcast type of the probe broadcast 1 can be mapped to only the sub-tasks of the high-speed mode; the response broadcast 1 is passively responded by the electronic device 100, and the broadcast task corresponding to the broadcast type of the response broadcast 2 can be mapped to the sub-tasks of the medium-speed mode and the low-speed mode.

[0164] In another implementation, the probe broadcast 1 and the response broadcast 1 of the wireless projection service can correspond to the same broadcast type. For example, the broadcast task corresponding to the broadcast type can be mapped to the sub-tasks of the high-speed mode and the medium-speed mode.

[0165] For example, the Bluetooth broadcast service is a file sharing service. The file sharing service of the electronic device 100 can request to send the probe broadcast 2, which is used to probe nearby receiving end devices that can perform file sharing.

[0166] In an implementation, the probe broadcast 1 and the probe broadcast 2 can correspond to the same broadcast type. It can be understood that the probe broadcast 1 and the probe broadcast 2 have the same function, and are both used to probe nearby receiving end devices.

[0167] In an implementation, the probe broadcast 1 of the wireless projection service and the probe broadcast 2 of the file sharing service can correspond to different broadcast types, for example, broadcast type 1 and broadcast type 2 respectively. It can be understood that the probe broadcast 1 and the probe broadcast 2 have the same function, but different Bluetooth broadcast services have different requirements for broadcast parameters of the probe broadcast, so they can be divided into different broadcast types. Optionally, the broadcast tasks corresponding to the broadcast type 1 and the broadcast type 2 are mapped to the sub-tasks of the same speed mode, but different broadcast parameters are set for the sub-tasks of the same speed mode of the two broadcast types. For example, the broadcast tasks corresponding to the broadcast type 1 and the broadcast type 2 can both be mapped to the sub-tasks of the high-speed mode, but the broadcast parameters of the high-speed mode of the broadcast type 1 are different from the broadcast parameters of the high-speed mode of the broadcast type 2.

[0168] For example, the Bluetooth broadcast service is a ranging service. The ranging service of the electronic device 100 can request to send a Bluetooth broadcast, which can be used to measure the distance between the electronic device 100 and the receiving end device of the Bluetooth broadcast. For example, the service duration of the ranging service is longer, and the time delay requirement is higher, so the broadcast task corresponding to the broadcast type of the Bluetooth broadcast described above can be mapped to the sub-tasks of the high-speed mode, the medium-speed mode and the low-speed mode.

[0169] Exemplarily, the Bluetooth broadcast service is an application connection service. The application connection service of the electronic device 100 can request to send a Bluetooth broadcast, which can be used to carry an event of application connection; for example, the event is that a user opens a browser, and a receiving end device of the Bluetooth broadcast can display an icon of the browser based on the event. For example, a broadcast task corresponding to a broadcast type of the Bluetooth broadcast can be mapped into a sub-task of the high-speed mode and a sub-task of the medium-speed mode.

[0170] Exemplarily, the Bluetooth broadcast service is a clipboard service. The clipboard service of the electronic device 100 can request to send a Bluetooth broadcast, which can be used to carry content copied or cut by a user; a receiving end device of the Bluetooth broadcast can paste the content in a document. For example, a broadcast task corresponding to a broadcast type of the Bluetooth broadcast can be mapped into only a sub-task of the high-speed mode.

[0171] Exemplarily, the Bluetooth broadcast service is a heartbeat service. The heartbeat service of the electronic device 100 can also request to send a Bluetooth broadcast, which includes a heartbeat signal; a receiving end device networked with the electronic device 100 can respond to the Bluetooth broadcast and keep online in the network. For example, the heartbeat service is a background operation service, and a broadcast task corresponding to a broadcast type of the Bluetooth broadcast can be mapped into only a sub-task of the low-speed mode.

[0172] In the embodiment of the application, the broadcast identification module determines a sub-task mapped by the broadcast task 1 corresponding to the broadcast service request 1 according to the broadcast type; then, the broadcast task 1 can be generated according to the broadcast service request 1 and the mapped sub-task, and the broadcast task 1 is added to a task queue of the Bluetooth broadcast; the broadcast task 1 can include the mapped sub-task.

[0173] Exemplarily, FIG. 5 shows specific content of a broadcast task and specific content of a sub-task, and FIG. 6 shows a task queue of a Bluetooth broadcast and sub-tasks mapped by broadcast tasks in the task queue. For example, the task 1 is mapped into only a sub-task of the medium-speed mode, and the task 2 is mapped into a sub-task of the high-speed mode and a sub-task of the medium-speed mode.

[0174] Referring to FIG. 5, the broadcast task 1 corresponding to the broadcast service request 1 can include some or all of the following data: a broadcast task ID, task information of a mapped subtask, broadcast working parameters, a current action, and an action timer. The broadcast working parameters can include some or all of the following data: broadcast IND data and broadcast RSP data. The current action indicates a subtask that the broadcast task 1 is currently performing. The action timer is used to time the duration of the broadcast task 1. When the timing reaches the total duration of the broadcast task 1, the broadcast task 1 ends and is deleted from the task queue. The total duration is equal to the sum of the durations of the subtasks. Each of the subtasks can include some or all of the following data: a broadcast task ID, a subtask ID, a broadcast period, a duration, broadcast IND data, broadcast RSP data, and a current action timer. The current action timer is used to time the duration of the subtask. When the timing reaches the duration of the subtask, the subtask ends and is deleted from the broadcast queue of the subtask.

[0175] In an implementation, indexes of the one or more subtasks mapped from the broadcast task 1 are determined, and the subtask ID is the index of the subtask. For example, the indexes of the high-speed subtask, the medium-speed subtask, and the low-speed subtask are numbered as 1, 2, and 3, respectively.

[0176] In some embodiments, the broadcast service request 1 includes a desired transmission duration of the broadcast service 1. The duration of each rate mode subtask mapped from the broadcast task 1 is set to the minimum value of the duration of the rate mode in Table 1 and the desired transmission duration, so as to avoid wasting broadcast resources.

[0177] In some embodiments, the broadcast service request 1 includes a desired minimum period. Table 1 indicates that the subtask of the broadcast task 1 includes a subtask of rate mode 1. If the desired minimum period does not exceed the maximum value of the broadcast period of rate mode 1, the broadcast period of the subtask of rate mode 1 is set to the maximum value of the broadcast period of rate mode in Table 1 and the desired minimum period. If the desired minimum period exceeds the maximum value of the broadcast period of rate mode 1, the broadcast task 1 is not mapped to the subtask of rate mode 1, or the broadcast period of the subtask of rate mode 1 is set to the initial broadcast period of rate mode 1, which is within the value range of the broadcast period of rate mode 1 in Table 1.

[0178] For example, the broadcast type corresponding to the broadcast service request 1 is the broadcast type E shown in Table 1, and the expected minimum period carried by the broadcast service request 1 is 20 ms. Referring to Table 1, the broadcast task of the broadcast type E can be mapped into a high-speed subtask and a low-speed subtask. Since 20 ms does not exceed the maximum value (i.e., 30 ms) of the value range of the broadcast period of the high-speed mode, the broadcast task 1 can be mapped into the high-speed subtask and the low-speed subtask, and the broadcast period of the high-speed subtask is the maximum value of the expected minimum period (i.e., 20 ms) and the broadcast period (i.e., 30 ms) of the high-speed mode shown in Table 1, and the broadcast period of the low-speed subtask is the maximum value of the expected minimum period (i.e., 20 ms) and the broadcast period (i.e., 60 ms) of the low-speed mode shown in Table 1.

[0179] For example, the broadcast type corresponding to the broadcast service request 1 is the broadcast type E shown in Table 1, and the expected minimum period carried by the broadcast service request 1 is 50 ms. The broadcast task of the broadcast type E shown in Table 1 can be mapped into a high-speed subtask and a low-speed subtask. Since the expected minimum period (i.e., 50 ms) exceeds the maximum value (i.e., 30 ms) of the value range of the broadcast period of the high-speed mode, does not exceed the maximum value (i.e., 60 ms) of the value range of the broadcast period of the low-speed mode, the broadcast task 1 is only mapped into the low-speed subtask, and the broadcast period of the low-speed subtask is the maximum value of the expected minimum period (i.e., 50 ms) and the broadcast period (i.e., 60 ms) shown in Table 1.

[0180] In the embodiments of the application, the broadcast scheduling module can add the mapped subtasks of each rate mode into the broadcast queue of the corresponding rate mode according to the preset queuing rule. The broadcast scheduling module can schedule the subtasks in the broadcast queue of each rate mode respectively.

[0181] In the embodiments of the application, the broadcast scheduling module can add the mapped subtasks of each rate mode into the broadcast queue of the corresponding rate mode according to the preset queuing rule. The broadcast scheduling module can schedule the subtasks in the broadcast queue of each rate mode respectively.

[0182] In some embodiments, taking the three rate modes described in Table 1 as an example, the broadcast queue corresponding to the high-speed mode is referred to as a high-speed queue, the broadcast queue corresponding to the medium-speed mode is referred to as a medium-speed queue, and the broadcast queue corresponding to the low-speed mode is referred to as a low-speed queue. For example, referring to FIG. 6, the subtasks mapped by the broadcast tasks in the task queue can be added to the high-speed queue, the medium-speed queue, or the low-speed queue.

[0183] In some embodiments, the three rates include a rate mode 1 and a rate mode 2, and the broadcast priority of the rate mode 1 is higher than that of the rate mode 2. The preset queuing rule can include: if the broadcast queue of the rate mode 1 is not full, a new subtask of the rate mode 1 is added to the broadcast queue of the rate mode 1; if the broadcast queue of the rate mode 1 is full and the broadcast queue of the rate mode 2 is not full, a new subtask of the rate mode 1 is added to the broadcast queue of the rate mode 2.

[0184] For example, as shown in FIG. 6, when the high-speed queue is not full, the high-speed subtasks of task 2 and task 3 are sequentially added to the high-speed queue; when the high-speed queue is full, the high-speed subtask of task 5 is sequentially added to the medium-speed queue. Details are described in the related embodiments of the subsequent step S105, which will not be repeated here.

[0185] Based on the foregoing communication system, use scenario and electronic device, the following describes a broadcast method of the short-range wireless communication provided by the embodiments of the present application.

[0186] For example, FIG. 7 shows a method flow of a broadcast method of short-range wireless communication, which is applied to the broadcast sending end (for example, the electronic device 100) shown in FIG. 1A, and can reduce the broadcast delay, improve the broadcast success rate, and thus effectively improve the overall performance of the Bluetooth broadcast in the scenario of concurrent broadcast tasks. The method can include some or all of the steps S101 to S108.

[0187] S101, the broadcast identification module receives a broadcast service request 1 of a broadcast service 1.

[0188] In the embodiments of the present application, the broadcast service 1 can be any Bluetooth broadcast service of the electronic device 100. The broadcast service 1 in the electronic device 100 sends a broadcast service request 1 to the broadcast management module, and the broadcast service request 1 is used to request the related action of performing the Bluetooth broadcast of the broadcast service 1, such as starting broadcast, stopping broadcast or updating broadcast content. The Bluetooth broadcast involved in the embodiments of the present application can be specifically a BLE broadcast.

[0189] In some embodiments, the action indication information in the broadcast service request 1 indicates that the subsequent steps S102 to S108 are performed when the broadcast service request 1 is used to start broadcast or update broadcast content; the action indication information indicates that the broadcast service request 1 is processed according to the existing conventional process when the broadcast service request 1 is used to stop broadcast. In one implementation, the broadcast service request 1 is used to update the broadcast content, and specifically used to update the broadcast content of the broadcast task 2 in the task queue, the broadcast identification module deletes the broadcast task 2 in the broadcast task queue, and performs S102 to S108, including creating a new broadcast task 1 according to the broadcast service request 1 and adding the broadcast task 1 to the task queue.

[0190] In some embodiments, when the broadcast service request 1 is used to update the broadcast content of the broadcast task 2, if the broadcast service request 1 does not update the expected sending duration and the expected maximum period, the broadcast content (e.g., broadcast IND data, broadcast RSP data) of the broadcast task 2 is updated according to the broadcast service request 1; if the broadcast service request 1 updates the expected sending duration and / or the expected maximum period, the broadcast identification module deletes the broadcast task 2 in the broadcast task queue, and performs S102 to S108, including creating a new broadcast task 1 according to the broadcast service request 1, and adding the broadcast task 1 to the task queue.

[0191] S102, the broadcast identification module identifies the broadcast type of the Bluetooth broadcast requested by the broadcast service request 1.

[0192] For example, the broadcast service 1 can be a wireless screen projection service, a file sharing service, an application connection service, a clipboard service, a ranging service, a heartbeat keep-alive service, and the like. Specifically, the broadcast service 1 and the broadcast type corresponding to the broadcast service 1 can refer to the related description of the foregoing embodiments, which will not be described here.

[0193] S103, according to the broadcast type, the broadcast identification module determines the subtask mapped by the broadcast task 1 corresponding to the broadcast service request 1.

[0194] In some embodiments, the broadcast identification module can determine one or more rate mode subtasks corresponding to the broadcast task 1 according to the identified broadcast type and the broadcast policy configuration file. Specifically, it can refer to the related description of the foregoing embodiments, which will not be described here.

[0195] In some embodiments, the broadcast policy configuration file indicates the priority policy corresponding to each broadcast type in the white list. If the broadcast type 1 belongs to the white list, the electronic device 100 maps the broadcast task 1 corresponding to the broadcast service request 1 based on the priority policy corresponding to the broadcast type 1 in the broadcast policy configuration table; otherwise, the broadcast task 1 is only mapped to the subtask of the lowest priority rate mode (e.g., the low speed mode).

[0196] In the embodiments of the present application, the electronic device 100 can store the broadcast policy configuration file locally when it is shipped, and the electronic device 100 can also obtain the broadcast policy configuration table online after it is shipped. In one implementation, the server for supporting the broadcast method of the short-range wireless communication provided by the present application stores the broadcast policy configuration table, and the developer can update the broadcast policy configuration table online in the server according to the actual demand, that is, to dynamically set the priority policy of each broadcast type; the server can download the updated broadcast policy configuration file to the electronic device 100.

[0197] It should be noted that the content indicated by the broadcast policy configuration file in the electronic device (for example, the broadcast parameter in the priority policy of each broadcast type) is within the capability range of the electronic device, that is, the electronic device can support implementation; since the software capability and hardware capability of different electronic devices can be different, the broadcast policy configuration file locally stored by different electronic devices when they are shipped can be different. For example, the broadcast policy configuration file locally stored by a mobile phone and a computer when they are shipped is different.

[0198] S104, the broadcast identification module sends the sub-tasks mapped by the broadcast task 1 to the broadcast scheduling module.

[0199] S105, the broadcast scheduling module adds the sub-tasks of each rate mode into the broadcast queue of the corresponding rate mode according to a preset queuing rule.

[0200] In some embodiments, the aforementioned X rate modes include rate mode 1 and rate mode 2, and the broadcast priority of rate mode 1 is one level higher than that of rate mode 2. The sub-tasks of rate mode 1 are added into the broadcast queue of rate mode 1, or the sub-tasks of rate mode 1 are added into the broadcast queue of rate mode 2. The aforementioned preset queuing rule includes one or more of rule 1 to rule 6.

[0201] Rule 1: If the broadcast queue of rate mode 1 is not full, the new sub-tasks of rate mode 1 are added into the broadcast queue of rate mode 1.

[0202] Rule 2: If the broadcast queue of rate mode 1 is full, and the broadcast queue of rate mode 2 is not full, the new sub-tasks of rate mode 1 are added into the broadcast queue of rate mode 2.

[0203] Rule 3: If the broadcast queue of rate mode 1 is full, and the broadcast queue of rate mode 2 is full, the new sub-tasks of rate mode 1 are added into the broadcast queue of rate mode 2 after deleting the earliest added sub-tasks of rate mode 2 in the broadcast queue of rate mode 2. Or, if the broadcast queue of rate mode 1 is full, and the broadcast queue of rate mode 2 is full, the new sub-tasks of rate mode 1 are added into the broadcast queue when one of the broadcast queues of rate mode 1 and rate mode 2 is not full, that is, when the sub-tasks in the broadcast queue end.

[0204] Rule 4: If the broadcast queue of rate mode 1 is not full, and the broadcast queue of rate mode 2 includes the sub-tasks of rate mode 1, the sub-tasks of rate mode 1 in the broadcast queue of rate mode 2 are transferred to the broadcast queue of rate mode 1.

[0205] Rule 5: The sub-tasks of one rate mode are added into the broadcast queue of the same rate mode.

[0206] Rule 6: Based on Rule 5, if the broadcast queue of the same rate mode is full, the new sub-task of the same rate mode is added to the broadcast queue when the broadcast queue is not full, i.e., there is a sub-task ending in the broadcast queue, or the new sub-task is added to the broadcast queue after the earliest added sub-task in the broadcast queue is deleted.

[0207] In some embodiments, the number of sub-tasks in the broadcast queue of each rate mode is limited, and the preset queuing rules include Rule 1 to Rule 4 or Rule 5 to Rule 6. In some embodiments, the number of sub-tasks in the broadcast queue of each rate mode is not limited, and the preset queuing rules only include Rule 5.

[0208] In some embodiments, the number of sub-tasks in the broadcast queue of the rate mode with a high broadcast priority is limited, and the sub-tasks of the rate mode follow the above-mentioned Rule 1 to Rule 4 or Rule 5 to Rule 6; the number of sub-tasks in the broadcast queue of the rate mode with a low broadcast priority is not limited, and the sub-tasks of the rate mode only follow the above-mentioned Rule 5. For example, the number of sub-tasks in the broadcast queue of rate mode 1 is limited, and the number of sub-tasks in the broadcast queue of rate mode 2 is not limited.

[0209] In some embodiments, the aforementioned X is equal to 3, and the three rate modes described in Table 1 are taken as an example. The preset queuing rules can include one or more of the following Rule 11 to Rule 15. For example, FIGS. 8A to 8D show the changes of the broadcast queue of each rate mode as the tasks in the task queue increase.

[0210] Rule 11: The high-speed queue supports at most n1 (for example, 2) sub-tasks; if the high-speed queue is not full (i.e., the number of sub-tasks does not reach n1), the new high-speed sub-task is added to the high-speed queue; if the high-speed queue is full (i.e., the number of sub-tasks reaches n1), the new high-speed sub-task is added to the medium-speed queue, and the high-speed sub-task is inserted before the medium-speed sub-task.

[0211] Subsequently, the high-speed sub-task is preferentially called compared with the medium-speed sub-task in the medium-speed queue. It can be understood that the medium-speed queue can be regarded as a candidate queue of the high-speed sub-task.

[0212] For example, referring to FIGS. 8A to 8B, when the task queue sequentially adds task 1 to task 3, the high-speed queue is not full (i.e., the number of sub-tasks in the high-speed queue does not reach 2, and the high-speed queue is in an idle state), and the broadcast scheduling module sequentially adds the high-speed sub-tasks of task 2 and task 3 to the high-speed queue. Referring to FIG. 8C, when the task queue adds task 5, the high-speed queue is full (i.e., the number of sub-tasks in the high-speed queue reaches 2, and the high-speed queue is in a busy state), and the broadcast scheduling module sequentially adds the high-speed sub-task of task 5 to the medium-speed queue.

[0213] Rule 12: When the high-speed queue is not full and there is a high-speed subtask in the medium-speed queue, the high-speed subtask that is added to the medium-speed queue earliest is transferred to the high-speed queue.

[0214] It can be understood that, with the end of the task of part of the subtasks in the high-speed queue, when the number of subtasks in the high-speed queue is reduced to less than n1, the high-speed queue changes from full to not full. For example, referring to FIGS. 8C and 8D, after the high-speed subtask of task 2 in the high-speed queue ends, the high-speed queue is not full, and the broadcast scheduling module transfers the high-speed subtask of task 5 in the medium-speed queue to the high-speed queue.

[0215] In some embodiments, according to rule 11, when a new high-speed subtask is added to the medium-speed queue, the broadcast period of the high-speed subtask is modified to the initial broadcast period corresponding to the medium-speed mode (for example, 45 ms), which is within the value range of the broadcast period of the medium-speed mode (for example, 40 to 50 ms). For ease of description, the broadcast period of the high-speed subtask before modification is referred to as the original broadcast period. In this way, when the high-speed subtask in the medium-speed queue is called subsequently, it is allocated broadcast resources matching the medium-speed mode.

[0216] In some embodiments, according to rule 12, when the high-speed subtask in the medium-speed queue is transferred to the high-speed queue, the broadcast period of the high-speed subtask is restored to the original broadcast period. In this way, when the high-speed subtask in the high-speed queue is called subsequently, it is allocated broadcast resources matching the high-speed mode.

[0217] Rule 13: The medium-speed queue supports at most n2 (for example, 8) subtasks; if the medium-speed queue is not full, a new medium-speed subtask is added to the medium-speed queue; if the medium-speed queue is full, the new medium-speed subtask can be processed according to the following implementation mode 1, implementation mode 2, or implementation mode 3.

[0218] In implementation mode 1, if the medium-speed queue is full, the subtask that is added to the medium-speed queue earliest is deleted, and the new medium-speed subtask is added to the medium-speed queue. In one implementation, according to rule 11, when a high-speed subtask is added to the medium-speed queue, if the medium-speed queue is full, the medium-speed subtask that is added to the medium-speed queue earliest is deleted. Optionally, the subtask that is added to the medium-speed queue earliest specifically refers to the medium-speed subtask that is added to the medium-speed queue earliest.

[0219] In implementation mode 2, if the medium-speed queue is full, the new medium-speed subtask is added to the low-speed queue, and the medium-speed subtask is inserted before the low-speed subtask. Subsequently, in the low-speed queue, the medium-speed subtask is called preferentially compared with the low-speed subtask. It can be understood that the low-speed queue can be regarded as a candidate queue of the medium-speed subtask. In one implementation, according to rule 11, when a high-speed subtask is added to the medium-speed queue, if the medium-speed queue is full, the medium-speed subtask that is added to the medium-speed queue earliest is transferred to the low-speed queue.

[0220] In implementation 3, if the medium-speed queue is full, the new medium-speed subtask enters a waiting state until the medium-speed queue is not full, and the new medium-speed subtask is added to the medium-speed queue. In an implementation, according to rule 11, if the medium-speed queue is full when the high-speed subtask is added to the medium-speed queue, the new high-speed subtask enters a waiting state until the medium-speed queue is not full, and the new high-speed subtask is added to the medium-speed queue, or until the high-speed queue is not full, and the new high-speed subtask is added to the high-speed queue.

[0221] In some embodiments, under implementation 12, there is rule 14.

[0222] Rule 14: When the number of subtasks in the medium-speed queue is reduced to n2 or less, and there is a medium-speed subtask in the low-speed queue, the earliest added medium-speed subtask in the low-speed queue is transferred to the medium-speed queue.

[0223] In some embodiments, according to rule 13, when a new medium-speed subtask is added to the low-speed queue, the broadcast period of the medium-speed subtask is modified to the initial broadcast period corresponding to the low-speed mode (for example, 100 ms), which is within the value range of the broadcast period of the medium-speed mode (for example, 60 to 200 ms). For ease of description, the broadcast period of the medium-speed subtask before modification is referred to as the original broadcast period. In this way, when the medium-speed subtask in the low-speed queue is subsequently called, it is allocated broadcast resources matching the low-speed mode.

[0224] In some embodiments, according to rule 14, when a medium-speed subtask in the low-speed queue is transferred to the medium-speed queue, the broadcast period of the medium-speed subtask is restored to the original broadcast period. In this way, when the medium-speed subtask in the medium-speed queue is subsequently called, it is allocated broadcast resources matching the medium-speed mode.

[0225] Referring to rules 12 and 14, when the broadcast queue is not full, the high-speed subtask in the medium-speed queue is dynamically transferred to the high-speed queue, and the medium-speed subtask in the low-speed queue is dynamically transferred to the medium-speed queue, which can realize timely scheduling of subtasks of a higher rate mode (i.e., a rate mode with a higher broadcast priority), allocate broadcast resources of the higher rate mode to the subtasks, and effectively reduce the broadcast delay of subtasks with a high broadcast priority.

[0226] Rule 15: The low-speed queue supports at most n3 (for example, 10) subtasks; if the low-speed queue is not full, a new low-speed subtask is added to the low-speed queue; if the low-speed queue is full, the new low-speed subtask can be processed according to implementation 4 or implementation 5 described below.

[0227] In implementation 4, if the low-speed queue is not full, the earliest-joined subtask in the low-speed queue is deleted, and a new low-speed subtask is added to the low-speed queue. In an implementation, if the low-speed queue is full when a medium-speed subtask is added to the low-speed queue according to rule 13, the earliest-joined subtask in the low-speed queue is deleted. Optionally, the earliest-joined subtask is the earliest-joined low-speed subtask in the low-speed queue.

[0228] In implementation 5, if the low-speed queue is full, the new medium-speed subtask enters a waiting state until the low-speed queue is not full, and the new low-speed subtask is added to the low-speed queue. In an implementation, if the low-speed queue is full when a medium-speed subtask is added to the low-speed queue according to rule 13, the new medium-speed subtask enters a waiting state until the low-speed queue is not full, and the new medium-speed subtask is added to the low-speed queue, or until the medium-speed queue is not full, and the new medium-speed subtask is added to the medium-speed queue.

[0229] In some embodiments, the service priorities corresponding to different Bluetooth broadcasts can also be different; the preset queuing rules can further include rule 16 or rule 17.

[0230] Rule 16: In the same broadcast queue, subtasks of the same broadcast priority can be sorted according to service priority, and subtasks with higher service priority are arranged in front. Subsequently, in the same broadcast queue, subtasks of the same broadcast priority, the subtask that is earlier joined in the broadcast queue is preferentially invoked.

[0231] For example, referring to FIG. 8A, when the task queue adds task 1, the broadcast scheduling module adds the medium-speed subtask of task 1 to the high-speed queue; referring to FIG. 8B, when the task queue adds task 2, because the service priority of task 2 is higher than the service priority of task 1, the broadcast scheduling module adds the medium-speed subtask of task 2 to the medium-speed queue and inserts the medium-speed subtask of task 2 before the medium-speed subtask of task 1.

[0232] Rule 17: In the same broadcast queue, subtasks of the same broadcast priority can be sequentially arranged according to time. Subsequently, in the same broadcast queue, subtasks of the same broadcast priority, the subtask that is earlier joined in the broadcast queue is preferentially invoked.

[0233] In some embodiments, the number of subtasks in the high-speed queue and the medium-speed queue is limited, and the number of subtasks in the low-speed queue is not limited.

[0234] In the embodiments of the present application, the maximum number of subtasks supported by the broadcast queue corresponding to each rate mode is not specifically limited, that is, the values of n1, n2, and n3 are not specifically limited. Controlling the upper limit of the number of subtasks in each broadcast queue can prevent the tasks in each broadcast queue from being congested. Optionally, the developer or the electronic device 100 can configure n1, n2, and n3 according to actual needs.

[0235] The preset queuing rules are exemplarily described by taking two rate modes or three rate modes exemplified in Table 1 as examples. According to the foregoing related embodiments, X rate modes can be provided, and correspondingly, X broadcast queues corresponding to the X rate modes can be provided. The preset queuing rules can be adaptively extended to rules applicable to the X rate modes, which will not be described herein again.

[0236] S106, the broadcast scheduling module schedules the sub-tasks in the broadcast queues of each rate mode according to the preset scheduling rules.

[0237] S107, the broadcast scheduling module sends scheduling information to the broadcast execution module.

[0238] S108, based on the scheduling information, the broadcast execution module executes the scheduled sub-tasks in the broadcast queue of a rate mode on the broadcast channel of the rate mode.

[0239] In some embodiments, taking rate mode 1 and rate mode 2 as examples, the broadcast scheduling module schedules a sub-task of rate mode 1 from the broadcast queue of rate mode 1, and instructs the broadcast execution module to execute the sub-task on the broadcast channel of rate mode 1; or the broadcast scheduling module schedules a sub-task of rate mode 2 from the broadcast queue of rate mode 1, and instructs the broadcast execution module to execute the sub-task on the broadcast channel of rate mode 1. The broadcast priority of rate mode 1 is one level higher than the broadcast priority of rate mode 2.

[0240] In the embodiments of the present application, the broadcast scheduling module schedules the sub-tasks of different broadcast tasks from the broadcast queues (for example, high-speed queue, medium-speed queue, and low-speed queue) of each rate mode according to the preset scheduling rules, and instructs the broadcast execution module to execute the sub-tasks on the broadcast channel of the same rate mode.

[0241] In some embodiments, the Bluetooth channel includes a channel (hereinafter collectively referred to as a broadcast channel for convenience of description) corresponding to each rate mode for Bluetooth broadcast. Each rate mode can correspond to one or more broadcast channels. In an implementation, the number of broadcast channels corresponding to a lower rate mode is generally smaller than the number of broadcast channels corresponding to a higher rate mode. Taking the three rate modes shown in Table 1 as an example, the broadcast channel corresponding to the high-speed mode can be referred to as a high-speed channel, the broadcast channel corresponding to the medium-speed mode can be referred to as a medium-speed channel, and the broadcast channel corresponding to the low-speed mode can be referred to as a low-speed channel.

[0242] In some embodiments, the electronic device 100 supports at most N1 high-speed channels, N2 medium-speed channels, and N3 low-speed channels. For example, when N1 = 2, N2 = 2, and N3 = 3, FIG. 9 illustrates the task scheduling of the broadcast queues of each rate mode based on the broadcast scheduling module, and the tasks performed by the broadcast execution module on the broadcast channels of each rate mode.

[0243] In some embodiments, the preset scheduling rules include some or all of the following rules 21 to 29, taking rate mode 1 as an example.

[0244] Rule 21: Taking rate mode 1 as an example, the electronic device 100 supports at most M broadcast channels of rate mode 1; and at most M sub-tasks in the broadcast queue are determined in sequence.

[0245] In some embodiments, the electronic device 100 supports at most M broadcast channels of rate mode 1; accordingly, the broadcast scheduling module sequentially takes at most M sub-tasks from the broadcast queue of rate mode 1 and sends them to the broadcast execution module to instruct the broadcast execution module to perform the M sub-tasks on different broadcast channels of rate mode 1, respectively. It can be understood that when there are less than M sub-tasks in the broadcast queue of rate mode 1, all sub-tasks in the broadcast queue of rate mode 1 are scheduled, and each sub-task is executed on a different broadcast channel of rate mode 1.

[0246] For example, referring to FIG. 8B, after the task queue sequentially adds tasks 1 to 4, and the height queue sequentially adds the high-speed sub-tasks of task 2 and the high-speed sub-tasks of task 3, the electronic device 100 supports at most 2 high-speed channels (i.e., high-speed channel 1 and high-speed channel 2), and the broadcast scheduling module sequentially schedules the high-speed sub-tasks of task 2 and the high-speed sub-tasks of task 3 from the high-speed queue; referring to FIG. 9, the broadcast execution module executes the high-speed sub-tasks of task 2 on high-speed channel 1 and executes the high-speed sub-tasks of task 3 on high-speed channel 2, respectively.

[0247] Rule 22: The sub-tasks of different tasks are sequentially scheduled from the broadcast queues of each rate mode according to the broadcast priority of each rate mode from high to low.

[0248] For example, when scheduling the subtask of broadcast task 1 in rate mode 1, other subtasks of broadcast task 1 in lower rate modes (i.e. rate modes with lower broadcast priorities) cannot be scheduled. In the embodiments of the present application, the broadcast priority of a higher rate mode is higher. According to the broadcast priority from high to low, the subtasks to be scheduled in the broadcast queue of a higher rate mode are determined first, so as to ensure that the subtasks of different tasks are scheduled from the broadcast queues, and the subtasks of a higher rate mode of the same task are scheduled preferentially. For example, the subtasks to be scheduled in the high-speed queue are determined first, then the subtasks to be scheduled in the medium-speed queue are determined, and finally the subtasks to be scheduled in the low-speed queue are determined.

[0249] For example, referring to FIG. 8B, after the task queue sequentially adds task 1 to task 4, the high-speed queue sequentially includes the high-speed subtasks of task 2 and task 3, the medium-speed queue sequentially includes the medium-speed subtasks of task 2, task 1 and task 4, and the low-speed queue sequentially includes the low-speed subtasks of task 3 and task 4.

[0250] For example, the electronic device 100 supports at most 2 high-speed channels, 2 medium-speed channels (i.e. medium-speed channel 1 and medium-speed channel 2), and 3 low-speed channels. The broadcast scheduling module first determines to schedule the high-speed subtasks of task 2 and task 3 from the high-speed queue, then determines to schedule 2 subtasks from the medium-speed queue, and finally schedules at most 3 subtasks from the low-speed queue sequentially. As shown in FIG. 9, in the t1 time period, since it has been determined to schedule the high-speed subtask of task 2 from the high-speed queue, the broadcast scheduling module does not schedule the medium-speed subtask of task 2 in the medium-speed queue, and sequentially schedules the medium-speed subtasks of task 1 and task 4 from the medium-speed queue; the broadcast execution module executes the medium-speed subtask of task 1 on the medium-speed channel 1 and executes the high-speed subtask of task 4 on the medium-speed channel 2. In the t1 time period, since it has been determined to schedule the high-speed subtask of task 3 from the high-speed queue and the medium-speed subtask of task 4 from the medium-speed queue, the broadcast scheduling module does not schedule the low-speed subtasks of task 3 and task 4 in the low-speed queue, i.e. the broadcast scheduling module does not schedule the low-speed subtasks in the low-speed queue in the t1 time period.

[0251] Rule 23: When the subtask 2 in rate mode 2 is called and executed from the broadcast queue of rate mode 2, if the subtask 1 in rate mode 1 is added to the broadcast queue of rate mode 2, the subtask 1 in rate mode 1 interrupts and preempts the subtask 2 in rate mode 2 which is being executed on the broadcast channel of rate mode 2.

[0252] It can be understood that in the same broadcast queue, a subtask with a higher broadcast priority (e.g. a high-speed subtask) can interrupt and preempt a subtask with a lower broadcast priority (e.g. a medium-speed subtask).

[0253] For example, referring to FIG. 8C, when task queue adds task 5, task 5 is divided into high-speed subtask; since the high-speed queue is full, the high-speed subtask of task 5 is added to the medium-speed queue and inserted before the medium-speed subtask; when the high-speed subtask of task 5 is inserted into the medium-speed queue, the broadcast scheduling module schedules the high-speed subtask of task 5 and instructs the broadcast execution module to execute the high-speed subtask of task 5 on the medium-speed channel; as shown in FIG. 9, at this time, the high-speed subtask of task 5 interrupts and preoccupies the medium-speed subtask of task 4 executing on the medium-speed channel 2, that is, the broadcast execution module stops executing the medium-speed subtask of task 4 on the medium-speed channel 2 and executes the high-speed subtask of task 5 instead.

[0254] In an implementation manner, the high-speed subtask of task 5 can interrupt and preoccupy any medium-speed subtask executing on any medium-speed channel. In an implementation manner, the high-speed subtask of task 5 can interrupt and preoccupy the earliest medium-speed subtask (for example, the medium-speed subtask of task 1) currently executing on the medium-speed channel.

[0255] For example, referring to FIG. 8D, when task queue adds task 8, task 8 is divided into high-speed subtask, medium-speed subtask and low-speed subtask; since the high-speed queue is full, the high-speed subtask of task 8 is added to the medium-speed queue. As shown in FIG. 9, at this time, the high-speed subtask of task 8 interrupts and preoccupies the medium-speed subtask of task 1 executing on the medium-speed channel 1.

[0256] Rule 24: Based on the foregoing rule 23, after the subtask 1 of the rate mode 1 interrupts and preoccupies the subtask 2 of the rate mode 2 executing on the broadcast channel of the rate mode 2, when the subtask 1 of the rate mode 1 ends on the broadcast channel, the interrupted subtask 2 of the rate mode 2 is continued to be executed.

[0257] For example, referring to FIG. 9, the high-speed subtask of task 8 interrupts and preoccupies the medium-speed subtask of task 1 executing on the medium-speed channel 1; after the execution of the high-speed subtask of task 8 on the medium-speed channel 1 ends, the medium-speed subtask of task 1 is scheduled to continue to execute the interrupted medium-speed subtask of task 1 on the medium-speed channel 1.

[0258] Rule 25: The service priority of broadcast task 1 is one level higher than that of broadcast task 2; taking the rate mode 1 as an example, based on the foregoing rule 16, when the subtask 3 of the rate mode 1 of broadcast task 2 is called and executed from the broadcast queue of the rate mode 1, if the subtask 1 of the rate mode 1 of broadcast task 1 is added to the broadcast queue, the subtask 1 interrupts and preoccupies the subtask 3 executing on the broadcast channel of the rate mode 1.

[0259] For example, referring to FIG. 8A and FIG. 8B, the service priority of task 2 is higher than that of task 1, and when the medium-speed subtask of task 2 is inserted into the medium-speed queue, it is inserted before the medium-speed subtask of task 1. As shown in FIG. 9, when the broadcast execution module executes the medium-speed subtask of task 1 on the medium-speed channel 1, the broadcast scheduling module schedules the medium-speed subtask of task 2, which interrupts and preempts the medium-speed subtask of task 1 executing on the medium-speed channel 1.

[0260] Rule 26: On the basis of rule 25, after the subtask 1 interrupts and preempts the subtask 3 of rate mode 1 executing on the broadcast channel of rate mode 1, the subtask 1 ends on the broadcast channel, and the interrupted subtask 3 continues to be executed.

[0261] According to the aforementioned rule 4, when the broadcast queue of rate mode 1 is not full, the subtask of rate mode 1 in the broadcast queue of rate mode 2 can be transferred to the broadcast queue of rate mode 1; at this time, the broadcast scheduling module deletes the subtask of rate mode 1 in the broadcast queue of rate mode 2. On this basis, there is rule 27.

[0262] Rule 27: If the subtask of rate mode 1 is executed on the broadcast channel of rate mode 2, and the subtask of rate mode 1 in the broadcast queue of rate mode 2 is deleted, the broadcast scheduling module instructs the broadcast execution module to stop executing the subtask of rate mode 1 on the broadcast channel of rate mode 2.

[0263] For example, referring to FIG. 8C and FIG. 8D, when the high-speed subtask of task 5 is executed on the medium-speed channel 2, the broadcast scheduling module upgrades the high-speed subtask of task 5 in the medium-speed queue to the high-speed queue and deletes the high-speed subtask of task 5 in the medium-speed queue. As shown in FIG. 9, at this time, the broadcast scheduling module instructs the broadcast execution module to stop executing the high-speed subtask of task 5 on the medium-speed channel 2; then, the high-speed subtask of task 5 in the high-speed queue is scheduled, and the broadcast execution module is instructed to stop executing the high-speed subtask of task 5 on the high-speed channel 1.

[0264] Rule 28: The electronic device 100 supports Y broadcast channels of rate mode 1; when the number of tasks in the broadcast queue of rate mode 1 is less than Y, the same subtask in the broadcast queue of rate mode 1 can be executed in multiple broadcast channels of rate mode 1, respectively.

[0265] In some embodiments, when the broadcast queue of rate mode 1 has only one subtask, the Bluetooth broadcast of the subtask can be performed concurrently in multiple broadcast channels of rate mode 1, i.e., the multiple broadcast channels execute the subtask. In one implementation, rule 27 is only for the broadcast queue of the rate mode with the highest broadcast priority, such as the high-speed queue.

[0266] In some embodiments, in the case of no multitasking concurrency, i.e. only one broadcast task (e.g. broadcast task 1) in the task queue, the multiple broadcast channels in rate mode 1 can respectively execute the subtasks of broadcast task 1 in rate mode 1, and there is no limitation on the order of execution of the subtasks of rate mode 1 on the multiple broadcast channels. In one implementation, at the same time, the multiple broadcast channels in rate mode 1 can respectively execute the subtasks of broadcast task 1 in rate mode 1.

[0267] For example, the electronic device 100 supports at most 2 high-speed channels; when there is only one subtask (e.g. high-speed subtask of task 10) in the high-speed queue, the broadcast scheduling module can instruct the broadcast execution module to execute the high-speed subtask of task 10 on the 2 broadcast channels in the high-speed channels. In this way, the resource utilization rate of the broadcast channels and the broadcast success rate can be effectively improved.

[0268] Rule 29: The electronic device 100 supports at most F broadcast channels, and when the total number of tasks currently executed by the broadcast execution module reaches F, the broadcast scheduling module no longer schedules tasks from the broadcast queue, and the subtasks in each broadcast queue are queued and waiting for scheduling.

[0269] The Bluetooth broadcast concurrency capabilities of the Bluetooth chips of different electronic devices can be different, i.e. the maximum number of broadcast channels supporting concurrent broadcast can be different. In one implementation, F is less than or equal to the sum of the maximum numbers of broadcast channels in each rate mode supported by the electronic device 100.

[0270] In some embodiments, among the concurrent broadcast channels supported by the electronic device 100, the maximum number of high-speed channels is N1 (e.g. 2), the maximum number of high-speed channels plus medium-speed channels is N4 (e.g. 4), and the total number of high-speed channels, medium-speed channels and low-speed channels is F (e.g. 7). In this way, it can be avoided that there are too many broadcast channels in higher rate modes, i.e. high-speed subtasks occupy too many broadcast resources, and the load of the Bluetooth chip is too large.

[0271] In some embodiments, on the basis of rule 28, when the number of concurrent broadcast channels of the electronic device 100 reaches F, if the broadcast scheduling module schedules a subtask in a broadcast queue in a higher rate mode, the subtask can interrupt and preempt a subtask executed on a broadcast channel in a lower rate mode (e.g. a low-speed channel) among the above F broadcast channels, and switch the broadcast channel to a broadcast channel in a higher rate mode (e.g. a high-speed channel).

[0272] In some embodiments, the lower rate mode is the lowest rate mode, e.g. the low-speed mode.

[0273] In some embodiments, when the F broadcast channels exist in the minimum rate mode, the service priority corresponding to the sub-tasks executed by the multiple broadcast channels is determined, and the broadcast channel 1 with the lowest service priority is determined as the broadcast channel 1; or the timing duration of the current action of the sub-tasks executed by the multiple broadcast channels is determined, and the broadcast channel with the maximum timing duration is determined as the broadcast channel 1.

[0274] In some embodiments, when the concurrent broadcast channels of the electronic device 100 reach F, if the high-speed sub-tasks in the high-speed queue are scheduled by the broadcast scheduling module, the low-speed channel 1 in the F broadcast channels is determined, the execution of the low-speed sub-tasks in the low-speed channel 1 is stopped, and the low-speed channel 1 is switched to a high-speed channel for executing the high-speed sub-tasks scheduled from the high-speed queue.

[0275] For example, when the concurrent broadcast channels of the electronic device 100 reach 7, including 1 high-speed channel, 2 medium-speed channels, and 4 low-speed channels, if the high-speed sub-tasks in the high-speed queue are scheduled by the broadcast scheduling module, the high-speed sub-tasks can interrupt and preempt the sub-tasks executed in the low-speed channel 1 in the F broadcast channels; since the low-speed channel 1 is currently used for transmitting the high-speed sub-tasks in the high-speed queue, the low-speed channel 1 is switched to a high-speed channel.

[0276] According to the embodiments of the present application, different broadcast tasks and different sub-tasks of the same broadcast task can be dynamically scheduled in a differentiated manner; the sub-tasks of the same task in different rate modes are scheduled to different rate mode broadcast channels for execution according to the priority strategy; in the multi-service concurrent broadcast scenario, the resource utilization rate of the broadcast channels in different rate modes can be effectively improved.

[0277] In some embodiments, when the broadcast scheduling module schedules the sub-tasks of the rate mode 2 of the broadcast task 1 in step S106, steps S109 and S110 can also be performed, the broadcast coordination module is instructed to limit the transmission rate of the Bluetooth data packet to allocate more transmission resources to the Bluetooth broadcast packet, thereby reducing the transmission delay of the Bluetooth broadcast and improving the success rate of the Bluetooth broadcast.

[0278] S109, the broadcast scheduling module sends start coordination information to the broadcast coordination module, and the start coordination information is used to instruct the broadcast coordination module to limit the speed of the data packet.

[0279] In the embodiments of the present application, the electronic device 100 sets corresponding speed limiting gears for part or all of the rate modes; the speed limiting gears corresponding to different rate modes can be different, and the speed limiting gear corresponding to a higher rate mode indicates a smaller transmission rate of the data packet, that is, a larger limitation on the transmission rate of the data packet. In the embodiments of the present application, the speed limiting gears corresponding to the same rate mode of different broadcast types can be the same or different, which is not limited here.

[0280] In some embodiments, when the highest rate mode corresponding to the currently scheduled broadcast queue is set with a speed limit gear, the broadcast scheduling module sends a start coordination information to the broadcast coordination module, the start coordination information is used to instruct the broadcast coordination module to limit the speed of the data packet (e.g. Bluetooth data packet) according to the upper limit gear. In the embodiments of the present application, the currently scheduled broadcast queue refers to the broadcast queue to which the currently scheduled subtask belongs.

[0281] In some embodiments, the broadcast coordination module can instruct the Bluetooth communication module to reduce the speed of the Bluetooth data packet according to the speed limit gear, so that the Bluetooth communication module transmits the Bluetooth data packet on the Bluetooth link at the transmission rate indicated by the speed limit gear.

[0282] In some embodiments, only part of the rate modes with high broadcast priority in the broadcast strategy configuration file is set with a corresponding speed limit gear; for the remaining rate modes with low broadcast priority, no speed limit gear is set, i.e. when broadcasting the subtasks in the broadcast queue of the rate mode, there is no need to coordinate other modules to limit the speed of the Bluetooth data packet. For example, the high-speed mode and the medium-speed mode are set with a speed limit gear, and the low-speed mode is not set with a speed limit gear. For example, the high-speed mode is set with a speed limit gear, and the low-speed mode and the medium-speed mode are not set with a speed limit gear.

[0283] In some embodiments, all rate modes in the broadcast strategy configuration file are set with a corresponding speed limit gear. For example, the speed limit gear corresponding to the high-speed mode is 30KB / s, the speed limit gear corresponding to the medium-speed mode is 50KB / s, and the speed limit gear corresponding to the low-speed mode is 80KB / s.

[0284] In some embodiments, the broadcast scheduling module determines whether to coordinate other modules to limit the speed of the Bluetooth data packet when scheduling a new task from the broadcast queue. For example, referring to FIG. 9, when scheduling the high-speed subtask of task 2 at T1, the broadcast scheduling module determines that the highest rate mode corresponding to the currently scheduled broadcast queue is the high-speed mode, and the high-speed mode is set with a speed limit gear, i.e. 30KB / s; the broadcast scheduling module sends a start coordination information to the broadcast coordination module; based on the start coordination information, the broadcast coordination module instructs the Bluetooth communication module to reduce the speed to transmit the Bluetooth data packet on the Bluetooth link at a transmission rate of 30KB / s.

[0285] In some embodiments, when the broadcast scheduling module determines that the subtask execution on the broadcast channel is completed, the broadcast scheduling module performs S109 to determine whether to coordinate other modules to limit the speed of the Bluetooth data packet. For example, referring to FIG. 9, when the broadcast scheduling module determines that the high-speed subtask execution of task 8 is completed at time T2, the broadcast scheduling module determines that the highest speed mode corresponding to the currently scheduled broadcast queue is the medium-speed mode, and the medium-speed mode is set to have a speed limit, i.e., 50 KB / s. The broadcast scheduling module sends start coordination information to the broadcast coordination module. Based on the start coordination information, the broadcast coordination module instructs the Bluetooth communication module to reduce the speed to transmit the Bluetooth data packet on the Bluetooth link at a transmission speed of 50 KB / s.

[0286] The BLE divides the frequency band range of the BLE into 40 channels. The 4.2 version of the BLE divides the 40 channels into 3 broadcast channels and 37 data channels. The broadcast channels are used only for transmitting Bluetooth broadcast packets, and the data channels are used only for transmitting Bluetooth data packets. The 5.0 version of the BLE adds the feature of extended broadcast. The 3 broadcast channels can be referred to as main broadcast channels, and the 37 data channels can be extended to auxiliary broadcast channels, i.e., the data channels can also be used for transmitting broadcast packets. The Bluetooth data packet can also be referred to as Bluetooth air interface data, and the Bluetooth broadcast packet can also be referred to as Bluetooth broadcast data.

[0287] In some embodiments, the speed reduction processing on the Bluetooth data packet includes increasing the number of auxiliary broadcast channels used for transmitting the Bluetooth broadcast packet and reducing the number of data channels used for transmitting the Bluetooth data packet.

[0288] In some embodiments, for the same Bluetooth channel, the electronic device 100 adopts a polling scheduling manner to schedule the transmission of the Bluetooth broadcast packet and the Bluetooth data packet. The speed reduction processing on the Bluetooth data packet includes reducing the time slice of the data channel for transmitting the Bluetooth data packet and increasing the time slice of the data channel for transmitting the Bluetooth broadcast packet.

[0289] The embodiments of the present application set different speed limit gears for subtasks with different broadcast priorities, dynamically adjust the Bluetooth transmission speed, and provide more broadcast resources and scheduling opportunities for Bluetooth broadcast.

[0290] S110, the broadcast scheduling module sends cancel coordination information to the broadcast coordination module. The cancel coordination information is used to instruct the broadcast coordination module to cancel the speed limitation on the data packet.

[0291] In some embodiments, when the highest speed mode corresponding to the currently scheduled broadcast queue is not set to have a speed limit, or when no broadcast task is currently executed, the broadcast scheduling module sends the cancel coordination information to the broadcast coordination module. The cancel coordination information is used to instruct the broadcast coordination module to cancel the speed limitation on the data packet (e.g., the Bluetooth data packet).

[0292] It can be understood that when the Bluetooth data packet is limited in speed, if it is detected that the highest speed mode in the speed mode of the currently scheduled broadcast queue is not set with the speed limiting gear, or the Bluetooth broadcast task is not scheduled, the electronic device 100 cancels the speed limitation of the Bluetooth data packet.

[0293] In some embodiments, the broadcast scheduling module determines that any sub-task on the broadcast channel has ended, or the sub-task with the speed mode set with the speed limiting gear has ended, and performs S110 to determine whether to cancel the speed limitation of the Bluetooth data packet.

[0294] In some embodiments, the broadcast scheduling module periodically performs S109 and / or S110 according to a preset period to determine whether to start the coordination / cancel the coordination.

[0295] In some embodiments, before the speed of the Bluetooth data packet is reduced in step S109, the transmission speed of the Bluetooth data packet is transmission speed 1; after the speed limitation of the Bluetooth data packet is cancelled in step S110, the transmission speed of the Bluetooth data packet returns to transmission speed 1.

[0296] In some embodiments, after the speed limitation of the Bluetooth data packet is cancelled, the Bluetooth communication module can transmit the Bluetooth data packet at the conventional transmission speed in the existing scheme. The embodiments of the present application do not make specific limitations on the conventional transmission speed.

[0297] The broadcast method of the close-range communication provided by the present application will be exemplarily described below in combination with specific scenarios.

[0298] For example, the foregoing broadcast service is a wireless screen projection service, and the electronic device 100 is a mobile phone. Before the user performs wireless screen projection through the mobile phone, the user triggers the mobile phone to send a probe broadcast through Bluetooth to find a nearby receiving end device that can be projected. The wireless screen projection service of the mobile phone sends a broadcast service request to the broadcast identification module, and the broadcast service request is used to request to send a probe broadcast for projection. To generate a broadcast task corresponding to the broadcast service request, the broadcast identification module first identifies the broadcast type (for example, the broadcast type D shown in Table 1) corresponding to the broadcast service request; according to the broadcast parameters (i.e., the broadcast period and the duration) of the high-speed mode and the medium-speed mode corresponding to the broadcast type D indicated in Table 1, and the foregoing broadcast service request, the broadcast identification module can determine the foregoing broadcast task, for example, the task 2 in the foregoing FIGS. 8A to 8D, and the high-speed sub-task and the medium-speed sub-task corresponding to the foregoing broadcast task. The high-speed sub-task is used to send the probe broadcast for projection in the high-speed mode, and the medium-speed sub-task is used to send the probe broadcast for projection in the medium-speed mode. It can be understood that the broadcast content of the high-speed sub-task and the medium-speed sub-task is the same, but the broadcast parameters are different.

[0299] As shown in FIG. 8A and FIG. 8B, when the high-speed queue is not full, the broadcast identification module adds the high-speed subtask of task 2 into the high-speed queue; when the medium-speed queue is not full, the broadcast identification module adds the medium-speed subtask of task 2 into the medium-speed queue. As shown in FIG. 8A to FIG. 8D and FIG. 9, according to the preset scheduling rule, the broadcast scheduling module schedules the high-speed subtask of task 2 in the high-speed queue, and instructs the broadcast execution module to execute the high-speed subtask of task 2 on the high-speed channel 1; according to the preset scheduling rule, the broadcast scheduling module schedules the medium-speed subtask of task 2 in the medium-speed queue, and instructs the broadcast execution module to execute the medium-speed subtask of task 2 on the medium-speed channel 1.

[0300] For example, the foregoing broadcast service is a heartbeat service, and the electronic device 100 is a mobile phone. The user opens the super terminal interface of the mobile phone, and the super terminal interface displays an icon of an electronic device (for example, a tablet) that can be cooperated nearby. The mobile phone periodically broadcasts a heartbeat signal to the tablet via Bluetooth to detect whether the tablet is online; if the tablet sends a response signal after receiving the heartbeat signal, it is determined that the tablet is online, and the mobile phone continues to display the icon of the tablet on the super terminal interface; otherwise, it is determined that the tablet is offline, and the icon of the tablet is stopped from being displayed. Specifically, the heartbeat service of the mobile phone sends a broadcast service request to the broadcast identification module, and the broadcast service request is used to request to broadcast a heartbeat signal via Bluetooth; to generate a broadcast task corresponding to the broadcast service request, the broadcast identification module first identifies a broadcast type (for example, the broadcast type C shown in Table 1) corresponding to the broadcast service request; according to the broadcast parameters (that is, the broadcast period and the duration) of the low-speed mode corresponding to the broadcast type C indicated in Table 1, and the foregoing broadcast service request, the broadcast identification module can determine the foregoing broadcast task. For example, the task 7 in the foregoing FIG. 8D is taken as an example, and the low-speed subtask corresponding to the foregoing broadcast task is used to send the foregoing heartbeat signal in the low-speed mode.

[0301] As shown in FIG. 8D, when the low-speed queue is not full, the broadcast identification module adds the low-speed subtask of task 7 into the low-speed queue. As shown in FIG. 8D and FIG. 9, according to the preset scheduling rule, the broadcast scheduling module schedules the low-speed subtask of task 7 in the low-speed queue, and instructs the broadcast execution module to execute the low-speed subtask of task 7 on the low-speed channel 2.

[0302] For example, as shown in FIG. 10, the present application provides a broadcast method of close-range wireless communication, which is applied to an electronic device 100, and the method can include steps S201 to S204.

[0303] S201, determining a first subtask of a first speed mode and a second subtask of a second speed mode corresponding to a first broadcast task; the broadcast period of the first subtask in the first speed mode is less than the broadcast period of the second subtask in the second speed mode.

[0304] In the embodiments of the present application, the value range of the broadcast period in different rate modes is different; the value in the value range of the broadcast period in the first rate mode is smaller than the value in the value range of the broadcast period in the second rate mode.

[0305] S202, add the first sub-task to a target broadcast queue, the target broadcast queue being a first broadcast queue corresponding to the first rate mode or a second broadcast queue corresponding to the second rate mode.

[0306] S203, add the second sub-task to the second broadcast queue.

[0307] S204, schedule the sub-tasks in the first broadcast queue and the second broadcast queue respectively.

[0308] In the embodiments of the present application, the smaller the broadcast period is, the greater the demand for broadcast resources in a unit of time is, and the higher the transmission rate of the broadcast is; a broadcast task is mapped to sub-tasks in different rate modes (for example, a first sub-task in the first rate mode and a second sub-task in the second rate mode), that is, sub-tasks in different broadcast periods, and the sub-tasks in each rate mode are added to the broadcast queue corresponding to the rate mode. In one implementation, the first sub-task in the first rate mode is added to the first broadcast queue in the first rate mode, and the second sub-task in the second rate mode is added to the first broadcast queue in the second rate mode; when the sub-tasks of the first broadcast task in the first broadcast queue are not scheduled, the sub-tasks of the first broadcast task in the second broadcast queue can be scheduled, and the broadcast resource corresponding to the second broadcast queue is used for broadcast; in this way, the waiting time of the sub-tasks can be reduced, the broadcast delay can be effectively reduced, and the success rate of the broadcast can be improved. In another implementation, if other broadcast tasks continuously occupy the broadcast queue in the first rate mode, the sub-tasks in the first rate mode can be added to the second broadcast queue and scheduled in the second broadcast queue; in this way, the waiting time of the sub-tasks can be reduced, thereby reducing the broadcast delay. Compared with scheduling the broadcast task by using a single dimension of priority, the embodiments of the present application can reduce the broadcast delay, improve the success rate of the broadcast, and effectively improve the overall performance of the broadcast.

[0309] In the embodiments of the present application, the value range of the broadcast period in different rate modes is different; the value in the value range of the broadcast period in the first rate mode is smaller than the value in the value range of the broadcast period in the second rate mode.

[0310] In an implementation, the first subtask of the first rate mode and the second subtask of the second rate mode corresponding to the first broadcast task include: determining the first subtask of the first rate mode and the second subtask of the second rate mode corresponding to the first broadcast task according to the first broadcast type and the first file corresponding to the first broadcast task; the first file indicates a broadcast period of the subtask of one or more rate modes mapped by the broadcast task of each broadcast type.

[0311] The first broadcast type can be any of the broadcast types provided in the foregoing embodiments, and the first file can be the broadcast strategy configuration file, for example, the broadcast strategy configuration table shown in Table 1.

[0312] In an implementation, before the first subtask is added to the target broadcast queue, the method further includes: adding the first broadcast task to a task queue; the task queue includes a plurality of broadcast tasks. For example, FIG. 6 shows a task queue of a Bluetooth broadcast.

[0313] In the embodiments of the present application, the first broadcast channel is a broadcast channel corresponding to the first rate mode, and the second broadcast channel is a broadcast channel corresponding to the second rate mode. For example, the first broadcast channel and the second broadcast channel can be two of the following broadcast channels: a high-speed channel corresponding to a high-speed mode, a medium-speed channel corresponding to a medium-speed mode, and a low-speed channel corresponding to a low-speed mode.

[0314] In an implementation, the method further includes: if the first subtask is added to the second broadcast queue and the electronic device executes a third subtask of the second rate mode in the second broadcast queue on the second broadcast channel, the first subtask interrupts and preoccupies the third subtask executed on the second broadcast channel. For example, referring to rule 23, the first rate mode and the second rate mode are rate mode 1 and rate mode 2 respectively, the first subtask can be subtask 1 of rate mode 1, and the third subtask can be subtask 2 of rate mode 2.

[0315] In the embodiments of the present application, the first broadcast service request can be the first broadcast service request, and the first broadcast type can be the broadcast type of the Bluetooth broadcast requested by the first broadcast service request.

[0316] In an implementation, the service priority of the first broadcast task is higher than the service priority of the second broadcast task; the method further comprises: when the second subtask is added to the second broadcast queue, if the electronic device executes a fourth subtask of a second rate mode of the second broadcast task on the second broadcast channel, the second subtask interrupts and preoccupies the fourth subtask executed on the second broadcast channel. For example, the first broadcast task and the second broadcast task are the first broadcast task and the second broadcast task described above respectively; the second subtask can be the first subtask of the first rate mode of the first broadcast task, and the fourth subtask can be the third subtask of the first rate mode of the second broadcast task.

[0317] The embodiments of the present application can be combined in any manner to achieve different technical effects.

[0318] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The 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 processes or functions described in the embodiments are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be magnetic media (such as floppy disk, hard disk, magnetic tape), optical media (such as DVD), or semiconductor media (such as solid state disk (SSD)) and the like.

[0319] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by a computer program to instruct the relevant hardware to complete, and the program can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments. The storage medium described above includes ROM or random access memory (RAM), magnetic disk or optical disk and various media that can store program codes.

[0320] In conclusion, the above-mentioned is only the embodiment of the technical scheme of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present application shall be included in the protection scope of the present application.

Claims

1. A broadcasting method of near field wireless communication applied to an electronic device, characterized by, The method comprises: determining a first subtask of a first rate mode and a second subtask of a second rate mode corresponding to a first broadcast task; a broadcast cycle of the first subtask in the first rate mode is less than a broadcast cycle of the second subtask in the second rate mode; adding the first subtask into a target broadcast queue; the target broadcast queue is a first broadcast queue corresponding to the first rate mode or a second broadcast queue corresponding to the second rate mode; adding the second subtask into the second broadcast queue; respectively scheduling subtasks in the first broadcast queue and the second broadcast queue.

2. The method of claim 1, wherein, The first subtask of the first rate mode and the second subtask of the second rate mode corresponding to the first broadcast task comprise: determining the first subtask of the first rate mode and the second subtask of the second rate mode corresponding to the first broadcast task according to a first broadcast type and a first file corresponding to the first broadcast task; the first file indicates a broadcast cycle of a subtask of one or more rate modes corresponding to a broadcast task of each broadcast type.

3. The method according to claim 1 or 2, characterized in that, The method further comprises: when the first broadcast queue is executed, the second broadcast queue is executed; the scheduled subtasks in the first broadcast queue and the second broadcast queue correspond to different broadcast tasks.

4. The method according to any one of claims 1 to 3, characterized in that, A first broadcast channel is used to execute the scheduled subtasks in the first broadcast queue; A second broadcast channel is used to execute the scheduled subtasks in the second broadcast queue.

5. The method according to any one of claims 1 to 4, characterized in that, Before the first subtask is added into the target broadcast queue, the method further comprises: adding the first broadcast task into a task queue; the task queue comprises a plurality of broadcast tasks.

6. The method according to any one of claims 1 to 5, characterized in that, The first subtask is added into the target broadcast queue, comprising: if the first broadcast queue is not full, the first subtask is added into the first broadcast queue; if the first broadcast queue is full, the first subtask is added into the second broadcast queue when the second broadcast queue is not full, or the first subtask of the first rate mode added earliest in the first broadcast queue is deleted, and then the first subtask is added into the first broadcast queue.

7. The method of claim 6, wherein, After the first subtask is added into the second broadcast queue, the method further comprises: when the first broadcast queue is not full, the first subtask of the first rate mode in the second broadcast queue is transferred to the first broadcast queue.

8. The method of claim 6, wherein, The method further comprises: if the first subtask is added into the second broadcast queue, and the electronic device executes a third subtask of the second rate mode in the second broadcast queue on the second broadcast channel, the first subtask interrupts and preoccupies the third subtask executed on the second broadcast channel.

9. The method according to any one of claims 1 to 8, characterized in that, The first broadcast task is a first short-distance wireless communication broadcast task; When the first broadcast queue and the second broadcast queue are respectively scheduled, the method further comprises: limiting the transmission rate of data packets transmitted by the first short-distance wireless communication.

10. The method of claim 9, wherein, The transmission rate of the data packet using the first short-range wireless communication is limited, comprising: when scheduling the sub-tasks in the first broadcast queue, the transmission rate of the data packet is reduced to a first transmission rate; when scheduling the sub-tasks in the second broadcast queue and not scheduling the sub-tasks in the first broadcast queue, the transmission rate of the data packet is reduced to a second transmission rate, the first transmission rate being lower than the second transmission rate.

11. The method according to any one of claims 1 to 10, characterized in that, Before determining the first sub-task of the first rate mode and the second sub-task of the second rate mode corresponding to the first broadcast task, the method further comprises: obtaining a first broadcast service request; based on the first broadcast service request, determining that the broadcast type of the first broadcast task corresponding to the first broadcast service request is the first broadcast type.

12. The method of claim 11, wherein, The first file indicates a first broadcast period of the first sub-task of the first rate mode corresponding to the first broadcast type, and also indicates a value range of the broadcast period in the first rate mode, the first broadcast service request comprising an expected minimum period; when the expected minimum period does not exceed the maximum value of the value range of the broadcast period in the first rate mode, the broadcast period of the first sub-task takes the maximum value between the first broadcast period and the expected minimum period.

13. The method of claim 11, wherein, The first file indicates a first duration of the first sub-task of the first rate mode corresponding to the first broadcast task, the first broadcast service request comprising an expected transmission duration; the duration of the first sub-task takes the minimum value between the first duration and the expected transmission duration.

14. The method of claim 7, wherein, The first file also indicates a value range of the broadcast period in each rate mode, the method further comprising: when adding the first sub-task to the second broadcast queue, the broadcast period of the first sub-task is modified from the broadcast period of the first sub-task in the first rate mode to an initial broadcast period of the second rate mode, the initial broadcast period of the second rate mode being within the value range of the broadcast period in the second rate mode; when transferring the first sub-task in the second broadcast queue to the first broadcast queue, the broadcast period of the first sub-task is modified to the broadcast period of the first sub-task in the first rate mode.

15. The method according to any one of claims 1 to 14, characterized in that, The service priority of the first broadcast task is higher than the service priority of the second broadcast task; the method further comprises: when adding the second sub-task to the second broadcast queue, if the electronic device is executing a fourth sub-task of the second rate mode of the second broadcast task on the second broadcast channel, the second sub-task interrupts and preoccupies the fourth sub-task being executed on the second broadcast channel.

16. The method according to any one of claims 1 to 15, characterized in that, The electronic device supports multiple second broadcast channels, the second broadcast channel being used to execute the scheduled sub-tasks in the second broadcast queue; when the broadcast task of the first short-range wireless communication of the electronic device only comprises the first broadcast task, the second sub-tasks are executed on multiple second broadcast channels respectively.

17. The method of claim 16, wherein, The close-range wireless communication is Bluetooth communication, and the broadcast task is a broadcast task of Bluetooth communication.

18. An electronic device, comprising: Comprising: a processor and a memory coupled to the processor, the memory configured to store computer program code comprising computer instructions that, when read by the processor from the memory, cause the electronic device to perform the broadcast method of close-range wireless communication as claimed in any one of claims 1 to 17.

19. A computer-readable storage medium, characterized in that, Computer instructions that, when executed on an electronic device, cause the electronic device to perform the broadcast method of close-range wireless communication as claimed in any one of claims 1 to 17.

20. A computer program product, characterised in that, Computer program product that, when executed on a computer, causes the computer to perform the method as claimed in any one of claims 1 to 17.

Citation Information

Patent Citations

  • Method for self-adaption adjusting receiving speed to buffer play by a mobile multimedia broadcast terminal

    CN101330340A

  • Broadcast message queuing method and apparatus, and terminal

    CN106851016A

  • Broadcast scheduling processing method and device, computer equipment and storage medium

    CN117407185A

  • Transmitting device and receiving device

    JP2024113747A