Bluetooth resource management method, electronic equipment and computer readable storage medium

By detecting and adjusting the resource occupancy information of the Bluetooth link, the problem of terminal device performance degradation caused by Bluetooth link occupancy is solved, ensuring reasonable distribution of link load and accuracy of performance testing.

CN118540681APending Publication Date: 2024-08-23HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310180116.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-21
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

If the Bluetooth link is occupied by other applications for a long time, the signal reception and feedback of the terminal device are not timely, affecting the performance of the device.

Method used

By obtaining the Bluetooth resource occupancy information of multiple Bluetooth links, detect whether each link meets the preset resource load requirements. If not, close or adjust the target application or link to ensure that all links meet the load requirements and start Performance testing process.

Benefits of technology

Ensure that the Bluetooth link load does not affect the performance of the terminal device, improve the accuracy of the performance test and the ranging accuracy of the terminal device and the Bluetooth device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540681A
    Figure CN118540681A
Patent Text Reader

Abstract

The invention provides a Bluetooth resource management method, electronic equipment and a computer readable storage medium, relates to the technical field of communication, is applied to terminal equipment with a plurality of Bluetooth links, and comprises the following steps: acquiring Bluetooth resource occupation information of each Bluetooth link in the plurality of Bluetooth links; determining whether the plurality of Bluetooth links meet a preset resource load requirement according to the Bluetooth resource occupation information of each Bluetooth link; when the plurality of Bluetooth links meet the preset resource load requirement, starting a preset performance test process; and when a target Bluetooth link which does not meet a preset resource load requirement is detected in the plurality of Bluetooth links, closing or prompting a user to close a target application program matched with the target Bluetooth link, or adjusting or prompting the user to adjust Bluetooth resources of the target Bluetooth link. According to the invention, the Bluetooth resources of the Bluetooth link with a large load can be processed according to the load condition of the Bluetooth link, so as to ensure that the load of the Bluetooth link does not affect the performance of the terminal equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a Bluetooth resource management method, an electronic device, and a computer-readable storage medium. Background Art

[0002] The rapid development of the Internet and wireless communications has led to a rapid increase in people's demand for various data and mobile services. As a global open wireless communication standard, Bluetooth technology connects various voice and data devices with wireless links, allowing people to exchange and transmit language and data in their personal areas anytime and anywhere. With the development and improvement of Bluetooth technology, Bluetooth connection has gradually become a high-speed and secure wireless data transmission channel often used between electronic devices.

[0003] In the related art, if the Bluetooth link of a terminal device is occupied by other applications for a long time, it may cause the terminal device to fail to receive and feedback signals in a timely manner, thereby affecting the performance of the terminal device. Summary of the invention

[0004] In view of this, an embodiment of the present application provides a Bluetooth resource management method to ensure that the load of the Bluetooth link does not affect the performance of the terminal device.

[0005] A first aspect of an embodiment of the present application provides a Bluetooth resource management method, which is applied to a terminal device having multiple Bluetooth links, and the method includes: obtaining Bluetooth resource occupancy information of each Bluetooth link in the multiple Bluetooth links; determining whether the multiple Bluetooth links all meet the preset resource load requirements based on the Bluetooth resource occupancy information of each Bluetooth link; when the multiple Bluetooth links all meet the preset resource load requirements, starting a preset performance test process; when a target Bluetooth link that does not meet the preset resource load requirements is detected in the multiple Bluetooth links, closing or prompting the user to close a target application matching the target Bluetooth link, or adjusting or prompting the user to adjust the Bluetooth resources of the target Bluetooth link.

[0006] Compared with the related art, the embodiments of the present application have at least the following advantages: by detecting whether each Bluetooth link meets the preset resource load requirements based on the Bluetooth resource occupancy information, when a target communication link that does not meet the preset resource load requirements is detected, it is possible to close or prompt the user to close the application that matches the target Bluetooth link, and it is also possible to adjust or prompt the user to adjust the Bluetooth resources of the target Bluetooth link so that each Bluetooth link can meet the preset resource load requirements, thereby ensuring that the load of the Bluetooth link will not affect the performance of the terminal device, thereby making the preset performance test process more accurate.

[0007] In some possible implementations, the Bluetooth resource occupancy information includes a data transmission time interval; and obtaining the Bluetooth resource occupancy information of the multiple Bluetooth links includes: obtaining multiple data transmission time intervals of the multiple Bluetooth links, wherein one Bluetooth link corresponds to one data transmission time interval.

[0008] In some possible implementations, determining whether the multiple Bluetooth links all meet the preset load requirements based on the Bluetooth resource occupancy information of each Bluetooth link includes: separately detecting whether the data transmission time interval of each Bluetooth link is greater than or equal to a first preset time interval; wherein, the multiple Bluetooth links all meet the preset resource load requirements, including: the data transmission time interval of each Bluetooth link is greater than or equal to the first preset time interval; detecting a target Bluetooth link that does not meet the preset resource load requirements among the multiple Bluetooth links, including: detecting that the data transmission time interval of the target Bluetooth link is less than the first preset time interval, wherein the target Bluetooth link is one or more of the multiple Bluetooth links.

[0009] By adopting this technical solution, the resource load of each Bluetooth link can be accurately known.

[0010] In some possible implementations, determining whether the multiple Bluetooth links all meet the preset load requirements based on the Bluetooth resource occupancy information of each Bluetooth link includes: calculating the median of the data transmission time intervals of the multiple Bluetooth links; detecting whether the median is greater than or equal to a second preset time interval; wherein the multiple Bluetooth links all meet the preset resource load requirements, including: the median is greater than or equal to the second preset time interval; detecting a target Bluetooth link that does not meet the preset resource load requirements among the multiple Bluetooth links, including: detecting that the median is less than the second preset time interval; wherein the data transmission time interval of the target Bluetooth link is less than the median.

[0011] By adopting this technical solution, it is possible to ensure the use of the original application as much as possible while ensuring that the load of each Bluetooth link does not affect the performance of the terminal device.

[0012] In some possible implementations, before calculating the median of the data transmission time intervals of the multiple Bluetooth links, it also includes: detecting whether the smallest data transmission time interval among the data transmission time intervals of the multiple Bluetooth links is greater than a third preset time interval, wherein the third preset time interval is less than the second preset time interval; calculating the median of the data transmission time intervals of the multiple Bluetooth links includes: when detecting that the smallest data transmission time interval among the data transmission time intervals of the multiple Bluetooth links is greater than the third preset time interval, calculating the median of the data transmission time intervals of the multiple Bluetooth links.

[0013] By adopting this technical solution, it can be more accurately ensured that the load of each Bluetooth link will not affect the performance of the terminal device.

[0014] In some possible implementations, when it is detected that the median is less than the second preset time interval, an application matching the target Bluetooth link is obtained in the following manner: when it is detected that the median is less than the second preset time interval, the smallest data transmission time intervals among all data transmission time intervals are filtered out one by one in order from small to large until the median of the remaining data transmission time intervals is greater than or equal to the second preset time interval; the Bluetooth link corresponding to the filtered data transmission time is taken as the target Bluetooth link, and the application matching the target Bluetooth link is obtained.

[0015] By adopting this technical solution, it is possible to ensure the use of the original application as much as possible while ensuring that the load of each Bluetooth link does not affect the performance of the terminal device.

[0016] In some possible implementations, the adjusting or prompting the user to adjust the Bluetooth resources of the target Bluetooth link includes: adjusting the data transmission time interval of the target Bluetooth link to a fifth preset time interval; or prompting the user to adjust the data transmission time interval of the target Bluetooth link to the fifth preset time interval; or sending a first confirmation message to the Bluetooth device for adjusting the data transmission time interval of the target Bluetooth link to the fifth preset time interval, wherein the fifth preset time interval is used to make the Bluetooth link meet the preset load requirement.

[0017] By adopting this technical solution, different methods can be selected to improve the connection resources of the target Bluetooth link.

[0018] In some possible implementations, the obtaining of the Bluetooth resource occupancy information of each of the multiple Bluetooth links includes: before starting a time synchronization or ranging process with the Bluetooth device, obtaining the Bluetooth resource occupancy information of each of the multiple Bluetooth links; and starting a preset performance test process includes: starting a time synchronization or ranging process with the Bluetooth device.

[0019] By adopting this technical solution, it is possible to achieve time synchronization or distance measurement between a terminal device and a Bluetooth device.

[0020] In some possible implementations, before initiating the time synchronization or ranging process with the Bluetooth device, it also includes: selecting a Bluetooth link from the multiple Bluetooth links as a test link; setting the data transmission time interval of the test link to a fourth preset time interval; the fourth preset time interval is less than or equal to the first preset time interval.

[0021] By adopting this technical solution, the ranging speed between the terminal device and the Bluetooth device can be improved while ensuring the ranging accuracy between the terminal device and the Bluetooth device.

[0022] The second aspect of the present application discloses a computer-readable storage medium, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes any one of the methods in the first aspect.

[0023] The third aspect of the present application discloses an electronic device, which includes a processor and a memory, wherein the memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the electronic device executes any one of the methods in the first aspect above.

[0024] In a fourth aspect, the present application discloses a computer program product, comprising: a computer program code, and when the computer program code is executed by a device, the device executes any one of the methods in the first aspect.

[0025] It can be understood that the computer-readable storage medium of the second aspect, the electronic device of the third aspect, and the computer program product of the fourth aspect provided above all correspond to the method of the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A flowchart of a Bluetooth resource management method provided in an embodiment of the present application;

[0027] Figure 2 A flowchart of a Bluetooth resource management method provided in an embodiment of the present application;

[0028] Figure 3 A flowchart of a Bluetooth resource management method provided in an embodiment of the present application;

[0029] Figure 4 A flowchart of a Bluetooth resource management method provided in an embodiment of the present application;

[0030] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0032] It should be further noted that, in this article, the terms "comprises", "includes" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0033] In this application, "at least one" means one or more, and "more than one" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.

[0034] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0035] To facilitate understanding, some illustrations of concepts related to the embodiments of the present application are given by way of example for reference.

[0036] The terminal device may include but is not limited to mobile phones, smart TVs, smart speakers, wearable devices, tablet computers, desktop computers, all-in-one computers, handheld computers, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), laptop computers, mobile computers, augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, vehicle-mounted devices, and any other terminal devices or portable terminal devices.

[0037] Please refer to Figure 1 , is a flow chart of a Bluetooth resource management method provided in an embodiment of the present application. This embodiment is applied to a terminal device having multiple Bluetooth links, such as Figure 1 As shown, the following steps are included:

[0038] Step 101: The terminal device obtains Bluetooth resource occupancy information of multiple Bluetooth links.

[0039] In some embodiments, the Bluetooth resource occupancy information includes a data transmission time interval. Specifically, after the terminal device is connected to the Bluetooth device, data is transmitted between the terminal device and the Bluetooth device through a Bluetooth link. The shorter the data transmission time interval between the terminal device and the Bluetooth device, the greater the load of the Bluetooth link. For example, when the terminal device is connected to a Bluetooth headset and music is played, the data transmission time interval between the terminal device and the Bluetooth headset is very short, that is, the load of the Bluetooth link between the terminal device and the Bluetooth headset is large; conversely, if the data transmission time interval between the terminal device and the Bluetooth device is longer, it indicates that the load of the Bluetooth link is smaller. For example, when the terminal device is connected to a Bluetooth bracelet, the data transmission time interval between the terminal device and the Bluetooth bracelet is longer, that is, the load of the Bluetooth link between the terminal device and the Bluetooth bracelet is small.

[0040] In some embodiments, there is no limit on the number of Bluetooth links of the terminal device, and the terminal device may include three Bluetooth links, five Bluetooth links, etc.

[0041] Step 102: The terminal device determines whether multiple Bluetooth links meet the preset resource load requirements based on the Bluetooth resource occupancy information of each Bluetooth link. When multiple Bluetooth links meet the preset resource load requirements, execute step 103; when a target Bluetooth link that does not meet the preset resource load requirements is detected among the multiple Bluetooth links, execute step 104.

[0042] In some embodiments, taking the Bluetooth resource occupancy information including the data transmission time interval as an example, detecting whether multiple Bluetooth links meet the preset resource load requirements according to the Bluetooth resource occupancy information may be: detecting whether each data transmission time interval is greater than or equal to the first preset time interval. If the data transmission time interval is greater than or equal to the first preset time interval, it indicates that the Bluetooth link corresponding to the data transmission time interval meets the preset resource load requirements; if the data transmission time interval is less than the first preset time interval, it indicates that the Bluetooth link corresponding to the data transmission time interval does not meet the preset resource load requirements.

[0043] In some embodiments, the value range of the first preset time interval can be any value between 7.5 milliseconds and 4 seconds, and can be set according to actual needs.

[0044] In some embodiments, the value of the first preset time interval is related to the number of target Bluetooth links. For example, when there are multiple target Bluetooth links, the first preset time interval is T1; when there is one target Bluetooth link, the first preset time interval is T2, and T1 is greater than or equal to T2.

[0045] In some embodiments, the Bluetooth resource occupancy information may also be the size of the data packet transmitted by the Bluetooth link per unit time. Assuming that the terminal device needs to transmit a 10-megabyte data packet to the Bluetooth device, the terminal device detects whether multiple Bluetooth links meet the preset resource load requirements based on the Bluetooth resource occupancy information. The method may be: separately detecting the time required for each Bluetooth link to transmit a 10-megabyte data packet to the Bluetooth device. If the transmission time of each Bluetooth link is less than the preset transmission time, then whether multiple Bluetooth links meet the preset resource load requirements.

[0046] Step 103: The terminal device starts a preset performance test process.

[0047] In some embodiments, starting the preset performance test process is: starting the time synchronization or distance measurement process with the Bluetooth device. Specifically, taking the start of the distance measurement process with the Bluetooth device as an example, the distance measurement application between the terminal device and the Bluetooth device is very extensive, such as mobile tracking, lost property search, door lock proximity detection, home smart audio and video, etc. The distance measurement process in this embodiment is a one-way distance measurement. The one-way distance measurement does not require both the terminal device and the Bluetooth device to have receiving and sending functions, so the functional requirements of the Bluetooth device are relatively low, but the one-way distance measurement requires the timing synchronization of the terminal device and the Bluetooth device, that is, the clocks of the terminal device and the Bluetooth device are kept consistent.

[0048] Therefore, before the distance measurement process between the terminal device and the Bluetooth device is carried out, the terminal device and the Bluetooth device need to be accurately timed and calibrated. Time calibration requires that all Bluetooth links of the terminal device have a low load. If the load of a Bluetooth link of the terminal device is high, it may cause the terminal device to receive and feedback the signal sent by the Bluetooth device in a delayed manner, resulting in the time accuracy of the terminal device and the Bluetooth device being affected, and then resulting in the low accuracy of the result of the distance measurement process.

[0049] It can be understood that the aforementioned steps can detect that the target Bluetooth link of the terminal device does not meet the preset load requirements. In the subsequent steps, the Bluetooth resources of the target Bluetooth link will be adjusted so that all Bluetooth links of the terminal device can meet the preset load requirements, thereby improving the accuracy of the results of the ranging process.

[0050] In some embodiments, before starting the ranging process with the Bluetooth device, it also includes: selecting a Bluetooth link from multiple Bluetooth links as a test link; setting the data transmission time interval of the test link to a fourth preset time interval, wherein the fourth preset time interval is less than or equal to the first preset time interval.

[0051] Specifically, the terminal device selects a Bluetooth link from multiple Bluetooth links as a test link according to the Bluetooth protocol, and sets the data transmission time interval of the test link to a fourth preset time interval. Since the fourth preset time interval is less than or equal to the first preset time interval, the data transmission speed between the test links is faster, which can improve the ranging speed between the terminal device and the Bluetooth device while ensuring the ranging accuracy between the terminal device and the Bluetooth device.

[0052] In some embodiments, according to the Bluetooth protocol, the value range of the fourth preset time interval is any value between 7.5 milliseconds and 4 seconds, and the fourth preset time interval is preferably a multiple of 1.25 milliseconds.

[0053] Step 104: The terminal device obtains an application that matches the target Bluetooth link.

[0054] In some embodiments, assuming that the target Bluetooth link is Bluetooth link A, and application B occupies the Bluetooth resources of Bluetooth link A, then the application matching Bluetooth link A is application B.

[0055] In some embodiments, there may be one or more applications that match the target Bluetooth link. Specifically, multiple applications can use the same target Bluetooth link for data transmission at the same time.

[0056] Step 105: The terminal device closes or prompts the user to close the application program acquired in step 104, or adjusts or prompts the user to adjust the Bluetooth resources of the target Bluetooth link.

[0057] In some embodiments, the terminal device can directly close the application to release the Bluetooth resources of the target Bluetooth link.

[0058] In some embodiments, the terminal device executes step 103 after directly closing the application.

[0059] In some embodiments, the terminal device displays second confirmation information for prompting the user to close the application. The user operates the displayed second confirmation information, and the terminal device closes the application in response to the user's operation.

[0060] In some embodiments, after the terminal device closes the application in response to a user operation, step 103 is executed.

[0061] Specifically, the type of the second confirmation information can be voice broadcast, pop-up window, etc. Taking the second confirmation information as "pop-up window" as an example, a confirmation window pops up on the display interface of the terminal device, and after the user clicks the "Confirm" button, the terminal device closes the application to release the Bluetooth resources of the target Bluetooth link.

[0062] It is understandable that the user does not need to operate the second confirmation information. For example, after a confirmation window pops up on the display interface of the terminal device, the user does not need to perform any operation on the confirmation window. The terminal device automatically closes the application after a preset length of time after the confirmation window pops up.

[0063] In some embodiments, adjusting or prompting the user to adjust the Bluetooth resources of the target Bluetooth link includes: adjusting the data transmission time interval of the target Bluetooth link to a fifth preset time interval; or prompting the user to adjust the data transmission time interval of the target Bluetooth link to the fifth preset time interval; or sending a first confirmation message to the Bluetooth device for adjusting the data transmission time interval of the target Bluetooth link to the fifth preset time interval, wherein the fifth preset time interval is used to make the Bluetooth link meet the preset load requirement.

[0064] Specifically, the terminal device directly adjusts the data transmission time interval of the target Bluetooth link to the fifth preset time interval; or the terminal device prompts the user to adjust the data transmission time interval of the target Bluetooth link to the fifth preset time interval through voice broadcast, pop-up window, etc.; or the terminal device sends a first confirmation message to the Bluetooth device, and the Bluetooth device itself determines whether to agree to change the data transmission time interval to the fifth preset time interval. If the determination result of the Bluetooth device is agreement, the Bluetooth device returns a confirmation message to the terminal device, and after receiving the confirmation message, the terminal device changes the data transmission time interval to the fifth preset time interval.

[0065] In some embodiments, after the terminal device adjusts the data transmission time interval of the target Bluetooth link to the fifth preset time interval, step 103 is performed.

[0066] In some embodiments, the fifth preset time interval is equal to the first preset time interval mentioned above, thereby ensuring that the target communication link after adjusting the data transmission time interval meets the preset resource load requirement.

[0067] In some embodiments, there is no specific limitation on the size of the fifth preset time interval. It is only necessary to ensure that the target communication link after adjusting the data transmission time interval does not affect the preset performance test process of the terminal device.

[0068] For ease of understanding, the following takes the preset performance test process as an example of the distance measurement process with a Bluetooth device. Figure 2 The Bluetooth resource management method of this embodiment is described in detail.

[0069] Please refer to Figure 2 , which is a flowchart of the Bluetooth resource management method.

[0070] Step 1001: The terminal device obtains the data transmission time interval of each Bluetooth link.

[0071] Specifically, before the terminal device starts the time calibration with the Bluetooth device, the load condition of each Bluetooth link in the terminal device is first obtained, such as the data transmission time interval of each Bluetooth link data packet.

[0072] Step 1002: The terminal device detects whether the time intervals of all data transmissions are greater than or equal to the first preset time interval. When the terminal device detects that the time intervals of all data transmissions are greater than or equal to the first preset time interval, execute step 1003; otherwise, execute step 1004.

[0073] Step 1003: The terminal device starts a distance measurement process with the Bluetooth device.

[0074] Specifically, if all data transmission time intervals are greater than or equal to the first preset time interval, indicating that the loads of all current Bluetooth links of the terminal device are low, the terminal device maintains a normal ranging process, ie, starts the time calibration with the Bluetooth device.

[0075] Step 1004: The terminal device filters out target applications in the Bluetooth link that is less than a first preset time interval.

[0076] Step 1005: The terminal device interrupts the target application and starts a distance measurement process with the Bluetooth device.

[0077] Step 1006: The application interface of the terminal device displays a confirmation message prompting the user to close the target application. After the terminal device detects the user's confirmation operation, step 1007 is executed; otherwise, step 1008 is executed.

[0078] Step 1007: The terminal device starts the distance measurement process with the Bluetooth device.

[0079] Step 1008: The terminal device does not start the distance measurement process with the Bluetooth device.

[0080] Regarding steps 1005 to 1008, specifically, if there are some Bluetooth links whose data transmission time interval is less than the first preset time interval, the target applications corresponding to these target Bluetooth links are screened out. Assuming that the data transmission time interval of Bluetooth link M is less than the first preset time interval, the application corresponding to Bluetooth link M is application N. There are two parallel processing methods as follows, and the terminal device selects one of them for processing:

[0081] 1. As described in step 1005, the terminal device directly closes the application N to ensure the accuracy of time synchronization, thereby ensuring the accuracy of ranging;

[0082] 2. As described in steps 1006 to 1008, a confirmation window pops up on the display interface of the terminal device. After the user clicks the "Confirm" button, the terminal device closes application N and maintains the normal ranging process. After the user clicks the "Cancel" button, the terminal device notifies the Bluetooth device that the ranging process has failed.

[0083] Understandably, Figure 2 The description is about an application scenario in which a terminal device closes or prompts a user to close an application. In actual application, the terminal device may also adjust or prompt a user to adjust the Bluetooth resources of a Bluetooth link.

[0084] Specifically, when the terminal device detects that there is a target Bluetooth link with a data transmission time interval less than the first preset time interval, the terminal device directly changes the data transmission time interval of the target Bluetooth link to the fifth preset time interval; or, the terminal device sends a time interval change request to the Bluetooth device, and the Bluetooth device itself determines whether to agree to change the data transmission time interval of the Bluetooth link M. If the determination result of the Bluetooth device is agreement, the Bluetooth device returns a confirmation message to the terminal device. After receiving the confirmation message, the terminal device changes the data transmission time interval of the Bluetooth link M to maintain the normal ranging process.

[0085] Compared with the related art, the embodiments of the present application have at least the following advantages: by detecting whether each Bluetooth link meets the preset resource load requirements based on the Bluetooth resource occupancy information, when a target communication link that does not meet the preset resource load requirements is detected, it is possible to close or prompt the user to close the application that matches the target Bluetooth link, and it is also possible to adjust or prompt the user to adjust the Bluetooth resources of the target Bluetooth link so that each Bluetooth link can meet the preset resource load requirements, thereby ensuring that the load of the Bluetooth link will not affect the performance of the terminal device, thereby making the preset performance test process more accurate.

[0086] Please refer to Figure 3 , is a flowchart of Bluetooth resource management provided by an embodiment of the present application. This embodiment is a further improvement of the above-mentioned embodiment. The main improvement is that: in this embodiment, if there is a target Bluetooth link whose data transmission time interval is less than the first preset time interval, the median of all data transmission time intervals will be calculated. If the median is greater than or equal to the second preset time interval, the preset performance test process will still be started. In this way, the use of the original application can be guaranteed as much as possible while ensuring that the load of each Bluetooth link does not affect the performance of the terminal device.

[0087] This embodiment is applied to the terminal device side, such as Figure 3 As shown, the following steps are included:

[0088] Step 201: The terminal device obtains the data transmission time interval of each Bluetooth link among multiple Bluetooth links.

[0089] Step 202: The terminal device detects whether each data transmission time interval is greater than or equal to the first preset time interval. If multiple data transmission time intervals are greater than or equal to the first preset time interval, execute step 203; if a target Bluetooth link with a data transmission time interval less than the first preset time interval is detected among multiple Bluetooth links, execute step 204.

[0090] Step 203: The terminal device starts a preset performance test process.

[0091] Step 204: The terminal device calculates the median of all data transmission time intervals.

[0092] In some embodiments, before calculating the median of the data transmission time intervals corresponding to all Bluetooth links, it also includes: detecting whether the smallest data transmission time interval among all data transmission time intervals is greater than a third preset time interval, and when detecting that the smallest data transmission time interval among all data transmission time intervals is greater than the third preset time interval, calculating the median of all data transmission time intervals. In this way, it can be more accurately ensured that the load of each Bluetooth link will not affect the performance of the terminal device.

[0093] It is understandable that, if it is detected that the smallest data transmission time interval among all data transmission time intervals is less than or equal to the third preset time interval, the smallest data transmission time interval is screened out until the remaining data transmission time intervals are all greater than the third preset time interval. The Bluetooth link corresponding to the screened data transmission time interval is used as the target Bluetooth link.

[0094] For ease of understanding, the following example illustrates how to calculate the median of the data transmission time intervals corresponding to all Bluetooth links in this embodiment:

[0095] Assuming that the third preset time interval is 500 milliseconds, the terminal device has a total of 5 Bluetooth links, and the data transmission time intervals of each Bluetooth link are 600 milliseconds, 1 second, 1.5 seconds, 2 seconds, and 5 seconds respectively; then the minimum data transmission time interval is 600 milliseconds, which is greater than 500 milliseconds; the median of the above data transmission time intervals is 1.5 seconds.

[0096] In some embodiments, the third preset time interval is smaller than the second preset time interval, and the value range of the third preset time interval can be any value between 7.5 milliseconds and 4 seconds.

[0097] Step 205: The terminal device detects whether the median is greater than or equal to the second preset time interval. When it is detected that the median is greater than or equal to the second preset time interval, step 203 is executed; when it is detected that the median is less than the second preset time interval, step 206 is executed.

[0098] In some embodiments, the second preset time interval is smaller than the first preset time interval, and the value range of the second preset time interval can be any value between 7.5 milliseconds and 4 seconds.

[0099] In some embodiments, when it is detected that the median is less than the second preset time interval, the smallest data transmission time intervals among all data transmission time intervals are screened out one by one in ascending order until the median of the remaining data transmission time intervals is greater than or equal to the second preset time interval. Then, the Bluetooth link corresponding to the screened data transmission time interval is used as the target Bluetooth link.

[0100] For ease of understanding, the following example illustrates how to detect a target Bluetooth link in this embodiment:

[0101] Assume that the second preset time interval is 300 milliseconds, the terminal device has a total of 5 Bluetooth links, and the data transmission time intervals of Bluetooth links AE are 80 milliseconds, 100 milliseconds, 240 milliseconds, 760 milliseconds, and 3 seconds respectively. At this time, the median is 240 milliseconds, which is less than 300 milliseconds. The data transmission time interval of 80 milliseconds corresponding to Bluetooth link A is screened out, and the median of the remaining data transmission time intervals is calculated; the remaining data transmission time intervals are 100 milliseconds, 240 milliseconds, 760 milliseconds, and 3 seconds, and the median is 500 milliseconds, which is greater than 300 milliseconds, then the screened Bluetooth link A is used as the target Bluetooth link.

[0102] Step 206: The terminal device obtains an application that matches the target Bluetooth link.

[0103] Step 207: The terminal device closes or prompts the user to close the application program acquired in step 206, or adjusts or prompts the user to adjust the Bluetooth resources of the target Bluetooth link.

[0104] In some embodiments, the terminal device executes step 203 after closing the application or adjusting the Bluetooth resources of the target Bluetooth link.

[0105] For ease of understanding, the following takes the preset performance test process as an example of the distance measurement process with a Bluetooth device. Figure 4 The Bluetooth resource management method of this embodiment is described in detail.

[0106] Please refer to Figure 4 , which is a flowchart of the Bluetooth resource management method.

[0107] Step 2001: The terminal device obtains the data transmission time interval of each Bluetooth link.

[0108] Specifically, before the terminal device starts the time calibration with the Bluetooth device, the load condition of each Bluetooth link in the terminal device is first obtained, such as the data transmission time interval of each Bluetooth link data packet.

[0109] Step 2002: The terminal device detects whether the time intervals of all data transmissions are greater than or equal to the first preset time interval. When the terminal device detects that the time intervals of all data transmissions are greater than or equal to the first preset time interval, execute step 2003; otherwise, execute step 2005.

[0110] Step 2003: The terminal device starts the distance measurement process with the Bluetooth device.

[0111] Step 2004: The terminal device sets the data transmission time interval of the Bluetooth link that needs to be synchronized to the fifth preset time interval.

[0112] Regarding steps 2003 to 2004, specifically, if all data transmission time intervals are greater than or equal to the first preset time interval, indicating that the loads of all current Bluetooth links of the terminal device are low, the normal ranging process is maintained, the time synchronization calibration with the Bluetooth device is started, and the data transmission time interval of the Bluetooth link that needs to be synchronized is set to the fifth preset time interval.

[0113] Step 2005: The terminal device calculates the median of all data transmission time intervals.

[0114] Step 2006: The terminal device detects whether the median is greater than or equal to the second preset time interval. If the median is greater than or equal to the second preset time interval, execute step 2003; otherwise, execute step 2007.

[0115] Regarding steps 2005 to 2006, specifically, if there are some Bluetooth links whose data transmission time interval is less than the first preset time interval, calculate the median of the data transmission time intervals of all Bluetooth links, and determine whether the median is greater than or equal to the second preset time interval. If the median is greater than or equal to the second preset time interval, maintain the normal ranging process, start the time synchronization calibration with the Bluetooth device, and set the data transmission time interval of the Bluetooth link that needs to be synchronized to the fifth preset time interval.

[0116] Step 2007: The terminal device selects the smallest data transmission time interval from all data transmission time intervals one by one in ascending order, calculates the median of the remaining data transmission time intervals, and returns to step 2006.

[0117] Specifically, if the median is less than the second preset time interval, the smallest data transmission time intervals among all data transmission time intervals are filtered out one by one in ascending order until the median of the remaining data transmission time intervals is greater than or equal to the second preset time interval, and the Bluetooth link corresponding to the filtered data transmission time interval is used as the target Bluetooth link.

[0118] Step 2008: The terminal device uses the Bluetooth link corresponding to the screened data transmission time interval as the target Bluetooth link, and obtains a target application matching the target Bluetooth link.

[0119] Step 2009: The terminal device interrupts the target application and starts a distance measurement process with the Bluetooth device.

[0120] Step 210: The application interface of the terminal device displays a confirmation message prompting the user to close the target application. After the terminal device detects the user's confirmation operation, step 2012 is executed; otherwise, step 2013 is executed.

[0121] Step 2011: The terminal device starts the distance measurement process with the Bluetooth device.

[0122] Step 2012: The terminal device does not start the distance measurement process with the Bluetooth device.

[0123] Regarding step 2009 to step 2012, specifically, assuming that the Bluetooth link P is the target Bluetooth link and the application corresponding to the Bluetooth link P is the application Q, there are two parallel processing methods as follows, and the terminal device selects one of them for processing:

[0124] 1. As described in steps 2010 to 2012, a confirmation window pops up on the display interface of the terminal device. After the user clicks the "Confirm" button, the terminal device closes application Q and maintains the normal ranging process. After the user clicks the "Cancel" button, the terminal device notifies the Bluetooth device that the ranging process has failed.

[0125] 2. As described in step 2009, the terminal device directly closes the application Q to ensure the accuracy of time synchronization, thereby ensuring the accuracy of distance measurement.

[0126] Understandably, Figure 4 The description is about an application scenario in which a terminal device closes or prompts a user to close an application. In actual application, the terminal device may also adjust or prompt a user to adjust the Bluetooth resources of a Bluetooth link.

[0127] Specifically, when the terminal device detects that there is a target Bluetooth link with a data transmission time interval less than the first preset time interval, the terminal device directly changes the data transmission time interval of the target Bluetooth link to the fifth preset time interval; or, the terminal device sends a time interval change request to the Bluetooth device, and the Bluetooth device itself determines whether to agree to change the data transmission time interval of the Bluetooth link P. If the determination result of the Bluetooth device is agreement, the Bluetooth device returns a confirmation message to the terminal device. After receiving the confirmation message, the terminal device changes the data transmission time interval of the Bluetooth link P to maintain the normal ranging process.

[0128] Compared with the related art, the embodiments of the present application have at least the following advantages: by detecting whether each Bluetooth link meets the preset resource load requirements based on the Bluetooth resource occupancy information, when a target communication link that does not meet the preset resource load requirements is detected, it is possible to close or prompt the user to close the application that matches the target Bluetooth link, and it is also possible to adjust or prompt the user to adjust the Bluetooth resources of the target Bluetooth link so that each Bluetooth link can meet the preset resource load requirements, thereby ensuring that the load of the Bluetooth link will not affect the performance of the terminal device, thereby making the preset performance test process more accurate.

[0129] Please refer to Figure 5, is a schematic diagram of the hardware structure of the electronic device 1000 provided in the embodiment of the present application. Figure 5 As shown, the electronic device 1000 may include a processor 1001 and a memory 1002. The memory 1002 is used to store one or more computer programs 1003. The one or more computer programs 1003 are configured to be executed by the processor 1001. The one or more computer programs 1003 include instructions, and the above instructions can be used to implement the above Bluetooth resource management method in the electronic device 1000.

[0130] It is understandable that the structure shown in this embodiment does not constitute a specific limitation on the electronic device 1000. In other embodiments, the electronic device 1000 may include more or fewer components than shown, or combine or separate some components, or arrange the components differently.

[0131] The processor 1001 may include one or more processing units, for example, the processor 1001 may include an application processor (AP), a modem, 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), etc. Different processing units may be independent devices or integrated into one or more processors.

[0132] The processor 1001 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 1001 is a cache memory. The memory may store instructions or data that the processor 1001 has just used or circulated. If the processor 1001 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 1001, and thus improves the efficiency of the system.

[0133] In some embodiments, the processor 1001 may include one or more interfaces. The interface may 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 SIM interface, and / or a USB interface, etc.

[0134] In some embodiments, memory 1002 may include high-speed random access memory and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0135] This embodiment further provides a computer-readable storage medium, in which computer instructions are stored. When the instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the Bluetooth resource management method in the above-mentioned embodiment.

[0136] Among them, the electronic device and computer storage medium provided in this embodiment are used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0137] In practical applications, the above functions can be distributed to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0138] In several embodiments provided in the present application, the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are schematic. For example, the division of the modules or units is a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0139] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.

[0140] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.

[0142] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.

Claims

1. A Bluetooth resource management method, characterized in that: Applied to a terminal device having multiple Bluetooth links, the method comprises: Obtaining Bluetooth resource occupancy information of each Bluetooth link in the multiple Bluetooth links; Determining whether the plurality of Bluetooth links all meet a preset resource load requirement according to the Bluetooth resource occupancy information of each Bluetooth link; When the plurality of Bluetooth links all meet the preset resource load requirement, starting a preset performance test process; When a target Bluetooth link that does not meet the preset resource load requirement is detected among the multiple Bluetooth links, a target application matching the target Bluetooth link is closed or the user is prompted to close, or the Bluetooth resources of the target Bluetooth link are adjusted or the user is prompted to adjust.

2. The method according to claim 1, characterized in that The Bluetooth resource occupancy information includes a data transmission time interval; The obtaining of the Bluetooth resource occupancy information of each Bluetooth link in the plurality of Bluetooth links includes: The data transmission time interval of each Bluetooth link in the multiple Bluetooth links is obtained, wherein one Bluetooth link corresponds to one data transmission time interval.

3. The method according to claim 2, characterized in that The determining, according to the Bluetooth resource occupancy information of each Bluetooth link, whether the plurality of Bluetooth links all meet the preset load requirement includes: respectively detecting whether a data transmission time interval of each Bluetooth link is greater than or equal to a first preset time interval; The multiple Bluetooth links all meet the preset resource load requirement, including: the data transmission time interval of each Bluetooth link is greater than or equal to the first preset time interval; A target Bluetooth link that does not meet the preset resource load requirement is detected among the multiple Bluetooth links, including: detecting that the data transmission time interval of the target Bluetooth link is less than the first preset time interval, wherein the target Bluetooth link is one or more of the multiple Bluetooth links.

4. The method according to claim 2, characterized in that The determining, according to the Bluetooth resource occupancy information of each Bluetooth link, whether the plurality of Bluetooth links all meet the preset load requirement includes: Calculating the median of the data transmission time intervals of the multiple Bluetooth links; Detecting whether the median is greater than or equal to a second preset time interval; The plurality of Bluetooth links all satisfy the preset resource load requirement, including: the median is greater than or equal to the second preset time interval; The target Bluetooth link that does not meet the preset resource load requirement is detected in the multiple Bluetooth links, including: It is detected that the median is smaller than the second preset time interval; wherein the data transmission time interval of the target Bluetooth link is smaller than the median.

5. The method according to claim 4, characterized in that Before calculating the median of the data transmission time intervals of the plurality of Bluetooth links, the method further includes: Detecting whether the smallest data transmission time interval among the data transmission time intervals of the multiple Bluetooth links is greater than a third preset time interval, wherein the third preset time interval is less than the second preset time interval; The calculating the median of the data transmission time intervals of the plurality of Bluetooth links comprises: When it is detected that the smallest data transmission time interval among the data transmission time intervals of the multiple Bluetooth links is greater than the third preset time interval, a median of the data transmission time intervals of the multiple Bluetooth links is calculated.

6. The method according to claim 4 or 5, characterized in that When it is detected that the median is less than the second preset time interval, an application matching the target Bluetooth link is obtained in the following manner: When it is detected that the median is less than the second preset time interval, the smallest data transmission time intervals among all the data transmission time intervals are screened out one by one in ascending order until the median of the remaining data transmission time intervals is greater than or equal to the second preset time interval; The filtered Bluetooth link corresponding to the data transmission time is used as the target Bluetooth link, and the application matching the target Bluetooth link is acquired.

7. The method according to any one of claims 2 to 6, characterized in that: The adjusting or prompting the user to adjust the Bluetooth resources of the target Bluetooth link includes: adjusting the data transmission time interval of the target Bluetooth link to a fifth preset time interval; or Prompting the user to adjust the data transmission time interval of the target Bluetooth link to the fifth preset time interval; or Sending, to the Bluetooth device, first confirmation information for adjusting the data transmission time interval of the target Bluetooth link to a fifth preset time interval; The fifth preset time interval is used to make the Bluetooth link meet the preset load requirement.

8. The method according to any one of claims 1 to 7, characterized in that: The obtaining of the Bluetooth resource occupancy information of each Bluetooth link in the multiple Bluetooth links includes: Before starting a time synchronization or distance measurement process with a Bluetooth device, obtaining Bluetooth resource occupancy information of each Bluetooth link in the multiple Bluetooth links; The starting of the preset performance test process includes: Start the time synchronization or distance measurement process with the Bluetooth device.

9. The method according to claim 8, characterized in that Before starting the time synchronization or distance measurement process with the Bluetooth device, the method further includes: Selecting a Bluetooth link from the multiple Bluetooth links as a test link; The data transmission time interval of the test link is set to a fourth preset time interval; the fourth preset time interval is less than or equal to the first preset time interval.

10. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 9.

11. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the electronic device executes the method according to any one of claims 1 to 9.