Bluetooth scanning method and device, terminal and storage medium
By determining the Bluetooth scanning strategy on the terminal based on the needs of the application, especially prohibiting Bluetooth scanning through the Bluetooth proxy unit when the screen is turned off, the problem of excessive power consumption caused by the application's frequent call to the Bluetooth scanning unit is solved, and the improvement of the User experience.
Patent Information
- Application Number
- CN202310552111.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-16
- Publication Date
- 2024-11-22
AI Technical Summary
In the prior art, even if the terminal is in a screen-out state, the application frequently calls the Bluetooth scanning unit, resulting in excessive power consumption and affecting the user experience.
Provide a Bluetooth scanning method to determine the Bluetooth scanning strategy according to the needs of the application, including prohibiting Bluetooth scanning when the terminal is in the screen-out state, or performing Bluetooth scanning through the Bluetooth proxy unit and stopping when the scanning continues until the set time, ensuring that Scan when the terminal meets certain conditions.
It reduces the power consumption of the terminal, improves the user experience, and avoids the battery consumption problems caused by frequent Bluetooth scanning.
Smart Images

Figure CN119012318A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of terminal technology, and in particular to a Bluetooth scanning method, device, terminal and storage medium. Background Art
[0002] Bluetooth technology is an open global specification for wireless data and voice communications. It is a special short-range wireless technology connection based on low-cost short-range wireless connection to establish a communication environment for fixed and mobile devices. Bluetooth technology enables some current portable mobile devices and computer devices to connect to the Internet without cables and can access the Internet wirelessly.
[0003] With the popularization of Bluetooth technology, more and more applications can call the Bluetooth scanning unit of the terminal to perform Bluetooth scanning. At present, even if the terminal is in the off-screen state, the application will still call the Bluetooth scanning unit for Bluetooth scanning at a high frequency, resulting in excessive power consumption of the terminal, which seriously affects the user experience. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a Bluetooth scanning method, device, terminal and storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a Bluetooth scanning method is provided, which is applied to a terminal. The Bluetooth scanning method includes:
[0006] When the application has a Bluetooth scanning requirement, determining a Bluetooth scanning strategy according to the application;
[0007] According to the Bluetooth scanning strategy, Bluetooth scanning is controlled.
[0008] Optionally, when the application is a first setting application, controlling the Bluetooth scanning according to the Bluetooth scanning strategy includes:
[0009] Call the Bluetooth scanning unit;
[0010] If it is determined that the terminal is in the setting state, Bluetooth scanning is prohibited.
[0011] Optionally, when the application is a second set application, performing Bluetooth scanning according to the Bluetooth scanning strategy includes:
[0012] Determining that the terminal is in a setting state;
[0013] Call the Bluetooth agent unit to perform Bluetooth scanning.
[0014] Optionally, after calling the Bluetooth agent unit to perform Bluetooth scanning, the Bluetooth scanning method includes:
[0015] If the Bluetooth scanning continues for a set time, the Bluetooth agent unit is stopped from being called to prohibit the Bluetooth scanning.
[0016] Optionally, before calling the Bluetooth agent unit, the Bluetooth scanning method includes:
[0017] It is determined that the terminal meets a Bluetooth scanning condition.
[0018] Optionally, the determining that the terminal meets a Bluetooth scanning condition includes at least one of the following:
[0019] Determining that the terminal is allowed to use the Bluetooth proxy unit;
[0020] Determine that the total number of scans for the whole day for calling the Bluetooth scanning unit to perform Bluetooth scanning is less than or equal to the set number;
[0021] If the terminal is playing audio, determining that the audio encoding mode is a set mode;
[0022] Determining that the second setting application has authorized Bluetooth scanning permission;
[0023] Determining that the terminal does not use the Bluetooth function to transfer files;
[0024] Determining that the terminal does not use the Bluetooth function to make a voice call;
[0025] Determining that the terminal is not in power saving mode;
[0026] Determining that no Bluetooth device initiates a backconnection to the terminal;
[0027] Determining that the Bluetooth function of the terminal is turned on;
[0028] Determining that the terminal is in a state allowing Bluetooth scanning;
[0029] Determine that the terminal is in Bluetooth low latency mode.
[0030] Optionally, the Bluetooth scanning method includes:
[0031] When it is determined that the terminal does not meet the Bluetooth scanning condition,
[0032] prohibiting calling the Bluetooth proxy unit; and / or,
[0033] The reason why the Bluetooth scanning condition is not met is returned to the second setting application.
[0034] Optionally, the set state includes that the display screen of the terminal is in an off state.
[0035] According to a second aspect of an embodiment of the present disclosure, a Bluetooth scanning device is provided, which is applied to a terminal, and the Bluetooth scanning device includes:
[0036] A determination module, used to determine a Bluetooth scanning strategy according to the application when the application has a Bluetooth scanning requirement;
[0037] The control module is used to control the Bluetooth scanning according to the Bluetooth scanning strategy.
[0038] Optionally, when the application is a first application, the control module is used to:
[0039] Call the Bluetooth scanning unit;
[0040] If it is determined that the terminal is in the setting state, Bluetooth scanning is prohibited.
[0041] Optionally, when the application is a second application, the control module is configured to:
[0042] Determining that the terminal is in a setting state;
[0043] Call the Bluetooth agent unit to perform Bluetooth scanning.
[0044] Optionally, the control module is used to:
[0045] After the Bluetooth agent unit is called to perform Bluetooth scanning, if the Bluetooth scanning continues for a set time, the Bluetooth agent unit is stopped from being called to prohibit Bluetooth scanning.
[0046] Optionally, the control module is used to:
[0047] Before calling the Bluetooth proxy unit, it is determined that the terminal meets the Bluetooth scanning condition.
[0048] Optionally, the determining that the terminal meets a Bluetooth scanning condition includes at least one of the following:
[0049] Determining that the terminal is allowed to use the Bluetooth proxy unit;
[0050] Determine that the total number of scans for the whole day for calling the Bluetooth scanning unit to perform Bluetooth scanning is less than or equal to the set number;
[0051] If the terminal is playing audio, determining that the audio encoding mode is a set mode;
[0052] Determining that the second setting application has authorized Bluetooth scanning permission;
[0053] Determining that the terminal does not use the Bluetooth function to transfer files;
[0054] Determining that the terminal does not use the Bluetooth function to make a voice call;
[0055] Determining that the terminal is not in power saving mode;
[0056] Determining that no Bluetooth device initiates a backconnection to the terminal;
[0057] Determining that the Bluetooth function of the terminal is turned on;
[0058] Determining that the terminal is in a state allowing Bluetooth scanning;
[0059] Determine that the terminal is in Bluetooth low latency mode.
[0060] Optionally, the control module is used to:
[0061] When it is determined that the terminal does not meet the Bluetooth scanning condition,
[0062] prohibiting calling the Bluetooth proxy unit; and / or,
[0063] The reason why the Bluetooth scanning condition is not met is returned to the second setting application.
[0064] Optionally, the set state includes that the display screen of the terminal is in an off state.
[0065] According to a third aspect of an embodiment of the present disclosure, a terminal is provided, the terminal including:
[0066] processor;
[0067] a memory for storing instructions executable by the processor;
[0068] Wherein, the processor is configured to execute the Bluetooth scanning method as described in the first aspect.
[0069] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute the Bluetooth scanning method as described in the first aspect.
[0070] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: In the present disclosure, different Bluetooth scanning strategies may be configured for different applications. For example, for a first set application, when the terminal is in the screen-off state, the Bluetooth scanning unit may prohibit Bluetooth scanning, thereby reducing the power consumption of the terminal to a certain extent and improving the user experience. That is, the present disclosure may prevent some applications from frequently calling the Bluetooth scanning unit for scanning, thereby reducing the power consumption of the terminal and improving the user experience.
[0071] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0073] Figure 1 The figure is a flowchart of a Bluetooth scanning method according to an exemplary embodiment.
[0074] Figure 2 The figure is a flowchart of a Bluetooth scanning method according to an exemplary embodiment.
[0075] Figure 3 The figure is a flowchart of a Bluetooth scanning method according to an exemplary embodiment.
[0076] Figure 4 The figure is a flowchart of a Bluetooth scanning method according to an exemplary embodiment.
[0077] Figure 5 is a block diagram of a Bluetooth scanning device according to an exemplary embodiment.
[0078] Figure 6 is a block diagram of a terminal according to an exemplary embodiment. DETAILED DESCRIPTION
[0079] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are only examples of devices and methods of some embodiments of the present disclosure.
[0080] The embodiment of the present disclosure provides a Bluetooth scanning method, which is applied to a terminal. In the method, different Bluetooth scanning strategies can be configured for different applications. For example, for a first set application, when the terminal is in a screen-off state, the Bluetooth scanning unit can prohibit Bluetooth scanning, thereby reducing the power consumption of the terminal to a certain extent and improving the user experience. That is, the present disclosure can prevent some applications from frequently calling the Bluetooth scanning unit for scanning, thereby reducing the power consumption of the terminal and improving the user experience.
[0081] In an exemplary embodiment, a Bluetooth scanning method is provided, which is applied to a terminal. Figure 1 As shown, the method may include:
[0082] S110, when the application has a Bluetooth scanning requirement, determining a Bluetooth scanning strategy according to the application;
[0083] S120: Control Bluetooth scanning according to the Bluetooth scanning strategy.
[0084] In step S110, different applications may be configured with different Bluetooth scanning strategies. The application may include a first setting application, and the first setting application may correspond to a first Bluetooth scanning strategy. The first Bluetooth scanning strategy may refer to a strategy for performing Bluetooth scanning by directly calling a Bluetooth scanning unit. The first setting application refers to an application that can call a Bluetooth scanning unit when there is a need for Bluetooth scanning. That is, the first setting application refers to an application that can use the first Bluetooth scanning strategy to perform Bluetooth scanning. Among them, the specific type of the first setting application can be set according to actual needs and is not limited to this. Among them, the Bluetooth scanning unit may include a Bluetooth scanning interface used by the framework layer to perform Bluetooth scanning.
[0085] The application may also include a second application. The second application may correspond to a second Bluetooth scanning strategy. The second Bluetooth scanning strategy may be a strategy for performing Bluetooth scanning through a Bluetooth agent unit. The second setting application refers to an application that can call a Bluetooth scanning unit through a Bluetooth agent unit when there is a Bluetooth scanning requirement. That is, the second setting application refers to an application that can use the second Bluetooth scanning strategy to perform Bluetooth scanning. The Bluetooth agent unit refers to a unit that can perform Bluetooth scanning by calling a Bluetooth scanning unit.
[0086] It should be noted that the application program may also include other types of programs, and the corresponding Bluetooth scanning strategies may also include other strategies, which are not limited to this.
[0087] In step S120, after the Bluetooth scanning strategy corresponding to the application is determined, the Bluetooth scanning can be controlled based on the Bluetooth scanning strategy, so that different Bluetooth scanning processes can be executed for different applications.
[0088] For example, for the first application, when the terminal is in the screen-off state, Bluetooth scanning may be prohibited.
[0089] For another example, for the second application, Bluetooth scanning can be performed when the terminal is in the screen-off state.
[0090] In this method, different Bluetooth scanning strategies can be configured for different applications, which can prevent some applications from frequently calling the Bluetooth scanning unit to scan, thereby reducing the power consumption of the terminal and improving the user experience.
[0091] In an exemplary embodiment, a Bluetooth scanning method is provided, which is applied to a terminal. Figure 2 As shown, in the method, when the application is a first setting application, controlling the Bluetooth scanning according to the Bluetooth scanning strategy may include:
[0092] S210, calling the Bluetooth scanning unit;
[0093] S220: If it is determined that the terminal is in a setting state, Bluetooth scanning is prohibited.
[0094] In step S210 , the Bluetooth scanning unit may include a Bluetooth scanning interface of a framework layer for performing Bluetooth scanning.
[0095] In some embodiments,
[0096] The first setting application may include application A1 and application A2. In this embodiment, when application A1 of the terminal has a Bluetooth scanning requirement, application A1 can call the Bluetooth scanning interface of the framework layer of the terminal. When application A2 has a Bluetooth scanning requirement, application A2 can call the Bluetooth scanning interface of the framework layer of the terminal.
[0097] In step S220, after the first setting application calls the Bluetooth scanning unit, the Bluetooth scanning unit can determine whether the terminal is in the setting state. If it is determined that the terminal is in the setting state, the Bluetooth scanning unit can prohibit Bluetooth scanning.
[0098] The setting state may include that the display screen of the terminal is in a screen-off state. Of course, the setting state may also include other states, which may be set according to the actual needs of the user and are not limited thereto.
[0099] In some embodiments,
[0100] The first setting application may include application A1. When the display screen of the terminal is in the off state, when application A1 of the terminal has a Bluetooth scanning requirement, application A1 may call the Bluetooth scanning interface of the framework layer of the terminal. The Bluetooth scanning interface may determine that the display screen of the terminal is in the off state, and then prohibit Bluetooth scanning, thereby reducing the power consumption of the display screen of the terminal in the off state.
[0101] In addition, in the method, if the Bluetooth scanning unit determines that the terminal is not in the setting state, it can perform Bluetooth scanning and transmit the scanned information to the first setting application so that the first setting application can perform corresponding operations. For example, the first setting application can perform Bluetooth connection with the Bluetooth device based on the information of the scanned Bluetooth device.
[0102] The method can reduce the power consumption of the terminal in the set state to a certain extent, thereby improving the user experience. For example, when the set state includes the terminal being in the screen-off state, the method can avoid the terminal frequently calling the Bluetooth scanning unit to perform Bluetooth scanning in the screen-off state, thereby reducing the power consumption of the terminal in the screen-off state, thereby improving the user experience.
[0103] In an exemplary embodiment, a Bluetooth scanning method is provided, which is applied to a terminal. Figure 3 As shown, in this method, when the application is a second set application, performing Bluetooth scanning according to the Bluetooth scanning strategy may include:
[0104] S310, determining that the terminal is in a setting state;
[0105] S320: Invoke the Bluetooth agent unit to perform Bluetooth scanning.
[0106] In step S310 , the Bluetooth agent unit refers to a unit that can perform Bluetooth scanning by calling a Bluetooth scanning unit.
[0107] Wherein, when the second setting application has a Bluetooth scanning requirement, it may first be checked whether the terminal is in a setting state.
[0108] It should be noted that the specific type of the second setting application can be set according to actual needs and is not limited to this.
[0109] In step S320, after the second setting application determines that the terminal is in the setting state, the second setting application can call the Bluetooth scanning module through the Bluetooth agent module. After the second setting application calls the Bluetooth agent unit, the Bluetooth agent unit can call the Bluetooth scanning unit to perform Bluetooth scanning.
[0110] It should be noted that when the Bluetooth scanning unit is called by the Bluetooth proxy unit, the Bluetooth scanning unit may no longer determine whether the terminal is in the setting state, but may directly perform Bluetooth scanning.
[0111] In some embodiments,
[0112] The second setting application may include application B1 and application B2. In this embodiment, when application B1 of the terminal has a Bluetooth scanning requirement, if the terminal is in the setting state at this time, application B1 can call the Bluetooth agent unit of the terminal, and the Bluetooth agent unit can call the Bluetooth scanning interface of the framework layer of the terminal to enable the terminal to perform Bluetooth scanning.
[0113] In the method, when the second setting application has a Bluetooth scanning requirement, if the terminal is not in a setting state, the second setting application may call a Bluetooth scanning unit to enable the terminal to perform Bluetooth scanning.
[0114] It should be noted that in this method, after the terminal performs Bluetooth scanning, the second setting application can perform corresponding operations according to the result of the Bluetooth scanning. For example, the second setting application can perform Bluetooth connection with the Bluetooth device according to the information of the scanned Bluetooth device.
[0115] In addition, after the Bluetooth agent unit calls the Bluetooth scanning unit to perform Bluetooth scanning, if the Bluetooth scanning continues for a set time, the Bluetooth agent unit may stop calling the Bluetooth scanning unit to stop Bluetooth scanning, thereby better avoiding power consumption caused by frequent Bluetooth scanning.
[0116] The set duration can be set before the terminal leaves the factory or after the terminal leaves the factory, and there is no limit on this. After the set duration is set, it can be modified later to better meet the different needs of users. The set duration can be set according to actual needs, and there is no limit on its specific value. For example, the set duration can be 2 seconds.
[0117] In this method, when the terminal is in the setting state, the second setting application can call the Bluetooth scanning unit to enable the terminal to perform Bluetooth scanning. This method can not only reduce the power consumption in the setting state, but also meet the Bluetooth scanning requirements of some applications (second setting applications) when the terminal is in the setting state, thereby better improving the user experience.
[0118] In an exemplary embodiment, a Bluetooth scanning method is provided, which is applied to a terminal. Figure 4 As shown, the method may include:
[0119] S410, determining whether the terminal meets the Bluetooth scanning condition; if it is determined that the terminal meets the Bluetooth scanning condition, executing step S420; if it is determined that the terminal does not meet the Bluetooth scanning condition, executing step S430;
[0120] S420, calling a Bluetooth agent unit to perform Bluetooth scanning;
[0121] S430: prohibit calling the Bluetooth agent unit to prohibit Bluetooth scanning.
[0122] In step S410 , after the second setting application calls the Bluetooth agent unit, the Bluetooth agent unit may check the Bluetooth scanning condition to determine whether the Bluetooth agent unit can call the Bluetooth scanning unit.
[0123] Wherein, determining that the terminal meets the Bluetooth scanning condition may include at least one of the following:
[0124] Condition 1: Determine whether the terminal allows the use of the Bluetooth proxy unit;
[0125] Condition 2: Determine that the total number of times the scanning proxy module calls the Bluetooth scanning unit to perform Bluetooth scanning throughout the day is less than or equal to the set number;
[0126] Condition 3: If the terminal is playing audio, determine that the audio encoding mode is the set mode;
[0127] Condition 4, determining that the second setting application has authorized Bluetooth scanning permission;
[0128] Condition 5: Determine that the terminal does not use the Bluetooth function to transfer files;
[0129] Condition 6: Determine that the terminal does not use the Bluetooth function to make a voice call;
[0130] Condition 7: Determine that the terminal is not in power saving mode;
[0131] Condition 8: Determine that no Bluetooth device initiates a connection back to the terminal;
[0132] Condition 9: Determine whether the Bluetooth function of the terminal is turned on;
[0133] Condition 10: Determine whether the terminal is in a state that allows Bluetooth scanning;
[0134] Condition 11, determine that the terminal is in Bluetooth low latency mode.
[0135] The Bluetooth proxy unit may receive information corresponding to the above conditions from a server, or may obtain information corresponding to the above conditions in other ways, which is not limited. For example, information corresponding to conditions 1, 2, 3, and 4 may be sent by a server to the Bluetooth proxy unit. The information corresponding to condition 1 may be a model list of terminals that are allowed to use the Bluetooth proxy unit, and this model list may be recorded as a set model list. The information corresponding to condition 2 may be a specific value of the set number of times. The information corresponding to condition 3 may be a specific method of setting the method.
[0136] The server can send the corresponding information of the above conditions 1, 2 and 3 to the Bluetooth proxy unit according to actual needs, and there is no limit on the timing of sending the above information. For example, when the terminal is surfing the Internet through a wireless network (wifi), the server can send the corresponding information of the above conditions 1, 2 and 3 to the Bluetooth proxy unit once a day. When the terminal is surfing the Internet through traffic, the server can send the corresponding information of the above conditions 1, 2 and 3 to the Bluetooth proxy unit once every 3 days.
[0137] It should be noted that the information corresponding to the above conditions 1, 2 and 3 can be set in addition to the above-mentioned method, and can also be set in other ways, without limitation.
[0138] Regarding condition 1, the set model list can be set according to actual needs, and its specific content may not be limited. Among them, whether condition 1 is met can be determined by judging whether the model of the terminal is in the set model list. If the model of the terminal is in the set model list, it means that condition 1 is met. If the model of the terminal is not in the set model list, it means that condition 1 is not met.
[0139] Regarding condition 2, the set number of times can be set according to actual needs, and its specific value can be unlimited. The scanning proxy module can accumulate the number of times the Bluetooth scanning unit is called to perform Bluetooth scanning throughout the day, and this accumulated number can be recorded as the total number of scans throughout the day.
[0140] Among them, whether condition 2 is satisfied can be determined by judging whether the total number of scans for the day is less than or equal to the set number. If the total number of scans for the day is less than or equal to the set number, it means that condition 2 is satisfied. If the total number of scans for the day is greater than the set number, it means that condition 2 is not satisfied. It should be noted that the total number of scans for the day can be reset to zero at zero o'clock every day, and then the total number of scans for the day for the new day can be accumulated again.
[0141] Regarding condition 3, the setting method can be set according to actual needs, and the specific method is not limited. For example, the setting method can be SBC (SBC is the abbreviation of sub band code, which can also be called sub-band coding).
[0142] Wherein, when the terminal is in the state of playing audio, if the audio coding mode is SBC, it means that condition 3 is met. When the terminal is in the state of playing audio, if the audio coding mode is not SBC, it means that condition 3 is not met.
[0143] It should be noted that if the terminal is not in a state of playing audio, there is no need to judge condition 3, and condition 3 can be met by default.
[0144] Regarding condition 4, if the second setting application calls the Bluetooth agent unit, the Bluetooth agent unit can determine whether the second setting application has authorized the Bluetooth scanning permission. If the second setting application has authorized the Bluetooth scanning permission, it means that condition 4 is met. If the second setting application has not authorized the Bluetooth scanning permission, it means that condition 4 is not met.
[0145] Among them, the Bluetooth proxy unit can preset a setting identification list. The setting identification list may include identification information of multiple applications that have been authorized with Bluetooth scanning permissions (such as the package name of the application and / or the signature of the application). When judging condition 4, if the identification information of the second setting application is in the setting identification list, it means that the second setting application has been authorized with Bluetooth scanning permissions, and it can be determined that condition 4 is met. If the identification information of the second setting application is not in the setting identification list, it means that the second setting application has not been authorized with Bluetooth scanning permissions, and it can be determined that condition 4 is not met.
[0146] Regarding condition 5, whether condition 5 is satisfied can be determined by determining whether the terminal is using the Bluetooth function to transfer files. If the terminal is not using the Bluetooth function to transfer files, it means that condition 5 is satisfied. If the terminal is using the Bluetooth function to transfer files, it means that condition 5 is not satisfied.
[0147] Regarding condition 6, whether condition 6 is satisfied can be determined by judging whether the terminal is using the Bluetooth function to make a voice call (e.g., making a phone call). If it is determined that the terminal is using the Bluetooth function to make a voice call, it means that condition 6 is not satisfied. If it is determined that the terminal is not using the Bluetooth function to make a voice call, it means that condition 6 is satisfied.
[0148] Regarding condition 7, the specific state of the terminal in the power saving mode can be set according to the actual situation and is not limited thereto. Among them, whether condition 7 is met can be determined by judging whether the terminal is in the power saving mode. If it is determined that the terminal is in the power saving mode, it means that condition 7 is not met. If it is determined that the terminal is not in the power saving mode, it means that the terminal meets condition 7.
[0149] Regarding condition 8, whether condition 8 is met can be determined by judging whether there is a Bluetooth device initiating a back connection to the terminal. If it is determined that there is a Bluetooth device initiating a back connection to the terminal, it means that there is a Bluetooth device requesting a Bluetooth connection to the terminal, and it is determined that condition 8 is not met. If it is determined that there is no Bluetooth device initiating a back connection to the terminal, it means that there is no Bluetooth device requesting a Bluetooth connection to the terminal, and it is determined that condition 8 is met.
[0150] Regarding condition 9, whether the Bluetooth function of the terminal is in an on state can be determined by checking whether the switch of the Bluetooth function is in an on state. The switch of the Bluetooth function can be set on the setting page of the Bluetooth function. If it is determined that the Bluetooth function of the terminal is in an on state, it means that condition 9 is met. If it is determined that the Bluetooth function of the terminal is not in an on state, it means that condition 9 is not met.
[0151] Regarding condition 10, whether the terminal is in a state allowing Bluetooth scanning can be determined by checking whether the switch allowing Bluetooth scanning is in an on state. If the terminal is in a state allowing Bluetooth scanning, it means that condition 10 is met. If the terminal is not in a state allowing Bluetooth scanning, it means that condition 10 is not met.
[0152] It should be noted that, by setting the switch for allowing Bluetooth scanning, the user can independently choose whether to allow the terminal to perform Bluetooth scanning, which provides the user with more choices and can further enhance the user experience.
[0153] Regarding condition 11, whether the terminal is in Bluetooth low latency mode can be determined by checking whether the switch of the Bluetooth low latency mode of the terminal is turned on. If it is determined that the terminal is in Bluetooth low latency mode, it means that condition 11 is met. If it is determined that the terminal is not in Bluetooth low latency mode, it means that condition 11 is not met.
[0154] It should be noted that since Bluetooth is a wireless transmission, there may be delays, such as audio and video asynchrony. Users can manually turn on the Bluetooth low-latency switch, which will allow data packets to be sent to the Bluetooth-connected Bluetooth device more quickly to achieve low latency in Bluetooth audio transmission.
[0155] In step S420, if the Bluetooth agent unit determines that the terminal meets the Bluetooth scanning condition, it means that the terminal allows the Bluetooth agent unit to call the Bluetooth scanning unit and has performed Bluetooth scanning. Therefore, after the Bluetooth agent unit determines that the terminal meets the Bluetooth scanning condition, the Bluetooth agent unit can call the Bluetooth scanning unit.
[0156] In some embodiments,
[0157] The Bluetooth scanning conditions may include conditions 1 to 11. After determining that the terminal meets the above conditions 1 to 11, the Bluetooth agent unit may call the Bluetooth scanning unit to perform Bluetooth scanning.
[0158] In some embodiments,
[0159] The Bluetooth scanning conditions may include conditions 1 to 9. After determining that the terminal meets the above conditions 1 to 9, the Bluetooth agent unit may call the Bluetooth scanning unit to perform Bluetooth scanning.
[0160] It should be noted that after the terminal performs Bluetooth scanning, if it scans a Bluetooth device, it can transmit the scanned information to the second setting application, and the second setting application can perform subsequent actions based on the above information. For example, in the scenario where the user uses voice to wake up the mobile phone and speaker device, the speaker device can continuously send broadcasts with a fixed identifier. After the voice wake-up application of the mobile phone scans the broadcast of the identifier through Bluetooth, it can determine that there are devices around that support voice wake-up. In this case, the mobile phone can suppress the wake-up operation, and the speaker device responds to the voice wake-up.
[0161] It should be noted that in addition to the voice wake-up scenario of the above-mentioned mobile phone and speaker device, the method disclosed in the present invention can also be applied to other scenarios, without limitation thereto.
[0162] In step S430, if the Bluetooth agent unit determines that the terminal does not meet the Bluetooth scanning condition, it means that the terminal does not allow the Bluetooth agent unit to call the Bluetooth scanning unit. Therefore, after the Bluetooth agent unit determines that the terminal does not meet the Bluetooth scanning condition, the Bluetooth agent unit can prohibit calling the Bluetooth scanning unit.
[0163] In some embodiments,
[0164] The Bluetooth scanning conditions may include conditions 1 to 11. If it is determined that at least one of the above conditions 1 to 11 is not met, it means that the terminal does not meet the Bluetooth scanning conditions. The Bluetooth agent unit can prohibit calling the Bluetooth scanning unit, and the terminal will not perform Bluetooth scanning.
[0165] In some embodiments,
[0166] The Bluetooth scanning conditions may include conditions 1 to 9. If it is determined that at least one of the above conditions 1 to 9 is not met, it means that the terminal does not meet the Bluetooth scanning conditions. The Bluetooth agent unit can prohibit calling the Bluetooth scanning unit, and the terminal will not perform Bluetooth scanning.
[0167] In addition, in the method, after determining that the terminal does not meet the Bluetooth scanning condition, the Bluetooth agent unit may return the reason why the Bluetooth scanning condition is not met to the second setting application. After receiving the above reason, the second setting application may control the terminal to output the above reason. For example, the display screen of the terminal may be controlled to display the above reason.
[0168] In this method, by setting the Bluetooth scanning conditions, frequent Bluetooth scanning can be avoided, thereby reducing power consumption. This method can not only meet the Bluetooth scanning requirements of some applications (second setting applications) when the terminal is in a set state, but also reduce power consumption through Bluetooth scanning conditions, thereby improving the user experience.
[0169] In an exemplary embodiment, a Bluetooth scanning method is provided, which is applied to a terminal. In the method, a first setting application may include an application A1 and an application A2, and a second setting application may include an application B1 and an application B2.
[0170] When the display screen of the terminal is off, when application A1 has a Bluetooth scanning requirement, application A1 can call the Bluetooth scanning unit. Then, the Bluetooth scanning unit can check the state of the terminal, and it can determine that the display screen of the terminal is off, and the Bluetooth scanning unit can prohibit Bluetooth scanning.
[0171] When the display screen of the terminal is in the bright screen state, when the application A2 has a Bluetooth scanning requirement, the application A2 can call the Bluetooth scanning unit. Then, the Bluetooth scanning unit can check the state of the terminal, and it can determine that the display screen of the terminal is in the bright screen state, and the Bluetooth scanning unit can perform Bluetooth scanning.
[0172] When the display screen of the terminal is off, when the application B1 has a Bluetooth scanning requirement, the application B1 can first check the terminal status, and can determine that the display screen of the terminal is off, and then call the Bluetooth proxy unit. The Bluetooth proxy unit can then determine whether the terminal meets the Bluetooth scanning conditions.
[0173] If it is determined that the terminal meets the Bluetooth scanning condition, the Bluetooth agent unit can call the Bluetooth scanning unit to perform Bluetooth scanning. The application B1 can then obtain the Bluetooth scanning information to facilitate subsequent actions.
[0174] If it is determined that the terminal does not meet the Bluetooth scanning conditions, the Bluetooth agent unit can prohibit calling the Bluetooth scanning model, and the terminal will not perform Bluetooth scanning. Application B1 can obtain the reason why the Bluetooth scanning conditions are not met and output the above reasons, so that the user can understand the reasons why the Bluetooth scanning conditions are not met in time, so as to facilitate the user to perform subsequent operations. In addition, when the terminal does not perform Bluetooth scanning, application B1 can determine that the terminal has not scanned Bluetooth information, so as to perform subsequent actions.
[0175] Among them, when the terminal's display screen is in the bright screen state, when application B2 has a Bluetooth scanning requirement, application B2 can first check the terminal status, and it can determine that the terminal's display screen is in the bright screen state, and then call the Bluetooth scanning unit to perform Bluetooth scanning.
[0176] This method can not only reduce the power consumption in the set state to better ensure the battery life of the terminal, but also meet the Bluetooth scanning requirements of some applications when the terminal is in the set state, thereby better improving the user experience.
[0177] In an exemplary embodiment, a Bluetooth scanning device is provided, which is applied to a terminal. The device is used to implement the above-mentioned Bluetooth scanning method. For example, referring to Figure 5 As shown, the device may include a determination module 101 and a control module 102, wherein the device, during the implementation of the above method,
[0178] The determination module 101 is used to determine a Bluetooth scanning strategy according to the application program when the application program has a Bluetooth scanning requirement;
[0179] The control module 102 is used to control the Bluetooth scanning according to the Bluetooth scanning strategy.
[0180] In an exemplary embodiment, a Bluetooth scanning device is provided, which is applied to a terminal. Figure 5 As shown, in the device, when the application is a first setting application, the control module 102 is used to:
[0181] Call the Bluetooth scanning unit;
[0182] If it is determined that the terminal is in the setting state, Bluetooth scanning is prohibited.
[0183] In an exemplary embodiment, a Bluetooth scanning device is provided, which is applied to a terminal. Figure 5 As shown, in the device, when the application is the second setting application, the control module 102 is used to:
[0184] Make sure the terminal is in the set state;
[0185] Call the Bluetooth agent unit to perform Bluetooth scanning.
[0186] In an exemplary embodiment, a Bluetooth scanning device is provided, which is applied to a terminal. Figure 5 As shown, in the device, the control module 102 is used for:
[0187] After the Bluetooth scanning unit is called to perform Bluetooth scanning, if the Bluetooth scanning continues for a set time, the Bluetooth scanning unit is stopped to prohibit Bluetooth scanning.
[0188] In an exemplary embodiment, a Bluetooth scanning device is provided, which is applied to a terminal. Figure 5 As shown, in the device, the control module 102 is used to:
[0189] Before calling the Bluetooth scanning unit, it is determined that the terminal meets the Bluetooth scanning conditions.
[0190] In an exemplary embodiment, a Bluetooth scanning device is provided, which is applied to a terminal. In the device, determining that the terminal meets the Bluetooth scanning condition includes at least one of the following:
[0191] Determining that the terminal is allowed to use the Bluetooth proxy unit;
[0192] Determine that the total number of times the Bluetooth scanning unit is called to perform Bluetooth scanning throughout the day is less than or equal to the set number;
[0193] If the terminal is playing audio, the audio encoding mode is determined to be the set mode;
[0194] Make sure the second setting application has authorized Bluetooth scanning permissions;
[0195] Make sure the terminal does not use Bluetooth to transfer files;
[0196] Make sure the terminal does not use the Bluetooth function to make voice calls;
[0197] Make sure the terminal is not in power saving mode;
[0198] Make sure that no Bluetooth device initiates a connection back to the terminal;
[0199] Make sure the Bluetooth function of the terminal is turned on;
[0200] Make sure the terminal is in a state that allows Bluetooth scanning;
[0201] Make sure the device is in Bluetooth low latency mode.
[0202] In an exemplary embodiment, a Bluetooth scanning device is provided, which is applied to a terminal. Figure 5 As shown, in the device, the control module 102 is used to:
[0203] After determining that the terminal does not meet the Bluetooth scanning conditions,
[0204] Disable the invocation of the Bluetooth scanning unit; and / or,
[0205] The reason why the Bluetooth scanning condition is not satisfied is returned to the second setting application.
[0206] In an exemplary embodiment, a Bluetooth scanning device is provided, which is applied to a terminal. In the device, the setting state includes that the display screen of the terminal is in a screen-off state.
[0207] In an exemplary embodiment, a terminal is provided, such as a mobile phone, a wearable device, a laptop computer, a desktop computer, etc., without limitation thereto.
[0208] refer to Figure 6 As shown, terminal 400 may include one or more of the following components: a processing component 402 , a memory 404 , a power component 406 , a multimedia component 408 , an audio component 410 , an input / output (I / O) interface 412 , a sensor component 414 , and a communication component 416 .
[0209] The processing component 402 generally controls the overall operation of the device 400, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 402 may include one or more modules to facilitate the interaction between the processing component 402 and other components. For example, the processing component 402 may include a multimedia module to facilitate the interaction between the multimedia component 408 and the processing component 402.
[0210] The memory 404 is configured to store various types of data to support operations on the device 400. Examples of such data include instructions for any application or method operating on the device 400, contact data, phone book data, messages, pictures, videos, etc. The memory 404 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0211] The power component 406 provides power to the various components of the device 400. The power component 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 400.
[0212] The multimedia component 408 includes a screen that provides an output interface between the device 400 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input instructions from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front camera and / or a rear camera. When the terminal 400 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0213] The audio component 410 is configured to output and / or input audio instructions. For example, the audio component 410 includes a microphone (MIC), and when the device 400 is in an operating mode, such as a call mode, a recording mode, and a speech understanding mode, the microphone is configured to receive external audio instructions. The received audio instructions can be further stored in the memory 404 or sent via the communication component 416. In some embodiments, the audio component 410 also includes a speaker for outputting audio instructions.
[0214] I / O interface 412 provides an interface between processing component 402 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a run button, and a lock button.
[0215] The sensor assembly 414 includes one or more sensors for providing various aspects of status assessment for the terminal 400. For example, the sensor assembly 414 can receive the open / closed state of the terminal 400, the relative positioning of the components, such as the display and keypad of the terminal 400, and the sensor assembly 414 can also detect the position change of the device 400 or a component of the terminal 400, the presence or absence of contact between the user and the device 400, the orientation or acceleration / deceleration of the device 400 and the temperature change of the device 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 414 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0216] The communication component 416 is configured to facilitate wired or wireless communication between the device 400 and other devices. The device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives a broadcast instruction or broadcast-related image from an external broadcast management system via a broadcast setting channel. In an exemplary embodiment, the communication component 416 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0217] In an exemplary embodiment, the device 400 may be implemented by one or more application-specific integrated circuits (ASICs), digital instruction processors (DSPs), digital instruction processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described methods.
[0218] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 404 including instructions, and the instructions can be executed by a processor 420 of the device 400 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a tape, a floppy disk, and an optical data storage device. When the instructions in the storage medium are executed by the processor of the terminal, the terminal is enabled to perform the method in the above embodiment.
[0219] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0220] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A Bluetooth scanning method, applied to a terminal, It is characterized in that The Bluetooth scanning method comprises: When the application has a Bluetooth scanning requirement, determining a Bluetooth scanning strategy according to the application; According to the Bluetooth scanning strategy, Bluetooth scanning is controlled.
2. The Bluetooth scanning method according to claim 1, It is characterized in that When the application is a first setting application, controlling the Bluetooth scanning according to the Bluetooth scanning strategy includes: Call the Bluetooth scanning unit; If it is determined that the terminal is in the setting state, Bluetooth scanning is prohibited.
3. The Bluetooth scanning method according to claim 1, It is characterized in that When the application is a second set application, performing Bluetooth scanning according to the Bluetooth scanning strategy includes: Determining that the terminal is in a setting state; Call the Bluetooth agent unit to perform Bluetooth scanning.
4. The Bluetooth scanning method according to claim 3, It is characterized in that After calling the Bluetooth agent unit to perform Bluetooth scanning, the Bluetooth scanning method includes: If the Bluetooth scanning continues for a set time, the Bluetooth agent unit is stopped from being called to prohibit the Bluetooth scanning.
5. The Bluetooth scanning method according to claim 3, It is characterized in that Before calling the Bluetooth agent unit, the Bluetooth scanning method includes: It is determined that the terminal meets a Bluetooth scanning condition.
6. The Bluetooth scanning method according to claim 5, It is characterized in that The determining that the terminal meets the Bluetooth scanning condition includes at least one of the following: Determining that the terminal is allowed to use the Bluetooth proxy unit; Determine that the total number of scans for the whole day for calling the Bluetooth scanning unit to perform Bluetooth scanning is less than or equal to the set number; If the terminal is playing audio, determining that the audio encoding mode is a set mode; Determining that the second setting application has authorized Bluetooth scanning permission; Determining that the terminal does not use the Bluetooth function to transfer files; Determining that the terminal does not use the Bluetooth function to make a voice call; Determining that the terminal is not in power saving mode; Determining that no Bluetooth device initiates a backconnection to the terminal; Determining that the Bluetooth function of the terminal is turned on; Determining that the terminal is in a state allowing Bluetooth scanning; Determine that the terminal is in Bluetooth low latency mode.
7. The Bluetooth scanning method according to claim 5, It is characterized in that The Bluetooth scanning method comprises: When it is determined that the terminal does not meet the Bluetooth scanning condition, prohibiting calling the Bluetooth proxy unit; and / or, The reason why the Bluetooth scanning condition is not met is returned to the second setting application.
8. The Bluetooth scanning method according to any one of claims 2 to 6, It is characterized in that The setting state includes that the display screen of the terminal is in a screen-off state.
9. A Bluetooth scanning device, applied to a terminal, It is characterized in that The Bluetooth scanning device comprises: A determination module, used to determine a Bluetooth scanning strategy according to the application when the application has a Bluetooth scanning requirement; The control module is used to control the Bluetooth scanning according to the Bluetooth scanning strategy.
10. The Bluetooth scanning device according to claim 9, It is characterized in that When the application is the first application, the control module is used to: Call the Bluetooth scanning unit; If it is determined that the terminal is in the setting state, Bluetooth scanning is prohibited.
11. The Bluetooth scanning device according to claim 9, It is characterized in that When the application is the second application, the control module is used to: Determining that the terminal is in a setting state; Call the Bluetooth agent unit to perform Bluetooth scanning.
12. The Bluetooth scanning device according to claim 11, It is characterized in that The control module is used for: After the Bluetooth agent unit is called to perform Bluetooth scanning, if the Bluetooth scanning continues for a set time, the Bluetooth agent unit is stopped from being called to prohibit Bluetooth scanning.
13. The Bluetooth scanning device according to claim 11, It is characterized in that The control module is used for: Before calling the Bluetooth proxy unit, it is determined that the terminal meets the Bluetooth scanning condition.
14. The Bluetooth scanning device according to claim 13, It is characterized in that The determining that the terminal meets the Bluetooth scanning condition includes at least one of the following: Determining that the terminal is allowed to use the Bluetooth proxy unit; Determine that the total number of scans for the whole day for calling the Bluetooth scanning unit to perform Bluetooth scanning is less than or equal to the set number; If the terminal is playing audio, determining that the audio encoding mode is a set mode; Determining that the second setting application has authorized Bluetooth scanning permission; Determining that the terminal does not use the Bluetooth function to transfer files; Determining that the terminal does not use the Bluetooth function to make a voice call; Determining that the terminal is not in power saving mode; Determining that no Bluetooth device initiates a backconnection to the terminal; Determining that the Bluetooth function of the terminal is turned on; Determining that the terminal is in a state allowing Bluetooth scanning; Determine that the terminal is in Bluetooth low latency mode.
15. The Bluetooth scanning device according to claim 11, It is characterized in that The control module is used for: When it is determined that the terminal does not meet the Bluetooth scanning condition, prohibiting calling the Bluetooth proxy unit; and / or, The reason why the Bluetooth scanning condition is not met is returned to the second setting application.
16. The Bluetooth scanning device according to any one of claims 10 to 15, It is characterized in that The setting state includes that the display screen of the terminal is in a screen-off state.
17. A terminal, It is characterized in that The terminal comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the Bluetooth scanning method as described in any one of claims 1-8.
18. A non-transitory computer-readable storage medium, It is characterized in that When the instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute the Bluetooth scanning method as described in any one of claims 1 to 8.
