Bluetooth scanning method and related equipment

By configuring filters on the Bluetooth chip and accurately matching the callback function to process broadcast data, the problems of high power consumption and low efficiency during Bluetooth scanning are solved, and more efficient Bluetooth scanning and power consumption savings are achieved.

CN120475337AActive Publication Date: 2025-08-12HONOR DEVICE CO LTD

Patent Information

Application Number
CN202411496710.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-08-12
Estimated Expiration
2044-10-23

Smart Images

  • Figure CN120475337A_ABST
    Figure CN120475337A_ABST
Patent Text Reader

Abstract

The invention provides a Bluetooth scanning method and related equipment. The method can be applied to an intelligent interconnection scene. After broadcast data is obtained through a Bluetooth chip configured with a filter, filtering configuration information matched with the broadcast data is determined, and the filtering configuration information comprises address information of a callback function used for processing the broadcast data. And transmitting the broadcast data to a callback function according to the address information. Therefore, the callback function matched with the broadcast data can be accurately used for processing the broadcast data, the processing flow is simplified, the efficiency is improved, and the power consumption is reduced. In some embodiments, the broadcast data is subjected to de-duplication processing through the hard filtering module, and the broadcast data is transmitted to the callback function after being determined to be not repeated broadcast, so that the computing power and the power consumption are saved. In some embodiments, after all the broadcast data needing to be scanned by the operating system are transmitted to the corresponding callback function, scanning of the operating system is stopped, the number of broadcasts scanned by the operating system can be reduced as much as possible, and computing power and power consumption are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a Bluetooth scanning method and related equipment. Background Art

[0002] In smart interconnected scenarios, Windows-based personal computers, mobile phones, large screens, tablets, and other Internet of Things (IoT) devices within near-field range rely on Bluetooth low energy (BLE) to achieve mutual awareness (e.g., self-discovery and network awareness). Near-field devices periodically broadcast to each other, allowing them to be discovered or kept online. Near-field devices may also send a series of broadcasts within a short period of time to notify surrounding devices of their status changes. Summary of the Invention

[0003] This application provides a Bluetooth scanning method and related equipment, which can improve the efficiency of processing Bluetooth broadcasts and reduce power consumption.

[0004] In a first aspect, a Bluetooth scanning method is provided, which is applied to a first device, the first device having a Bluetooth chip, and the method includes: configuring multiple first filters in the Bluetooth chip according to multiple first filtering configuration information, the multiple first filters being used to filter the broadcast data received by the Bluetooth chip to obtain first broadcast data related to the current business, and the multiple first filtering configuration information corresponding one-to-one to the multiple first filters; obtaining second broadcast data from the second device through the multiple first filters; determining the second filtering configuration information matching the second broadcast data among the multiple first filtering configuration information, the second filtering configuration information including first address information, the first address information indicating the address of a first callback function used to parse the second broadcast data; and transmitting the second broadcast data to the first callback function according to the first address information.

[0005] The above solution matches the broadcast data with the filtering configuration information and accurately uses the callback function that matches the broadcast data to process the broadcast data, streamlining the processing flow, improving efficiency and reducing power consumption.

[0006] In a possible embodiment, the first device stores a first time, the first time is the time for transmitting the third broadcast data to the first callback function, the third broadcast data comes from the second device, the third broadcast data and the second broadcast data belong to the same broadcast cycle, and the second filtering configuration information also includes an interval threshold; according to the first address information, the second broadcast data is transmitted to the first callback function, including: when the interval between the current time and the first time is greater than or equal to the interval threshold, according to the first address information, the second broadcast data is transmitted to the first callback function.

[0007] This solution, for broadcast data received successively within a broadcast cycle belonging to the same device, does not simply deduplicate the later-received broadcast data. Instead, before transmitting the later-received broadcast data to the callback function, it determines whether the difference between the current time and the reporting time of the earlier-received broadcast data is greater than or equal to the interval threshold, and still reports the later-received broadcast data. This allows for scenarios such as when an external device is moving during Bluetooth scanning, by receiving and processing real-time updated broadcast data from the external device, improving Bluetooth scanning accuracy.

[0008] In a possible embodiment, the method further includes: ignoring the second broadcast data when the interval between the current time and the first time is less than an interval threshold.

[0009] The above solution removes duplicate broadcast data according to the interval threshold before processing the broadcast data, which can reduce the situation of processing duplicate broadcasts and save computing power and power consumption.

[0010] In a possible embodiment, the second broadcast data is transmitted to the first callback function according to the first address information, including: when the second filtering configuration information does not include the first indication information, the second broadcast data is transmitted to the first callback function according to the first address information; the first device is installed with an operating system, and the method also includes: when the second filtering configuration information includes the first indication information, starting the operating system to perform Bluetooth scanning; wherein the first indication information indicates enabling the operating system to cache information of the scanned device.

[0011] The above solution determines whether to enable operating system scanning based on whether the current business requires the local device to establish a Bluetooth connection with an external device. In other words, if a Bluetooth connection is required, the operating system will enable scanning. If not, the operating system will not enable scanning. This minimizes the number of broadcasts the operating system must handle, thereby saving power while ensuring business operations.

[0012] In a possible embodiment, the first device stores second indication information for indicating that the second broadcast data matches the second filtering configuration information. After starting the operating system to perform Bluetooth scanning, the method also includes: obtaining fourth broadcast data from the second device through Bluetooth scanning performed by the operating system, and the fourth broadcast data and the second broadcast data belong to the same broadcast cycle; determining whether the fourth broadcast data matches the second indication information; and if the fourth broadcast data matches the second indication information, transmitting the fourth broadcast data to the first callback function according to the first address information.

[0013] In the above scheme, the second broadcast data obtained by the hard filtering module can be understood as the broadcast data of interest to the first device. The hard filtering module first obtains the second broadcast data of interest to the first device, and stores second indication information indicating that the second broadcast data matches the second filtering configuration information. Based on the second indication information stored by the first device, the broadcast data of interest to the first device, obtained through the operating system scan, can be processed. This is equivalent to filtering the operating system scan results based on the filtering results of the hard filtering module, thereby minimizing the broadcasts processed by the operating system without affecting current services, saving computing power and power consumption.

[0014] In addition, the scanning of the hard filtering module is always on when the trust ring service is turned on. The hard filtering module detects the broadcast of the matching filter from the external device (that is, the broadcast of the local machine's concern) through the Bluetooth chip, and will trigger the operating system scan according to the above process. Because a broadcast cycle generally lasts for a few seconds, and the process of the operating system scanning the broadcast and reporting takes about a few hundred milliseconds to complete, it can ensure that after the hard filtering module triggers the operating system scan, the operating system can scan the broadcast of the local machine's concern within the same broadcast cycle. Therefore, compared with the solution of always turning on or periodically turning on the operating system scan, it can reduce the number of broadcast signals processed by the operating system and save computing power and power consumption, and can also improve the scanning efficiency of the operating system.

[0015] In a possible embodiment, the first device stores a second time, the second time is the time for transmitting the fifth broadcast data to the first callback function, the fifth broadcast data is a broadcast from the second device obtained using the operating system, the fifth broadcast data and the fourth broadcast data belong to the same broadcast cycle, and the second filtering configuration information also includes an interval threshold; according to the first address information, the fourth broadcast data is transmitted to the first callback function, including: when the interval between the current time and the second time is greater than or equal to the interval threshold, according to the first address information, the fourth broadcast data is transmitted to the first callback function.

[0016] This solution, for broadcast data received successively within a broadcast cycle belonging to the same device, does not simply deduplicate the later-received broadcast data. Instead, before transmitting the later-received broadcast data to the callback function, it determines whether the difference between the current time and the reporting time of the earlier-received broadcast data is greater than or equal to the interval threshold, and still reports the later-received broadcast data. This allows for scenarios such as when an external device is moving during Bluetooth scanning, by receiving and processing real-time updated broadcast data from the external device, improving Bluetooth scanning accuracy.

[0017] In a possible embodiment, the method further includes: ignoring the fourth broadcast data when the interval between the current time and the second time is less than an interval threshold.

[0018] This means that repeated broadcast data reporting can be avoided, saving computing power and energy. Repeated BLE broadcasts do not need to pass through the Windows kernel Bluetooth protocol stack and cross-platform application architecture layer, saving power consumption of the main chip software parsing BLE broadcast data.

[0019] In a possible embodiment, the first device stores third indication information, the third indication information includes second indication information and fourth indication information, the fourth indication information is used to indicate that the sixth broadcast data from the third device matches the third filtering configuration information, the third filtering configuration information includes first indication information and second address information, the second address information indicates the address of the second callback function used to parse the sixth broadcast data; the method also includes: after transmitting the seventh broadcast data matching the third indication information to the corresponding third callback function, stopping the operating system scan; wherein the seventh broadcast data includes the fourth broadcast data and the eighth broadcast data, the eighth broadcast data is obtained from the third device through Bluetooth scanning performed by the operating system, the eighth broadcast data and the sixth broadcast data belong to the same broadcast cycle, the eighth broadcast data matches the third indication information, and the third callback function includes the first callback function and the second callback function.

[0020] The above solution stops the operating system scanning after scanning all broadcasts of interest to the local device and reporting them to the corresponding callback function. This ensures that no broadcasts are missed, reduces the time Microsoft spends scanning, significantly reduces the number of broadcasts to be processed, lowers computational complexity, and saves power. It's understandable that the operating system takes several hundred milliseconds to start and stop scanning, while the broadcast cycle typically lasts several seconds. Therefore, ensuring that the operating system's scanning window falls within the broadcast cycle ensures a high probability of successfully detecting the broadcasts of interest to the local device.

[0021] In a possible embodiment, determining the second filtering configuration information that matches the second broadcast data includes: when the first device stores second indication information, determining the second filtering configuration information that matches the second broadcast data based on the second indication information, the second indication information indicating that the second broadcast data matches the second filtering configuration information; or, when the first device does not store indication information for indicating filtering configuration information that matches the second broadcast data, when the second broadcast data matches a second filter among multiple first filters, determining that the second broadcast data matches the second filtering configuration information of the second filter, and saving the second indication information for indicating that the second broadcast data matches the second filtering configuration information.

[0022] That is to say, if the second indication information that matches the second broadcast data and the second filtering configuration information is not stored, it is necessary to determine the second filter that matches the second broadcast data, and then determine the matching relationship between the second broadcast data and the second filtering configuration information; if the second indication information has been stored, the second filtering configuration information can be directly determined.

[0023] In a possible embodiment, when the first device does not store indication information for indicating filtering configuration information that matches the second broadcast data, the second filtering configuration information includes an offset, characteristic data of the service data, and a mask of the service data, wherein the characteristic data corresponds one-to-one to the bits of the mask, the offset is L, and L is a positive integer. The method also includes: using the bit in the characteristic data corresponding to the first bit in the mask whose value is not 0 as the second bit, and the number of second bits is N, and N is a positive integer; using N bits starting from the Lth bit in the second broadcast data as the third bit; judging whether the value of the second bit is the same as the value of the third bit; when the value of the second bit is the same as the value of the third bit, determining that the second broadcast data matches the second filter; or, when the value of the second bit is different from the value of the third bit, determining that the second broadcast data does not match the second filter.

[0024] That is, based on the offset in the filtering configuration information, the characteristic data of the service data, and the mask of the service data, it can be determined whether the broadcast data matches the filter corresponding to the filtering configuration information.

[0025] In a possible embodiment, the second indication information includes a mapping relationship between a first hash value and second filtering configuration information, the first hash value is calculated for the second broadcast data based on a sum hash algorithm, and determining whether the fourth broadcast data matches the second indication information includes: calculating the second hash value for the fourth broadcast data based on the sum hash algorithm; when the first hash value and the second hash value are the same, determining that the fourth broadcast data matches the second indication information; or, when the first hash value and the second hash value are different, determining that the fourth broadcast data does not match the second indication information.

[0026] That is, whether the broadcast data matches the stored mapping relationship may be determined based on whether the hash value of the broadcast data is the same as the hash value included in the mapping relationship.

[0027] In a second aspect, the present application provides an electronic device comprising one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code comprises computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect and any possible implementation of the first aspect.

[0028] In a third aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions to enable the electronic device to execute the method described in the first aspect and any possible implementation method of the first aspect.

[0029] In a fourth aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.

[0030] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.

[0031] It is understandable that the electronic device provided in the second aspect, the chip system provided in the third aspect, the computer storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to perform the methods provided in this application. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects of the corresponding methods and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 A schematic diagram of an example of a smart interconnection scenario 100 provided in an embodiment of the present application;

[0033] Figure 2 A schematic diagram of a Bluetooth scanning method 200-1 provided in an embodiment of the present application;

[0034] Figure 3 A schematic diagram of a Bluetooth scanning method 200-2 provided in an embodiment of the present application;

[0035] Figure 4 A schematic diagram of a Bluetooth scanning method 200-3 provided in an embodiment of the present application;

[0036] Figure 5 A schematic diagram of a Bluetooth scanning method 200-4 provided in an embodiment of the present application;

[0037] Figure 6 A schematic diagram of the Bluetooth scanning process 300 provided in this application;

[0038] Figure 7 A schematic diagram of the hardware structure of an electronic device 1000 provided in an embodiment of the present application;

[0039] Figure 8 A schematic diagram of a software system of an electronic device 1000 provided in an embodiment of the present application;

[0040] Figure 9 This is an exemplary interaction diagram of a Bluetooth scanning method 400 implemented based on a software system provided in this application. DETAILED DESCRIPTION

[0041] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0042] In order to more clearly illustrate the technical solution of this application, the concepts involved in this application are explained as follows.

[0043] 1. Trust Ring: The same user account can be logged into different electronic devices. When two or more electronic devices under the same user account trust each other, they form a trust ring. For one electronic device in the trust ring (e.g., electronic device 1), all other electronic devices in the trust ring (e.g., electronic device 2) can be considered trusted devices of electronic device 1.

[0044] Smart interconnection scenarios can be realized based on the trust ring. Figure 1 A schematic diagram of an example of a smart interconnection scenario 100 provided in an embodiment of the present application.

[0045] like Figure 1 As shown, the same user account can be logged in on electronic devices such as a personal computer (PC) 101, a mobile phone 102, a tablet 107, a watch 103, headphones 106, a router 105, and a display screen 104. Furthermore, these devices can sense each other via BLE. Thus, these devices can form a trust loop. For example, the PCs involved in this application all have Windows installed.

[0046] Figure 1 The arrows pointing from PC 101 to other electronic devices indicate that PC 101 scans BLE broadcasts to discover other electronic devices or to sense changes in the networking status of devices within the ring. It is understandable that in the design of smart interconnection scenarios, given the strong computing power of PCs, it is preferable for PCs to scan BLE broadcasts from other devices to ensure interoperability between electronic devices.

[0047] Alternatively, in addition to PCs, other devices with strong computing capabilities, such as mobile phones and tablets, can also scan BLE broadcasts to discover other electronic devices, or sense changes in the networking status of devices in the ring. This application does not limit this.

[0048] For the sake of convenience, in this application, the device that scans BLE broadcasts to discover other electronic devices, or senses changes in the networking status of devices in the ring can be referred to as the first device, or the BLE scan initiator, or the scanning device, without limitation; in the smart interconnection scenario, other devices except the first device can be referred to as external devices, or scanned devices, without limitation.

[0049] 2. The trust ring service can be a first device (e.g. Figure 1 A module in PC101 in the , which mainly has four functions: device discovery, connection, access to networking and data transmission.

[0050] This application mainly involves device discovery and connection functions. More specifically, this application implements the discovery function through Bluetooth scanning.

[0051] 3. Active scanning is a scanning mode in Bluetooth Low Energy (BLE) technology. In this scanning mode, the scanning device can not only listen to the broadcast data, but also send a scan request to the broadcasting device to obtain more device data of the scanned device.

[0052] For example, the first device receives broadcast data 1 (for example, service data (ServiceData)) from an external device, and actively sends a scan request to the external device. After receiving the scan request, the external device sends broadcast data 2 to the first device, which can also be called scan response data (for example, manufacturer data (ManufacturerData)). Accordingly, the first device receives the scan response data.

[0053] ServiceData refers to the service data contained in the device's advertising data packets. This data is usually used to transmit information about the services provided by the device when the device has not yet established a connection.

[0054] ManufacturerData refers to a specific data field included in the Bluetooth device's advertising data packet, which is used to store manufacturer-defined information. This information can be used to enhance the device's functionality or provide additional service information.

[0055] It is understood that in the present application, active scanning can be as described above, where the first device receives both broadcast data 1 and scan response data; alternatively, during the active scanning process in the present application, the first device may not receive scan response data. In other words, the broadcast data received by the first device from the external device includes broadcast data 1 and optionally scan response data.

[0056] 4. The BLE broadcasts sent by devices in the smart interconnection scenario have the following characteristics:

[0057] (1) Send BLE broadcasts at fixed periods and intervals.

[0058] For example, with a period of 30 seconds, 5 seconds of BLE broadcasts are continuously sent in each period, and the interval between two adjacent BLE broadcasts is fixed at 25 seconds.

[0059] (2) The payload content of the BLE broadcast sent within a broadcast cycle remains basically unchanged.

[0060] (3) The BLE broadcast actively sent by the device includes ServiceData.

[0061] (4) If the BLE broadcast is configured with scan response data, after receiving a scan request from another device, it will send scan response data, which includes ManufacturerData.

[0062] (5) The BLE scan initiator may not need scan response data.

[0063] (6) The BLE scan initiator may not initiate a BLE connection after receiving a BLE broadcast.

[0064] (7) The device BLE broadcast uses a random media access control address (MAC).

[0065] 5. MAC randomization technology allows Bluetooth devices to dynamically generate and change their MAC addresses instead of using fixed hardware addresses.

[0066] For example, in this application, the external device uses the same MAC address within one broadcast cycle and uses different MAC addresses in different broadcast cycles. In an active scan process, if the first device receives both broadcast data and scan response data, the broadcast data and the scan response data correspond to the same MAC address.

[0067] 6. A hash value collision occurs when two different input data produce the same hash value after being processed by a hash function. An ideal hash function should minimize the probability of collisions. However, since the output length of a hash function is fixed, while the input data can be infinitely long, a collision is theoretically always possible.

[0068] 7. Sum hash algorithm is a type of algorithm that maps data of arbitrary length to fixed-length data. It has a wide range of applications in computer science, such as data retrieval, password storage, digital signature, etc.

[0069] 8. Operating system scan, for example, referred to in this application as Microsoft scan, Windows scan, Windows Bluetooth scan, Windows BLE scan, or Windows operating system scan, without limitation. The Trust Ring sends a BLE scan command to the Bluetooth chip module via the Windows Runtime (WRT) Application Programming Interface (API). The Bluetooth chip converts the electromagnetic waves within a specific frequency range received by the antenna into binary data representing the Bluetooth broadcast. This binary data is then transmitted to the Trust Ring service through the Bluetooth driver, Windows kernel protocol stack, WRT interface layer, system interface layer (system API), and finally to the application layer.

[0070] Continue with Figure 1 For example, when PC101 is in the working state of the screen on, the Trust Ring Service discovers other devices by scanning BLE broadcasts, or senses changes in the networking status of devices in the ring.

[0071] In a related technology, the trust ring service discovers other devices through operating system scanning. In this related technology, each layer through which the Bluetooth chip reports the broadcast (such as the Bluetooth driver, Windows kernel protocol stack, WRT interface layer, system interface layer, and application layer mentioned above) requires the main chip to participate in the calculation. In the smart interconnection scenario, the power consumption of the Windows operating system is very high when BLE scanning is continuously turned on. Even if an intermittent scanning strategy that balances efficiency and power consumption is adopted, that is, BLE scanning is periodically turned on, the power consumption can be reduced to 40% of the continuous BLE scanning mode, but the impact on PC battery life is still large.

[0072] In another related technology, the scanning component of the trust ring service sends a BLE scanning instruction to the hard filtering framework through the system interface layer (system API), and the hard filtering framework configures filters in the Bluetooth chip based on the BLE scanning instruction. The Bluetooth chip is used to scan the broadcast data of the external device, and the broadcast data is filtered before being reported to the trust ring service. In this way, the trust ring service obtains the broadcast data that matches the filter, but the Windows system cannot yet discover the external device that sent the broadcast data, and thus cannot manage the external device according to the interface for managing Bluetooth devices in the Windows system, and cannot establish a Bluetooth connection with the external device. In order to establish a Bluetooth connection with the external device, the scanning component turns on the Windows BLE scan, and the Windows kernel reports the BLE broadcast data received by the Bluetooth chip to the scanning component, and the trust ring parses the broadcast data. If the data format matches the parsing logic of the business, a Bluetooth connection is established with the external device, and the application layer uses this Bluetooth connection to transmit authentication messages and device information between devices.

[0073] In this related art, while the trust ring can determine whether received broadcast data matches a specific filter (e.g., filter 1), it does not address the associated management of filters, corresponding filter configurations, and broadcast processing methods. Therefore, for broadcast data that matches a specific filter, the broadcast processing methods corresponding to all filters configured on the main chip in the business process will be called to process the broadcast data. This results in a waste of computing power and power consumption.

[0074] Furthermore, external devices typically repeatedly send broadcast data with essentially the same payload within a broadcast cycle, creating duplicate broadcast data. The hard filtering framework doesn't support deduplication of broadcasts. In other words, in smart interconnected scenarios, all broadcasts reported by Bluetooth chipsets are parsed by the Trust Ring service. Consequently, parsing duplicate broadcast data adds unnecessary computational overhead and power consumption.

[0075] In addition, after the Bluetooth chip reports the broadcast that matches the filter, the Windows BLE scan is turned on. In other words, the Windows BLE scan is triggered by the broadcast that matches the filter. On the one hand, since the hard filtering framework does not support deduplication of broadcasts, each time a broadcast that matches the filter is obtained, the Windows BLE scan is triggered, so it will frequently trigger the start of the Windows BLE scan, resulting in problems such as increased power consumption and interference between devices. On the other hand, there is no setting for when to stop the Windows BLE scan. The longer the Windows BLE scan takes, the more BLE broadcasts need to be processed, which will also lead to problems such as increased power consumption and interference between devices. It can be seen from this that the related technology also does not provide the timing for starting and stopping the Windows BLE scan that conforms to the actual application scenarios of the trust ring (such as smart interconnection scenarios), which will lead to problems such as increased power consumption and interference between devices.

[0076] In summary, how to improve the efficiency of BLE scanning and reduce power consumption has become an urgent problem to be solved.

[0077] In the following, several possible technical solutions provided by this application are given in response to the technical problems to be solved by this application.

[0078] Technical Solution 1: When the first device receives the first broadcast reported by the hard filtering framework, it starts Windows scanning. For example, after the first device is initialized, the operating system is started, and the trust ring service is started along with the operating system. Subsequently, the broadcast reported by the hard filtering framework is understood as the first reported broadcast. Alternatively, the first broadcast reported by the hard filtering framework is the first broadcast received from the same external device within a broadcast cycle. After the Windows scan runs for 5 seconds, the Windows scan is turned off. During the Windows scan, the broadcast reported by the hard filtering framework is ignored.

[0079] This technical solution is simple to implement; however, Windows scanning is continuously turned on for 5 seconds, and a large number of Bluetooth broadcasts need to be processed, which consumes a lot of computing power and power consumption; in some scenarios, the first device only does not need Windows to cache external devices, nor does it need to establish a connection with external devices. In this scenario, continuing to perform Windows scanning will increase power consumption.

[0080] Technical Solution 2: When the first device receives the first broadcast reported by the hard filtering framework, it starts Windows scanning. During the Windows scanning period, it ignores the broadcast reported by the hard filtering framework. After the hard filtering framework stops reporting the broadcast, it closes Windows scanning.

[0081] This technical solution is simple to implement; however, the Windows scanning duration is consistent with the duration of the hardware filtering report, and more Bluetooth broadcasts need to be processed, consuming a lot of computing power and power consumption; in some scenarios, the first device only does not need Windows to cache external devices, nor does it need to establish a connection with external devices. In this scenario, continuing to perform Windows scanning will increase power consumption.

[0082] Technical Solution 3: When the first device receives the first broadcast reported by the hard filtering framework, it initiates Windows scanning and sets the time of Windows scanning initiation as the starting point of the scan delay. After 2 seconds, Windows scanning is disabled. During the Windows scan, broadcasts from the same external device within the same cycle reported by the hard filtering framework are ignored. During the Windows scan, if the hard filtering framework reports a broadcast from another external device, Windows scanning is initiated again, and the scan delay starting point is reset to the time when the Windows scan was re-initiated.

[0083] This technical solution is simple to implement; however, each cycle of Windows Bluetooth scanning takes 2 seconds longer than the hardware filtering scanning report, processes more broadcasts, and consumes a lot of computing power and power consumption; in some scenarios, the first device only does not need Windows to cache external devices, nor does it need to establish a connection with external devices. In this scenario, continuing to perform Windows scanning will increase power consumption.

[0084] Technical Solution 4: When the first device receives the broadcast reported by the hard filtering framework for the first time, it starts Windows scanning. Compare the broadcast obtained by the Windows scan to see if it matches a certain filter (for example, the broadcast content needs to be parsed according to the business logic to determine whether it matches), and compare the broadcast obtained by the Windows scan to see if it matches the external device reported by the hard filtering framework. Ignore broadcasts from the same external device belonging to the same period reported by the hard filtering framework. After the hard filtering framework stops reporting broadcasts, reset the broadcasts that have been reported.

[0085] This technical solution is relatively simple; however, the Windows Bluetooth scan duration is the same as the hardware filter scan reporting duration. To process more broadcasts, the broadcast content needs to be parsed according to business logic, which consumes a lot of computing power and power consumption. In some scenarios, the first device only does not need Windows to cache external devices, nor does it need to establish a connection with external devices. In this scenario, continuing to perform Windows scanning will increase power consumption.

[0086] As can be seen from the above, the above-mentioned technical solutions 1 to 4 provide possible solutions for deduplicating broadcast data reported through the hard filtering framework, and also provide possible solutions for setting the timing of starting and stopping Windows BLE scanning. However, for broadcast data that matches a certain filter, the broadcast processing methods corresponding to all filters configured on the main chip in the business process will be called to process the broadcast data, resulting in a waste of computing power and power consumption.

[0087] In view of this, the present application provides a Bluetooth scanning method. After acquiring broadcast data 1 through a Bluetooth chip configured with a filter, the method determines the filtering configuration information that matches the broadcast data 1. The filtering configuration information includes address information 1 of a callback function 1 for processing the broadcast data 1. The method then transmits the broadcast data 1 to the callback function 1 according to the address information 1.

[0088] The above solution matches the broadcast data with the filtering configuration information and accurately uses the callback function that matches the broadcast data to process the broadcast data, streamlining the processing flow, improving efficiency and reducing power consumption.

[0089] In some embodiments, when the current business does not require the local machine to establish a Bluetooth connection with an external device, the broadcast data 1 is directly transmitted to the callback function 1; when the current business requires the local machine to establish a Bluetooth connection with an external device, the operating system scan is started to obtain broadcast data 2 that belongs to the same broadcast cycle as the broadcast data 1, and the operating system transmits the broadcast data 2 to the callback function 1 based on the filtering configuration information that matches the broadcast data 1.

[0090] The above solution determines whether to enable operating system scanning based on whether the current business requires the local device to establish a Bluetooth connection with an external device. In other words, if the local device does not need to establish a Bluetooth connection with an external device, the operating system scanning can be disabled, thereby saving power while ensuring business operations.

[0091] In some embodiments, when the current service requires the local machine to establish a Bluetooth connection with an external device, the local machine first obtains the broadcast data of interest through a filter, and stores the matching information between the broadcast data of interest and the filter configuration information. Subsequently, the operating system initiates a scan, and upon detecting the broadcast data of interest, the local machine transmits the broadcast data of interest to the corresponding callback function based on the address information in the filter configuration information corresponding to the broadcast data.

[0092] In the above solution, the operating system only processes the broadcast data that the local machine is concerned about, which is equivalent to filtering the results of the operating system scan according to the filtering results of the filter, thereby reducing the broadcasts processed by the operating system as much as possible without affecting the current business, saving computing power and power consumption.

[0093] In some embodiments, if the current business does not require the local machine to establish a Bluetooth connection with an external device, before transmitting broadcast data 1 to callback function 1, it is necessary to determine whether a broadcast belonging to the same broadcast cycle as broadcast data 1 has been transmitted to callback function 1. If the judgment result is no, broadcast data 1 is transmitted to callback function 1; if the judgment result is yes, the operation of transmitting broadcast data 1 to callback function 1 is ignored. If the current business requires the local machine to establish a Bluetooth connection with an external device, before starting the operating system scan, it is also necessary to determine whether a broadcast belonging to the same broadcast cycle as broadcast data 2 has been transmitted to callback function 1. If the judgment result is no, broadcast data 2 is transmitted to callback function 1; if the judgment result is yes, the operation of transmitting broadcast data 2 to callback function 1 is ignored.

[0094] The above solution removes duplicate broadcast data before processing the broadcast data, which can reduce the number of duplicate broadcasts to be processed and save computing power and power consumption.

[0095] In some embodiments, after all broadcast data that requires the operating system to scan is transmitted to the corresponding callback function, the operating system stops scanning.

[0096] The above solution can minimize the number of broadcasts scanned by Microsoft, thereby saving computing power and power consumption for processing Bluetooth broadcasts.

[0097] Figure 2 Schematic diagram of a Bluetooth scanning method 200-1 provided in an embodiment of the present application. Exemplarily, the Bluetooth scanning method is applied to a first device, the first device having a Bluetooth chip and also including a trust ring service. For example, the trust ring service belongs to the application framework layer of the software architecture of the first device.

[0098] S201: Configure a plurality of first filters in a Bluetooth chip according to a plurality of first filter configuration information.

[0099] The plurality of first filters are used to filter the broadcast data received by the Bluetooth chip to obtain the first broadcast data related to the current service. The plurality of first filter configuration information corresponds one-to-one to the plurality of first filters.

[0100] It is understood that broadcast data that does not match the multiple first filters will be ignored and not transmitted to the trusted ring service. The first broadcast data here refers to broadcast data that corresponds one to one or more filters in the multiple first filters.

[0101] Exemplarily, the scanning component in the trust ring service sends a plurality of first filtering configuration information while sending a scanning instruction to the Bluetooth chip.

[0102] S202: Acquire second broadcast data from a second device through a plurality of first filters.

[0103] It can be understood that the second broadcast data matching one of the multiple first filters is taken as an example for description.

[0104] S203: Determine, from among the plurality of first filtering configuration information, second filtering configuration information that matches the second broadcast data.

[0105] The second filtering configuration information includes first address information, and the first address information indicates an address of a first callback function for parsing the second broadcast data.

[0106] For example, the first device has stored second indication information, and the second indication information indicates that the second broadcast data matches the second filtering configuration information. Therefore, the second filtering configuration information matching the second broadcast data is determined according to the second indication information.

[0107] For another example, the first device does not store indication information for indicating filtering configuration information that matches the second broadcast data. The first device determines a filter, such as the second filter, from among multiple first filters that matches the second broadcast data, thereby determining that the second broadcast data matches the second filtering configuration information of the second filter. Furthermore, the first device stores second indication information indicating that the second broadcast data matches the second filtering configuration information, so that in subsequent steps, when broadcast data associated with the second broadcast data is received, the second filtering configuration information can be directly determined based on the second indication information. For example, hash value 1 and hash value 2 calculated using a sum hash algorithm for the second broadcast data and the broadcast data associated with the second broadcast data are the same.

[0108] In a possible implementation, a filter matching the second broadcast data is determined from among a plurality of first filters according to the following embodiment.

[0109] For example, the second filtering configuration information includes an offset, characteristic data of the service data, and a mask of the service data. These three parameters can be understood as scanning parameters, which are sent to the Bluetooth chip through the scanning component, and the Bluetooth chip performs Bluetooth scanning according to the scanning parameters. Among them, the characteristic data corresponds to the bits of the mask one by one, and the offset is L, where L is a positive integer. The bit in the characteristic data corresponding to the first bit whose value in the mask is not 0 is used as the second bit, and the number of second bits is N, where N is a positive integer. The N bits starting from the Lth bit in the second broadcast data are used as the third bit. Determine whether the value of the second bit is the same as the value of the third bit. When the value of the second bit is the same as the value of the third bit, it is determined that the second broadcast data matches the second filter; or, when the value of the second bit is different from the value of the third bit, it is determined that the second broadcast data does not match the second filter.

[0110] For example, the second broadcast data is 101010101, the offset is 2, the characteristic data of the service data is 11100, and the mask of the service data is 11000. Bits 0 and 1 in the characteristic data correspond to the first non-zero bit in the mask, representing the second bit, i.e., 11. Furthermore, N = 2. L = 2. In the second broadcast data, the two bits starting from the second bit (i.e., the third and fourth bits) are used as the third bit, i.e., 10. The values of the second and third bits are different, so it is determined that the second broadcast data does not match the second filter.

[0111] For another example, the second broadcast data is 101011101, the offset is 4, the characteristic data of the service data is 11111, and the mask of the service data is 11100. The 0th, 1st, and 2nd bits in the characteristic data correspond to the first non-zero bit in the mask, which is the second bit, i.e., 111. Furthermore, N = 3. L = 4. In the second broadcast data, the three bits starting from the 4th bit (i.e., the 4th to 6th bits) are used as the third bit, i.e., 111. The second and third bits have the same value, so the second broadcast data is determined to match the second filter.

[0112] S204: Transmit the second broadcast data to the first callback function according to the first address information.

[0113] Exemplarily, S201 to S204 are performed by a trust ring.

[0114] The above solution determines the second filtering configuration information that matches the second broadcast data and accurately uses the first callback function that matches the second broadcast data to process the second broadcast data, thereby streamlining the processing flow, improving efficiency and reducing power consumption.

[0115] Optionally, S204 is performed when the second filtering configuration information does not include the first indication information.

[0116] The first indication information indicates that the operating system is enabled to cache the information of the scanned device, or the first indication information indicates that the current business requires the operating system to cache the information of the scanned device, or the first indication information indicates that the current business requires the first device to establish a Bluetooth connection with the scanned device.

[0117] It is understandable that whether the second filtering configuration information includes the first indication information may be determined according to upper-layer services in the trust ring service.

[0118] For example, if the current service does not require the first device to establish a Bluetooth connection with the scanned device (including the second device), or if the current service does not require the operating system to cache the scanned device information (that is, in S201, the second filtering configuration information sent by the scanning component to the Bluetooth chip does not include the first indication information), then S204 is executed without initiating the operating system scan. In other words, the Bluetooth chip reports the broadcast data to the trusted ring service through the hard filtering module rather than the operating system module.

[0119] That is to say, most of the Bluetooth broadcast data from external devices, including BLE broadcasts that do not match the filter and BLE broadcasts that match the filter when the current business does not require the operating system to cache the information of the scanned device, do not need to go through the Windows kernel Bluetooth protocol stack and the cross-platform application architecture layer, saving the power consumption of the main chip software parsing BLE broadcast data.

[0120] For another example, if the current business requires the first device to establish a Bluetooth connection with the scanned device (including the second device), or the current business requires the operating system to cache the information of the scanned device (that is, in S201, the second filtering configuration information sent by the scanning component to the Bluetooth chip includes the first indication information), S204 is not executed and S205 is executed.

[0121] Figure 3 A schematic diagram of a Bluetooth scanning method 200-2 provided in an embodiment of the present application.

[0122] like Figure 3 As shown, S201 to S203 can be seen in Figure 2 Related description in .

[0123] S205: Start the operating system to perform Bluetooth scanning.

[0124] For details, please refer to the description of operating system scanning above.

[0125] The above solution determines whether to enable operating system scanning based on whether the current business requires the local device to establish a Bluetooth connection with an external device. In other words, if a Bluetooth connection is required, the operating system will enable scanning. If not, the operating system will not enable scanning. This minimizes the number of broadcasts the operating system must handle, thereby saving power while ensuring business operations.

[0126] S206: Acquire fourth broadcast data from the second device through Bluetooth scanning performed by the operating system.

[0127] The fourth broadcast data and the second broadcast data belong to the same broadcast cycle. It is understood that the scanned device uses the same MAC address within a broadcast cycle and uses different MAC addresses in different broadcast cycles. For example, the fourth broadcast data and the second broadcast data can be determined to belong to the same broadcast cycle based on the fact that the MAC addresses of the fourth broadcast data and the second broadcast data are the same.

[0128] like Figure 3 As shown, the first device stores second indication information for indicating that the second broadcast data matches the second filtering configuration information. For example, the second indication information may be saved after determining the second filtering configuration information in S203, or may be stored by the first device before S203.

[0129] S207: Determine whether the fourth broadcast data matches the second indication information.

[0130] Exemplarily, if the MAC address of the fourth broadcast data is the same as that of the second broadcast data, it is determined that the fourth broadcast data matches the second indication information.

[0131] Exemplarily, if the hash values corresponding to the fourth broadcast data and the second broadcast data are the same, it is determined that the fourth broadcast data matches the second indication information.

[0132] For example, the second indication information includes a mapping relationship between a first hash value and the second filtering configuration information, where the first hash value is calculated based on the second broadcast data using a sum hash algorithm. S207 may specifically include: calculating a second hash value based on the fourth broadcast data using the sum hash algorithm; determining that the fourth broadcast data matches the second indication information if the first hash value and the second hash value are the same; or determining that the fourth broadcast data does not match the second indication information if the first hash value and the second hash value are different.

[0133] S208 : When the fourth broadcast data matches the second indication information, transmit the fourth broadcast data to the first callback function according to the first address information.

[0134] In the above scheme, the second broadcast data obtained by the hard filtering module can be understood as the broadcast data of interest to the first device. The hard filtering module first obtains the second broadcast data of interest to the first device, and stores second indication information indicating that the second broadcast data matches the second filtering configuration information. Based on the second indication information stored by the first device, the broadcast data of interest to the first device, obtained through the operating system scan, can be processed. This is equivalent to filtering the operating system scan results based on the filtering results of the hard filtering module, thereby minimizing the broadcasts processed by the operating system without affecting current services, saving computing power and power consumption.

[0135] In addition, the scanning of the hard filtering module is always in the on state when the trust ring service is turned on. The hard filtering module detects the broadcast of the matching filter from the external device (that is, the broadcast of the local machine's concern) through the Bluetooth chip, and will trigger the operating system scan according to the above process (for example, determine whether to execute the relevant content of S205). Because a broadcast cycle generally lasts for a few seconds, and the process of the operating system scanning the broadcast and reporting (for example, S206 to S208) takes about a few hundred milliseconds to complete, it can ensure that after the hard filtering module triggers the operating system scan, the operating system can scan the broadcast of the local machine's concern within the same broadcast cycle. Therefore, compared with the solution of always turning on or periodically turning on the operating system scan, it can reduce the number of broadcast signals processed by the operating system and save computing power and power consumption, and can also improve the scanning efficiency of the operating system.

[0136] Illustratively, after receiving the second broadcast data, the first device may first perform deduplication processing on the second broadcast data. If the second broadcast data is not duplicated with the previously reported broadcast data, step S204 is executed.

[0137] Figure 4 A schematic diagram of the Bluetooth scanning method 200-3 provided in an embodiment of the present application.

[0138] like Figure 4 As shown, S201 to S203 can be seen in Figure 2 Related description.

[0139] like Figure 4 As shown, the trusted ring service stores a first time, which is the time when the third broadcast data is transmitted to the first callback function. The third broadcast data comes from the second device, and the third broadcast data and the second broadcast data belong to the same broadcast period. In addition, the second filtering configuration information includes an interval threshold.

[0140] S204A: When the interval between the current time and the first time is greater than or equal to the interval threshold, transmit the third broadcast data to the first callback function according to the first address information.

[0141] For example, the current time is a moment within a period of time after the second filtering configuration information is determined.

[0142] Exemplarily, the interval threshold is smaller than the duration of the broadcast cycle to which the second broadcast data belongs.

[0143] This solution, for broadcast data received successively within a broadcast cycle belonging to the same device, does not simply deduplicate the later-received broadcast data. Instead, before transmitting the later-received broadcast data to the callback function, it determines whether the difference between the current time and the reporting time of the earlier-received broadcast data is greater than or equal to the interval threshold, and still reports the later-received broadcast data. This allows for scenarios such as when an external device is moving during Bluetooth scanning, by receiving and processing real-time updated broadcast data from the external device, improving Bluetooth scanning accuracy.

[0144] Optionally, the Bluetooth scanning method 200 - 3 further includes: ignoring the second broadcast data when the interval between the current time and the first time is less than an interval threshold.

[0145] This means that repeated broadcast data reporting can be avoided, saving computing power and energy. Repeated BLE broadcasts do not need to pass through the Windows kernel Bluetooth protocol stack and cross-platform application architecture layer, saving power consumption of the main chip software parsing BLE broadcast data.

[0146] Figure 5 A schematic diagram of a Bluetooth scanning method 200-4 provided in an embodiment of the present application.

[0147] like Figure 5 As shown, S201 to S207 can refer to Figure 3 Related description.

[0148] like Figure 5 As shown, the trusted ring service stores a second time, which is the time when the fifth broadcast data is transmitted to the first callback function. The fifth broadcast data is a broadcast from the second device obtained by the operating system, and the fifth broadcast data and the fourth broadcast data belong to the same broadcast period. In addition, the second filtering configuration information includes an interval threshold.

[0149] S208A: When the fourth broadcast data matches the second indication information and the interval between the current time and the second time is greater than or equal to the interval threshold, transmit the fourth broadcast data to the first callback function according to the first address information.

[0150] Exemplarily, the interval threshold is smaller than the duration of the broadcast cycle to which the second broadcast data belongs.

[0151] This solution, for broadcast data received successively within a broadcast cycle belonging to the same device, does not simply deduplicate the later-received broadcast data. Instead, before transmitting the later-received broadcast data to the callback function, it determines whether the difference between the current time and the reporting time of the earlier-received broadcast data is greater than or equal to the interval threshold, and still reports the later-received broadcast data. This allows for scenarios such as when an external device is moving during Bluetooth scanning, by receiving and processing real-time updated broadcast data from the external device, improving Bluetooth scanning accuracy.

[0152] Optionally, the Bluetooth scanning method 200-3 further includes: ignoring the four broadcast data when the interval between the current time and the second time is less than the interval threshold.

[0153] This means that repeated broadcast data reporting can be avoided, saving computing power and energy. Repeated BLE broadcasts do not need to pass through the Windows kernel Bluetooth protocol stack and cross-platform application architecture layer, saving power consumption of the main chip software parsing BLE broadcast data.

[0154] Optionally, the Bluetooth scanning method 200 - 2 or the Bluetooth scanning method 200 - 4 further includes: stopping the operating system scanning after the operating system scans all one or more broadcasts that the local computer is concerned about and reports them to the corresponding callback function.

[0155] For example, a first device stores information related to multiple broadcast data of interest to the first device (e.g., from different devices), such as third indication information. The third indication information includes second indication information and fourth indication information, the fourth indication information being used to indicate that sixth broadcast data from the third device matches third filtering configuration information, the third filtering configuration information including first indication information and second address information, the second address information indicating the address of a second callback function for parsing the sixth broadcast data.

[0156] According to the above embodiment, after the operating system scan is initiated, the operating system scans the eighth broadcast data from the third device, determines that the eighth broadcast data and the sixth broadcast data belong to the same broadcast cycle and match the fourth indication information, and transmits the eighth broadcast data to the second callback function according to the second address information. After all broadcast data matching the third indication information has been transmitted to the corresponding callback function, the operating system stops scanning.

[0157] The above solution stops the operating system scanning after scanning all broadcasts of interest to the local device and reporting them to the corresponding callback function. This ensures that no broadcasts are missed, reduces the time Microsoft spends scanning, significantly reduces the number of broadcasts to be processed, lowers computational complexity, and saves power. It's understandable that the operating system takes several hundred milliseconds to start and stop scanning, while the broadcast cycle typically lasts several seconds. Therefore, ensuring that the operating system's scanning window falls within the broadcast cycle ensures a high probability of successfully detecting the broadcasts of interest to the local device.

[0158] For Bluetooth scanning methods 200-1 through 200-4 described above, if the second filtering configuration includes the fifth indication information, indicating that the scan response should be ignored, that is, the current service may not be interested in ManufacturerData. In this case, in Bluetooth scanning methods 200-1 through 200-4, the broadcast data transmitted to the first callback function does not include ManufacturerData. If the trusted ring service determines that the broadcast data is not service data, it will ignore it.

[0159] For Bluetooth scanning methods 200-1 through 200-4 described above, if the second filtering configuration information does not include the fifth indication information, after obtaining service data, if the manufacturer data corresponding to the service data is obtained, the manufacturer data will also be transmitted to the callback function corresponding to the service data. Alternatively, if the manufacturer data corresponding to the manufacturer data is obtained but the service data corresponding to the manufacturer data has not yet been obtained, the manufacturer data will be ignored.

[0160] If the second filtering configuration information does not include the fifth indication information, after the service data has been obtained, the manufacturer data corresponding to the service data is obtained, and the operating system scan will not be triggered.

[0161] The following combination Figure 6 The present application introduces Bluetooth scanning methods 300 - 1 to 300 - 7 .

[0162] Figure 6 This is a schematic diagram of the Bluetooth scanning process 300 provided in this application.

[0163] like Figure 6 As shown, the hard filtering module may include a matching module, a throttle valve module and a deduplication module 2; wherein the throttle valve module may include a deduplication module 1. Figure 6As shown, the operating system module includes a Microsoft scanning module as an example for explanation.

[0164] The Bluetooth scanning methods 300 - 1 to 300 - 7 correspond to different situations respectively.

[0165] Case 1: The broadcast data scanned by the Bluetooth chip (for example, from external device 1, belonging to broadcast cycle 1) is ServiceData. Neither the direct reporting mapping set nor the known broadcast mapping set matches the broadcast data. For example, both the direct reporting mapping set and the known broadcast mapping set are empty, or at least one of the direct reporting mapping set and the known broadcast mapping set includes a mapping relationship related to other broadcast data (for example, from external device 2). For example, after device initialization, the broadcast data is the broadcast data from external device 1 belonging to broadcast cycle 1 that is first scanned by the Bluetooth chip.

[0166] Case 1 also includes sub-case A or sub-case B.

[0167] Subcase A: The filtering configuration information does not include the first indication information mentioned above.

[0168] Subcase B: the filtering configuration information includes the first indication information above.

[0169] Case 2: The broadcast data scanned by the Bluetooth chip is ServiceData, and the mapping set reported directly matches the broadcast data.

[0170] Case 3: The broadcast data scanned by the Bluetooth chip is ServiceData, and the known broadcast mapping set matches the broadcast data.

[0171] Case 4: The broadcast data scanned by the Bluetooth chip is ManufacturerData (for example, from external device 1, belonging to broadcast cycle 1), and neither the directly reported mapping set nor the known broadcast mapping set includes a mapping relationship that matches the service data from external device 1. For example, after device initialization, the broadcast data is the broadcast data from external device 1 that is first scanned by the Bluetooth chip and belongs to broadcast cycle 1.

[0172] Case 4 also includes sub-case C or sub-case D.

[0173] Subcase C: The MAC setting mapping set does not match the broadcast data.

[0174] Subcase D: The MAC setting mapping set matches the broadcast data.

[0175] Wherein, sub-case D also includes sub-case D-1 or sub-case D-2.

[0176] Subcase D-1: the filtering configuration information includes the first indication information above.

[0177] Subcase D-2: The filtering configuration information does not include the first indication information above.

[0178] Case 5: The broadcast data scanned by the Bluetooth chip is ManufacturerData, and the mapping set reported directly matches the broadcast data.

[0179] Case 6: The broadcast data scanned by the Bluetooth chip is ManufacturerData, the known broadcast mapping set matches the broadcast data, and the MAC setting mapping set matches the broadcast data. The filtering configuration information includes the first indication information above.

[0180] The following combination Figure 6 The Bluetooth scanning method 300-1 provided in the embodiment of the present application is introduced. The Bluetooth scanning method 300-1 corresponds to case 1 (including sub-case A), and further examples are given for the Bluetooth scanning method 200-1 or the Bluetooth scanning method 200-3. The Bluetooth scanning method 300-1 does not involve Figure 6 The deduplication module 2 and the operating system module in .

[0181] A1, the hard filtering module starts hard filtering scanning.

[0182] Before A1, the trusted ring service (eg, the scanning component therein) issues a scanning instruction, and the hard filtering module obtains filtering configuration information from the trusted ring service. Exemplarily, the filtering configuration information is determined based on upper-layer services in the trusted ring service.

[0183] For example, the filtering configuration information includes scanning parameters and filtering parameters.

[0184] The scanning parameters include service data identifier (ServiceDataUuid), characteristic data of service data (ServiceData) (for example, it can be called filter), service data mask (ServiceDataMask), offset (offset) and other parameters.

[0185] The filtering parameters are used to set the configuration of the hard filtering scanning module.

[0186] For example, the filter parameter indicates the scanning mode. This application mainly uses the system API default scanning mode as an example to illustrate. Alternatively, the scanning mode can also be passive scanning, which is not limited in this application.

[0187] When the scan mode is active scan, the filter parameter can optionally indicate to ignore scan responses. For example, if the filter parameter does not indicate to ignore scan responses, it means that the filter parameter instructs the Bluetooth chip to report the corresponding ManufacturerData after reporting ServiceData to the Trusted Ring Service, or instructs the Bluetooth chip to report the complete broadcast data to the Trusted Ring Service. For example, if the filter parameter indicates to ignore scan responses, it means that the filter parameter instructs the Bluetooth chip not to report ManufacturerData. Figure 6 The example in which the filter parameter indicates to ignore the scan response is used for explanation, but it is not limited to this.

[0188] For example, the filtering parameter indicates whether to enable Windows Bluetooth device caching. For example, the filtering parameter includes first indication information, and the filtering parameter indicates enabling Windows Bluetooth device caching; or the filtering parameter does not include the first indication information, and the filtering parameter does not indicate enabling Windows Bluetooth device caching.

[0189] For example, the filtering parameters do not indicate the interval threshold, and the hard filtering module does not perform deduplication before transmitting the broadcast data to the callback function. The hard filtering module does not include a deduplication module (e.g. Figure 6 Deduplication module 1 and deduplication module 2 in ).

[0190] For example, the filter parameter indicates an interval threshold, which is used to determine whether two broadcast data received successively are duplicate broadcasts. Before the hard filtering module transmits the broadcast data to the callback function, it performs deduplication processing on the broadcast data according to the interval threshold. The hard filtering module includes a deduplication module (e.g. Figure 6 Deduplication module 1 and deduplication module 2 in ).

[0191] For example, the filter parameter indicates whether to set the throttle valve. In the case where the filter parameter does not indicate to enable the Windows Bluetooth device cache, the filter parameter indicates that the hard filter module directly transmits the broadcast data through the throttle valve to the corresponding callback function. Taking the filter parameter indicating to set the throttle valve as an example, Figure 6 The hard filtering module includes a throttle module. For example, if the filtering parameter does not indicate setting a throttle, the hard filtering module transmits the broadcast data matching the direct reporting mapping set to the corresponding callback function without passing through the throttle.

[0192] It is understandable that the throttle valve is specifically implemented by the business module included in the trust ring service. For example, the business module sets different throttle strategies for the throttle valve. For example, the throttle strategy is to periodically open the throttle valve. For another example, when the filter parameter indicates the interval threshold, the throttle strategy is to perform deduplication processing on the broadcast data according to the interval threshold (for example, Figure 6 The middle throttle valve module includes a de-weighting module 2).

[0193] In the case where the filter parameter indicates enabling Windows Bluetooth device caching, the filter parameter may optionally indicate an operating system scanning policy. The scanning policy is the timing for the operating system to start scanning and / or stop scanning.

[0194] For example, the operating system starts scanning when the hard filtering module obtains broadcast data that matches the filter, or when the hard filtering module obtains broadcast data that matches the filter parameters (a specific example of determining whether a match is found by calculating a hash value will be described below).

[0195] For another example, the filtering parameters also indicate an interval threshold. The operating system starts scanning when the hard filtering module obtains broadcast data that matches the filter, or when the hard filtering module obtains broadcast data that matches the filtering parameters; and determines that the broadcast data is not repeated broadcast data.

[0196] For example, for broadcast data that needs to be scanned and then reported by the operating system, the operating system stops scanning when such broadcast data has been reported.

[0197] For example, the filtering parameter indicates a minimum RSSI threshold for received signal strength indication (RSSI). The distance between the external device sending the broadcast and the first device is determined based on the RSSI of the broadcast data. If the RSSI of a broadcast is less than or equal to the minimum RSSI threshold, it means that the distance between the external device and the first device is too far and the Bluetooth connection is likely unstable. In this case, the hard filtering module does not initiate the operating system scan.

[0198] For example, the filter parameter indicates the callback function corresponding to the filter. Specifically, assuming the hard filtering module configures multiple filters in the Bluetooth chip, the filter parameter includes multiple callback functions. Multiple filters correspond to multiple callback functions in a one-to-one manner, and the callback function indicates the callback function address corresponding to each filter. Therefore, the callback function corresponding to the broadcast data can be determined based on the matching relationship between the broadcast data and the filter.

[0199] After receiving the broadcast data 3 from the external device, A2 calculates the hash value.

[0200] The broadcast data 3 includes a random MAC address, a timestamp, broadcast description information, payload data, and data indication information. The data indication information is used to indicate whether the broadcast data 3 is ServiceData, or to indicate whether the broadcast data 3 is ServiceData or ManufacturerData. Assume that the data indication information in the broadcast data 3 indicates that the broadcast data 3 is ServiceData.

[0201] The hash value of the broadcast data 3 is calculated according to the sum hash algorithm to obtain the hash value 3.

[0202] Exemplarily, a hash value is calculated for the broadcast data 3 using a sum hash algorithm according to the bit width of the Windows system and the bit width of the chip (these two bit widths may be the same or different).

[0203] It is understandable that the calculation of the hash algorithm is usually more complicated. Although the complex calculation can ensure that the probability of hash value collision is as low as possible, it has higher power consumption requirements.

[0204] This application performs summation and hash calculation on multiple broadcast data sent by devices with the same account in a near-field environment (for example, devices logged in to the same Honor account in a smart interconnection scenario).

[0205] For example, if a broadcast service data contains 31 bytes and the PC bit width is 64 bits, or 8 bytes, then the PC can perform a calculation on two 8-byte sub-data in the service data at a time. For the 31-byte service data, only three calculations are needed to obtain the hash value. Compared with conventional hash algorithms, this can use as few calculation instructions as possible, reducing computational complexity, speeding up calculations, and lowering power consumption.

[0206] Moreover, in the current scenario, this application has verified through experiments that when the number of devices logging into the same account is less than a certain threshold (for example, the number of devices is 7 or 8 or 9), the hash values obtained by the sum hash algorithm almost never collide, that is, the smallest possible collision probability can be achieved in this scenario.

[0207] Therefore, the present application calculates the hash value of the broadcast data through the sum hash algorithm, which can take into account both the highest possible computing efficiency and the smallest possible collision probability.

[0208] A3: Determine whether the mapping set is matched and reported directly.

[0209] Exemplarily, the direct reporting mapping set (as a possible example of the second indication information) is used to store a mapping relationship 1 between the hash value and the filtering configuration information, and the filtering parameters in the filtering configuration information corresponding to the direct reporting mapping set do not indicate enabling Windows Bluetooth device cache.

[0210] For example, the directly reported mapping set is stored in the trust ring service.

[0211] Case 1 includes that after the first device is initialized, the default reporting mapping set is empty.

[0212] The hash value 3 does not match the directly reported mapping set, the judgment result of A3 is no, and A4 is subsequently executed.

[0213] A4: Determine whether the known broadcast mapping set is matched.

[0214] Exemplarily, it is known that the broadcast mapping set (as another possible example of the second indication information) is used to store the mapping relationship 2 between the hash value and the filtering configuration information, and directly reporting the filtering parameters in the filtering configuration information corresponding to the mapping set does not indicate enabling the Windows Bluetooth device cache.

[0215] For example, a known broadcast mapping set is stored in a trust ring service.

[0216] Case 1 also includes that after the first device is initialized, the default known broadcast mapping set is empty.

[0217] Then the hash value 3 does not match the known broadcast mapping set, the judgment result of A4 is no, and the hash value 3 is transmitted to the input of the matching module, and the matching module subsequently executes the subsequent steps.

[0218] C1, determine whether it is service data.

[0219] Case 1 also includes that the broadcast data 3 is service data.

[0220] If the result of judgment C1 is yes, then C2 is executed.

[0221] C2, determines whether the filter is matched.

[0222] Here, the broadcast data 3 is matched with multiple filtering configurations in sequence.

[0223] For example, the matching rule is: the bits of the broadcast data starting from the offset position specified by the filter and corresponding to the non-0 bits of ServiceDataMask are the same as the characteristic data bits of ServiceData. For details, please refer to the relevant description of determining the filter that matches the second broadcast data above.

[0224] If the broadcast data 3 does not match the filter, the judgment result is no, and C4 is executed, that is, the broadcast data 3 is ignored, and the process ends.

[0225] Assume that the broadcast data 3 matches the filter A, and the filter A corresponds to the filtering configuration information X. If the judgment result is yes, then C5 is executed.

[0226] C5: Save the MAC mapping relationship.

[0227] The mapping relationship X1 between the MAC address 1 of the broadcast data 3 and the filtering configuration information X is saved in the MAC setting mapping set. Exemplarily, the MAC setting mapping set is stored in the trust ring service.

[0228] C6, determines whether to enable the operating system cache.

[0229] Subcase A: The filtering configuration information does not include the first indication information mentioned above.

[0230] If the judgment result is no, the mapping relationship X2 between the hash value 3 and the filtering configuration information X is saved to the direct reporting mapping set, and the hash value 3 is output to A3.

[0231] A3: Determine whether the mapping set is matched and reported directly.

[0232] The mapping relationship X2 included in the direct reporting mapping set matches the hash value 3 of the broadcast data 3. The judgment result is yes, and the broadcast data 3 is input into the throttle valve module.

[0233] B1, determine whether to set the throttle valve.

[0234] In the case that the filtering configuration information X indicates setting a throttle valve, the judgment result of B1 is yes, and subsequent steps are executed according to the throttling strategy.

[0235] Throttling strategies reduce data reporting by setting the throttle valve's opening and closing policies, thereby reducing data transmission pressure and, to a certain extent, reducing duplicate data reporting. For example, a throttling strategy with a 5-second cycle of opening for 2 seconds and closing for 3 seconds can reduce data reporting by 60%.

[0236] If the result of determination B1 is yes, then determination B8 is made as to whether the throttle valve is in an open state.

[0237] If the result of B8 is negative, B9 is executed and ignored, that is, broadcast data 3 is ignored.

[0238] If the result of determination in B8 is yes, then B4 is executed to determine whether it is service data.

[0239] Case 1 also includes that the broadcast data 3 is service data.

[0240] If the result of the judgment in B4 is yes, the throttle valve outputs the broadcast, that is, transmits the broadcast data 3 to the processing address X indicated by the filtering configuration information X.

[0241] In the case that the filtering configuration information X does not indicate setting a throttle valve, the judgment result of B1 is no, and the broadcast data is transmitted to the deduplication module 1 for deduplication processing.

[0242] If the result of the determination in B1 is no, B2 determines whether the time interval is less than the interval threshold.

[0243] This time interval is the interval between the current time and the first time #1 at which other broadcast data from external device 1 is received within broadcast cycle 1. In case 1, the broadcast data is the first broadcast data from external device 1 scanned by the Bluetooth chip within broadcast cycle 1. Therefore, the first time is not stored at this time. Therefore, the result of determination B2 is no, and B3 is subsequently executed.

[0244] B3, save the current time.

[0245] For example, the current time is used as the first time #2 to execute B2 for other broadcast data received in broadcast cycle 1. For example, the current time is saved as the first time #2 associated with mapping relationship X2 and used as the reporting time for broadcast data 3. This also serves as the last reporting time for other subsequent broadcast data with the same payload or hash value.

[0246] B4, determine whether it is service data.

[0247] For details, please refer to the relevant description of B4 above and will not be repeated here.

[0248] In one implementation, a reporting status is set for the mapping relationships in the known broadcast mapping set and the direct reporting mapping set. For example, the reporting status may include reported or unreported. When mapping relationship X2 is saved to the direct reporting mapping set, the reporting status of mapping relationship X2 is unreported. After broadcast data 3 is transmitted to the filtering configuration information X indication processing address X, the reporting status of mapping relationship X2 in the direct reporting mapping set can be set to reported.

[0249] The following combination Figure 6 The Bluetooth scanning method 300-2 provided in the embodiment of the present application is introduced. The Bluetooth scanning method 300-2 corresponds to case 1 (including sub-case B), and further examples are given for the Bluetooth scanning method 200-2 or the Bluetooth scanning method 200-4. The Bluetooth scanning method 300-2 does not involve Figure 6 The throttle valve module in.

[0250] Execute A1 to A4 first, then C1, C2, and C5. Refer to the description of A1 to A4, C1, C2, and C5 before C6 in Bluetooth scanning method 300-1, with the following difference: replace broadcast data 3, hash value 3, mapping relationship X1, MAC address 1, and filter configuration information X in Bluetooth scanning method 300-1 with broadcast data 4, hash value 4, mapping relationship Y1, MAC address 2, and filter configuration information Y, respectively.

[0251] C6, determines whether to enable the operating system cache.

[0252] Subcase B: the filtering configuration information includes the first indication information above.

[0253] If the judgment result is yes, the mapping relationship Y2 between the hash value 4 and the filtering configuration information Y is saved to the known broadcast mapping set, and the hash value 4 is output to A4 along the arrow marked by C7, and then input into the deduplication module 2 along the arrow marked by C8.

[0254] Depend on Figure 6 It can be seen that the judgment contents of D1 and A4 are consistent.

[0255] D1, determine whether it matches the known broadcast mapping set.

[0256] It is known that the mapping relationship Y2 included in the broadcast mapping set matches the hash value 4 of the broadcast data 4. The judgment result is yes, and D2 is subsequently executed.

[0257] D2, determines whether the time interval is less than the interval threshold.

[0258] This time interval is the interval between the current time and the first time #3 at which additional broadcast data from external device 1 is received within broadcast cycle 1. In scenario 1, the broadcast data is the first broadcast data from external device 1 scanned by the Bluetooth chip within broadcast cycle 1. Therefore, the first time is not stored at this time. Therefore, the result of determination D2 is no, and D3 is subsequently executed.

[0259] D3, set to not reported. That is, set the reporting status of the mapping relationship Y2 to not reported, or determine the broadcast data 4 as data to be reported.

[0260] In one implementation, a reporting status is set for mapping relationships in a known broadcast mapping set and a direct reporting mapping set. For example, the reporting status may include reported or unreported. Taking the direct reporting mapping set as an example, when a mapping relationship is saved to the direct reporting mapping set, the reporting status of the mapping relationship is unreported. Taking the known broadcast mapping set as an example, if the broadcast data matched by a mapping relationship in the set has been transmitted to the corresponding processing address, the reporting status of the mapping relationship is set to reported.

[0261] D4, save the current time.

[0262] For example, the current time is saved as the first time #4, which is used to execute D2 for other received broadcast data belonging to the broadcast cycle 1.

[0263] D7, determines whether it is service data.

[0264] Case 1 includes that the broadcast data 4 is service data.

[0265] If the judgment result of D7 is yes, the broadcast data 4 is output and the Microsoft scanning module is triggered to execute E1.

[0266] E1, start Microsoft Scan.

[0267] E2, determine whether it has timed out.

[0268] For example, if you set the scan duration threshold for Microsoft Scan to 5 seconds, if the scan duration is greater than or equal to 5 seconds after the scan is started, it times out and E3 is executed. Otherwise, the scan continues to scan for external device broadcasts.

[0269] If the Microsoft scan times out, E3 indicates the scan ends.

[0270] After scanning the external device broadcast (eg, broadcast data 5), E4 determines whether it matches the known broadcast mapping set.

[0271] Perform a sum hash calculation on the broadcast data 5 to obtain a hash value 5. If it is known that the broadcast mapping set includes a mapping relationship that matches the hash value 5, the judgment result of E4 is yes, and E6 is executed subsequently; otherwise, the judgment result is no, and E5 is executed subsequently, that is, the broadcast data 5 is ignored.

[0272] E6, determine whether it has been reported.

[0273] Assuming hash value 5 = hash value 4, broadcast data 5 matches mapping relationship Y2. Then, determine whether the reporting status of mapping relationship Y2 is reported. If the reporting status of mapping relationship Y2 is reported, it means that the broadcast data from the same device and in the same broadcast cycle as broadcast data 5 has been reported to the corresponding processing address.

[0274] If the result of determination in step E6 is yes, step E5 is executed, thereby preventing the broadcast data with the same payload from being repeatedly sent to the corresponding processing address.

[0275] If the result of E6 is negative, execute E7.

[0276] E7, set to reported.

[0277] That is, in the known broadcast mapping set, the reporting status of the mapping relationship Y2 is set to reported.

[0278] E8, report.

[0279] That is, the broadcast data 5 is output and transmitted to the processing address Y indicated by the filtering configuration information Y.

[0280] E9: Determine whether all known broadcast mapping sets have been reported.

[0281] That is, it is determined whether the reporting status of all mapping relationships in the known broadcast mapping set are reported.

[0282] If the judgment result of E9 is yes, execute E10.

[0283] E10, stop Microsoft scanning.

[0284] For example, in E2, a timer is used to start timing when the scan is started. After E10, the timer can be notified to stop timing.

[0285] The following combination Figure 6 Introduce the Bluetooth scanning method 300-3 provided in the embodiment of the present application. The Bluetooth scanning method 300-33 corresponds to situation 2, and further examples are given for the Bluetooth scanning method 200-1 or the Bluetooth scanning method 200-3. The Bluetooth scanning method 300-3 does not involve Figure 6 The matching module, deduplication module 2 and operating system module in .

[0286] Execute A1 to A2. For details, please refer to the relevant descriptions of A1 and A2 in the Bluetooth scanning method 300-1. The difference is that the broadcast data 3 and hash value 3 in the Bluetooth scanning method 300-1 are replaced with broadcast data 6 and hash value 6.

[0287] A3: Determine whether the mapping set is matched and reported directly.

[0288] Case 2 includes: the directly reported mapping set matches the broadcast data 6.

[0289] The judgment result of A3 is yes, and the broadcast data 6 is subsequently input into the throttle valve module.

[0290] Specifically, please refer to the relevant description of the steps performed by the throttle module in the Bluetooth scanning method 300-1. The difference is that the broadcast data 3, filtering configuration information X, the first time #1 and the first time #2 are replaced by broadcast data 6, filtering configuration information Z, the first time #2 and the first time #5 respectively, and "Case 1 also includes, broadcast data 3 is service data" is replaced by "Case 2 also includes, broadcast data 6 is service data".

[0291] The following combination Figure 6 Introduce the Bluetooth scanning method 300-4 provided in the embodiment of the present application. The Bluetooth scanning method 300-4 corresponds to situation 3, and further examples are given for the Bluetooth scanning method 200-2 or the Bluetooth scanning method 200-4. The Bluetooth scanning method 300-4 does not involve Figure 6 The matching module and throttle valve module in.

[0292] Execute A1 to A3. For details, please refer to the relevant descriptions of A1 to A3 in the Bluetooth scanning method 300-1. The difference is that the broadcast data 3 and hash value 3 in the Bluetooth scanning method 300-1 are replaced by broadcast data 7 and hash value 7 respectively.

[0293] A4: Determine whether the known broadcast mapping set is matched.

[0294] It is known that the broadcast mapping set (as another possible example of the second indication information) is used to store the mapping relationship 2 between the hash value and the filtering configuration information. Directly reporting the filtering parameters in the filtering configuration information corresponding to the mapping set does not indicate enabling the Windows Bluetooth device cache.

[0295] For example, a known broadcast mapping set is stored in a trust ring service.

[0296] Case 3 includes: a known broadcast mapping set matches the broadcast data.

[0297] If the judgment result of A4 is yes, the broadcast data 7 is input into the deduplication module 2 .

[0298] Depend on Figure 6 It can be seen that the judgment contents of D1 and A4 are consistent.

[0299] D1, determine whether it matches the known broadcast mapping set.

[0300] If the judgment result of D1 is yes, execute D2.

[0301] D2, determines whether the time interval is less than the interval threshold.

[0302] The time interval is the time interval between the current time and the first time #6 at which other broadcast data belonging to broadcast cycle 1 is received from external device 1.

[0303] If the time interval between the current time and the first time #6 is less than the interval threshold, execute D5.

[0304] D5, save the current time. That is, save the current time as the first time #7.

[0305] D8, ignore. That is, ignore broadcast data 7.

[0306] If the time interval between the current time and the first time #6 is greater than or equal to the interval threshold, execute D3.

[0307] D3, set to not reported. That is, the reporting status of the mapping relationship W corresponding to the broadcast data 7 is set to not reported, or the broadcast data 7 is determined as data to be reported.

[0308] In one implementation, a reporting status is set for mapping relationships in a known broadcast mapping set and a direct reporting mapping set. For example, the reporting status may include reported or unreported. Taking the direct reporting mapping set as an example, when a mapping relationship is saved to the direct reporting mapping set, the reporting status of the mapping relationship is unreported. Taking the known broadcast mapping set as an example, if the broadcast data matched by a mapping relationship in the set has been transmitted to the corresponding processing address, the reporting status of the mapping relationship is set to reported.

[0309] D4, save the current time.

[0310] For example, the current time is saved as the first time #7, which is used to execute D2 for other received broadcast data belonging to broadcast cycle 1.

[0311] D7, determines whether it is service data.

[0312] Case 3 also includes that the broadcast data 7 is service data.

[0313] If the judgment result of D7 is yes, the broadcast data 7 is output and the Microsoft scanning module is triggered to execute E1.

[0314] Subsequently, the Microsoft scanning module processes the broadcast data 7. Please refer to the relevant descriptions of E1 to E10 in the Bluetooth scanning method 300-3. The difference is that the broadcast data 5, mapping relationship Y2, filtering configuration information Y and processing address Y in the Bluetooth scanning method 300-3 are replaced by broadcast data 8, mapping relationship W, filtering configuration information W and processing address W respectively.

[0315] The following combination Figure 6 The Bluetooth scanning method 300-5 provided in the embodiment of the present application is introduced. The Bluetooth scanning method 300-5 corresponds to Case 4 (including sub-case C), and further examples are given for the case where the broadcast data is ManufacturerData. The Bluetooth scanning method 300-5 does not involve Figure 6 The deduplication module 2, throttle valve module and operating system module in it.

[0316] Execute A1 to A4. Refer to the description of A1 to A4 before C6 in the Bluetooth scanning method 300-1, except that the broadcast data 3 and hash value 3 in the Bluetooth scanning method 300-1 are replaced with broadcast data 9 and hash value 9, respectively.

[0317] C1, determine whether it is service data.

[0318] Case 4 includes: the broadcast data scanned by the Bluetooth chip is ManufacturerData.

[0319] If the judgment result of C1 is no, execute C3.

[0320] C3, determines whether the MAC address matches.

[0321] Subcase C includes: the MAC setting mapping set does not match the broadcast data.

[0322] If the judgment result of C3 is negative, C4 is executed and ignored, that is, broadcast data 9 is ignored.

[0323] The following combination Figure 6 The Bluetooth scanning method 300-6 provided in the embodiment of the present application is introduced. The Bluetooth scanning method 300-6 corresponds to Case 4 (including sub-case D), and further examples are given for the case where the broadcast data is ManufacturerData. The Bluetooth scanning method 300-6 does not involve Figure 6 The throttle valve module and operating system module in.

[0324] Execute A1 to A4. Refer to the description of A1 to A4 before C6 in the Bluetooth scanning method 300-1, except that the broadcast data 3 and hash value 3 in the Bluetooth scanning method 300-1 are replaced with broadcast data 10 and hash value 10, respectively.

[0325] To execute C1, please refer to the description of C1 in the Bluetooth scanning method 300-5.

[0326] C3, determines whether the MAC address matches.

[0327] Subcase D includes: the MAC setting mapping set matches the broadcast data 10.

[0328] If the judgment result of C3 is yes, execute C6.

[0329] For example, the known broadcast mapping set includes a mapping relationship R1 between hash value 12 and filtering configuration information R. Hash value 12 is obtained by performing a sum hash algorithm on broadcast data 12. If the judgment result of C3 is yes, the mapping relationship R2 between broadcast data 10, hash value 12, and filtering configuration information R is optionally saved to the known broadcast mapping.

[0330] Subcase D-1: the filtering configuration information includes the first indication information above.

[0331] If the judgment result of C6 is yes, the hash value 10 is output to A4 along the arrow marked by C7, and then input to the deduplication module 2 along the arrow marked by C8.

[0332] Depend on Figure 6 It can be seen that the judgment contents of D1 and A4 are consistent.

[0333] D1, determine whether it matches the known broadcast mapping set.

[0334] Case 4 includes: the broadcast data 10 does not match a known broadcast mapping set.

[0335] If the judgment structure of D1 is no, execute D6.

[0336] D6, set as not reported. That is, the broadcast data 10 is determined as data to be reported.

[0337] D9, save the current time.

[0338] D7, determines whether it is service data.

[0339] Case 4 includes: the broadcast data scanned by the Bluetooth chip is ManufacturerData.

[0340] If the judgment result of D7 is negative, execute D5.

[0341] D5, save the current time.

[0342] D8, ignore. That is, ignore broadcast data 10.

[0343] Subcase D-2: The filtering configuration information does not include the first indication information above.

[0344] The judgment result of C6 is no, and the hash value 10 is output to A3.

[0345] If the judgment result of A3 is no, A4 is executed. If the judgment result of A4 is yes, the broadcast data 10 is input into the deduplication module 2.

[0346] D1, determine whether it matches the known broadcast mapping set.

[0347] If the judgment result of D1 is yes, execute D2.

[0348] D2, determines whether the time interval is less than the interval threshold.

[0349] For the time interval, please refer to the relevant description above.

[0350] If the result of D2 is yes, execute D5.

[0351] D5, save the current time.

[0352] D8, ignore. That is, ignore broadcast data 10.

[0353] If the result of D2 is negative, execute D3.

[0354] D3, set as not reported. That is, the broadcast data 10 is determined as data to be reported.

[0355] In one implementation, a reporting status is set for mapping relationships in a known broadcast mapping set and a direct reporting mapping set. For example, the reporting status may include reported or unreported. Taking the direct reporting mapping set as an example, when a mapping relationship is saved to the direct reporting mapping set, the reporting status of the mapping relationship is unreported. Taking the known broadcast mapping set as an example, if the broadcast data matched by a mapping relationship in the set has been transmitted to the corresponding processing address, the reporting status of the mapping relationship is set to reported.

[0356] D4, save the current time.

[0357] D7, determines whether it is service data.

[0358] If the judgment result of D7 is negative, execute D5.

[0359] D5, save the current time.

[0360] D8, ignore. That is, ignore broadcast data 10.

[0361] The following combination Figure 6 Introduce the Bluetooth scanning method 300-7 provided in the embodiment of the present application. The Bluetooth scanning method 300-7 corresponds to case 5 and provides a further example for the case where the broadcast data is ManufacturerData. The Bluetooth scanning method 300-7 does not involve Figure 6 The matching module, deduplication module 2 and operating system module in .

[0362] Execute A1 to A3. For details, please refer to the relevant description of A1 to A3 in Bluetooth scanning method 300-3. The difference is that the broadcast data 6 and hash value 6 are replaced by broadcast data 11 and hash value 11, and case 2 is replaced by case 5.

[0363] The directly reported mapping includes a mapping relationship V1, and the mapping relationship V1 is a mapping relationship between the hash value 11 and the filtering configuration information V.

[0364] After A3, the broadcast data 11 is input to the throttle module.

[0365] B1, determine whether to set the throttle valve.

[0366] In the case that the filtering configuration information V indicates setting a throttle valve, the judgment result of B1 is yes, and subsequent steps are executed according to the throttling strategy.

[0367] For the throttling strategy, please refer to the relevant description above.

[0368] If the result of determination B1 is yes, then determination B8 is made as to whether the throttle valve is in an open state.

[0369] If the result of B8 is negative, B9 is executed and ignored, that is, the broadcast data 11 is ignored.

[0370] If the result of determination in B8 is yes, then B4 is executed to determine whether it is service data.

[0371] Case 5 also includes that the broadcast data 11 is not service data.

[0372] If the judgment result of B4 is negative, B5 is executed.

[0373] B5, determine whether to skip reporting.

[0374] Specifically, whether to skip reporting the broadcast data 11 is determined according to whether the filtering configuration information V indicates to ignore the scan response.

[0375] If the filtering configuration information V indicates to ignore the scan response, the judgment result of B5 is yes, and then B9 is executed, ignoring, that is, ignoring the broadcast data 11.

[0376] If the filtering configuration information V does not indicate to ignore the scan response, the judgment result of B5 is no, and the broadcast data 11 is transmitted to the processing address V indicated by the filtering configuration information V.

[0377] If the result of the determination in B1 is no, B2 determines whether the time interval is less than the interval threshold.

[0378] The time interval is the time interval between the current time and the first time #8 at which other broadcast data belonging to broadcast cycle 1 is received from external device 1.

[0379] If the judgment result of B2 is yes, execute B6.

[0380] B6, save the current time. That is, save the current time as the first time #9.

[0381] B7, ignore. That is, ignore broadcast data 11.

[0382] If the judgment result of B2 is no, execute B3.

[0383] B3, save the current time. That is, save the current time as the first time #9, which is used to execute B2 for other broadcast data received in broadcast cycle 1.

[0384] B4, determine whether it is service data.

[0385] If the judgment result of B4 is negative, B5 is executed.

[0386] B5: Determine whether to skip reporting. For details, please refer to the description of B5 above.

[0387] The following combination Figure 6Introduce the Bluetooth scanning method 300-7 provided in the embodiment of the present application. The Bluetooth scanning method 300-7 corresponds to case 6, and gives a further example for the case where the broadcast data is ManufacturerData. The Bluetooth scanning method 300-7 does not involve Figure 6 The matching module, throttle valve module and operating system module.

[0388] Execute A1 to A3. For details, please refer to the relevant descriptions of A1 to A3 in the Bluetooth scanning method 300-1. The difference is that the broadcast data 3 and the hash value 3 in the Bluetooth scanning method 300-1 are replaced by the broadcast data 12 and the hash value 12 respectively.

[0389] A4: Determine whether the known broadcast mapping set is matched.

[0390] It is known that the broadcast mapping set (as another possible example of the second indication information) is used to store the mapping relationship 2 between the hash value and the filtering configuration information. Directly reporting the filtering parameters in the filtering configuration information corresponding to the mapping set does not indicate enabling the Windows Bluetooth device cache.

[0391] For example, a known broadcast mapping set is stored in a trust ring service.

[0392] Case 6 includes: a known broadcast mapping set matches the broadcast data. For example, the known broadcast mapping set includes mapping relationship R1 between hash value 13 and filtering configuration information R. Hash value 13 is obtained by performing a sum hash algorithm on broadcast data 13. Hash value 13 is the same as hash value 12, indicating that broadcast data 12 matches mapping relationship R1.

[0393] If the judgment result of A4 is no, the broadcast data 12 is input into the deduplication module 2 .

[0394] For details of the subsequent steps, please refer to the description of D1 and D5 to D9 in the above sub-case D-1, which will not be repeated here.

[0395] Figure 7 This is a hardware structure diagram of an electronic device 1000 provided in an embodiment of the present application. Figure 7The electronic device 1000 may include a processor 1010, an external memory interface 1020, an internal memory 1021, a universal serial bus (USB) interface 1030, a charging management module 1040, a power management module 1041, a battery 1042, an antenna 1, an antenna 2, a mobile communication module 1050, a wireless communication module 1060, an audio module 1070, a speaker 1070A, a receiver 1070B, a microphone 1070C, an earphone interface 1070D, a sensor module 1080, a button 1090, a motor 1091, an indicator 1092, a camera 1093, a display screen 1094, and a subscriber identification module (SIM) card interface 1095, etc. The sensor module 1080 may include a pressure sensor 1080A, a gyroscope sensor 1080B, an air pressure sensor 1080C, a magnetic sensor 1080D, an acceleration sensor 1080E, a distance sensor 1080F, a proximity light sensor 1080G, a fingerprint sensor 1080H, a temperature sensor 1080J, a touch sensor 1080K, an ambient light sensor 1080L, a bone conduction sensor 1080M, etc.

[0396] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 1000. In other embodiments of the present application, the electronic device 1000 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0397] The processor 1010 may include one or more processing units, for example: the processor 1010 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc.

[0398] The controller may be the nerve center and command center of the electronic device 1000. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0399] Processor 1010 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 1010 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 1010. If processor 1010 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 1010 latency, and thus improves system efficiency.

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

[0401] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 1000. In other embodiments of the present application, the electronic device 1000 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0402] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 1000 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0403] The wireless communication module 1060 can provide wireless communication solutions for the electronic device 1000, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. The wireless communication module 1060 can be one or more devices that integrate at least one communication processing module.

[0404] Figure 8 A software system diagram of an electronic device 1000 provided in an embodiment of the present application.

[0405] like Figure 8 As shown, a software system using a layered architecture is divided into several layers, each with clear roles and divisions of labor. Layers communicate with each other via software interfaces. In some embodiments, the software system can be divided into four layers: application layer, application framework layer, system layer, and hardware layer, from top to bottom.

[0406] The application layer can include multiple applications. Figure 8 As shown, the application layer may include trust ring applications and other applications. For example, trust ring applications include Super Workstation, PC Manager, and YOYO. For example, other applications include machine cloning, calendar, etc. ( Figure 8 not shown).

[0407] The trust ring service involved in the embodiments of the present application can provide relevant data for the trust ring application.

[0408] The application framework layer includes trust ring services. These services include modules such as data transmission, access networking, connection, device discovery, and Bluetooth scanning. Bluetooth scanning includes the scanning API, scanning engine, and scanner management. Scanner management includes modules such as hard filter scanning, hard filter framework, Microsoft scanning, and other scanning modules.

[0409] The embodiments of the present application mainly relate to connection, device discovery and Bluetooth scanning modules.

[0410] An intermediate layer may be included between the application framework layer and the system layer. The intermediate layer may include a user mode driver (UMD) and a basic library.

[0411] User-mode drivers (UMDs) are device drivers that run in user space. Compared to traditional kernel-mode drivers, UMDs offer greater stability and security because they run in user space and can crash without impacting the operating system. UMDs are often used to improve system reliability, particularly in embedded systems, where user-mode drivers can help isolate faults and prevent driver errors from causing system crashes.

[0412] Among them, UMD can include hard-filtered Bluetooth drivers and other drivers.

[0413] Among them, the basic library may include system encapsulation (system API) and other libraries.

[0414] The system layer is described using the Windows operating system as an example. The Windows operating system consists of a kernel layer, a driver layer, a hardware abstraction layer, and some components.

[0415] The kernel layer includes the Windows driver framework (WDF), the Bluetooth protocol stack, and other kernel modules.

[0416] Among them, the driver layer includes Bluetooth driver and other driver modules.

[0417] The Windows operating system also includes the user mode driver framework (UMDF), the 32-bit Windows system (win32) API, WRT, and other components.

[0418] The embodiments of the present application relate to UDMF, win32 API, WRT, WDF, Bluetooth protocol stack and Bluetooth driver.

[0419] The hardware layer includes Bluetooth modules and other hardware.

[0420] A Bluetooth module is a modular device that integrates a Bluetooth chip and related circuitry. It contains the hardware and software required for Bluetooth communication and enables wireless communication with other devices. The Bluetooth chip is the core component that enables Bluetooth communication and is typically composed of a radio frequency transceiver, a baseband processor, and other supporting circuitry.

[0421] For example, the hard filter scanning method in the embodiment of this application mainly involves the hard filter scanning and hard filter framework, UDM, basic library and hardware layer in Bluetooth scanning. The Microsoft scanning method in the embodiment of this application involves Microsoft scanning, basic library and Windows operating system in Bluetooth scanning.

[0422] The following combination Figure 9 An exemplary interaction diagram of the Bluetooth scanning method 400 provided in this application is introduced based on a software system.

[0423] S401, the scanning engine obtains a scanner.

[0424] S402: Scanner management queries the system package for filtering support.

[0425] The scanner manager queries the system package to see if the Bluetooth chip supports hard filtering. If supported, the next steps are executed.

[0426] S403, the system package returns the scanner to the scanning engine.

[0427] S404: The scanning engine instructs the hard filter scanning setting to start scanning.

[0428] S405 , the hard filter scan instructs the system to package and set up a start scan.

[0429] S406 , the system package instructs the hard filtering framework to set up a start scan.

[0430] S407: The hard filtering framework instructs the hard filtering Bluetooth driver to start scanning.

[0431] S408: The hard filtering Bluetooth driver instructs the Bluetooth chip to start scanning.

[0432] S409: The Bluetooth chip reports the broadcast to the hard filtering Bluetooth driver through the chip hard filtering channel.

[0433] S410: The hard filtering Bluetooth driver reports a broadcast to the hard filtering framework.

[0434] S411, the hard filtering framework reports the broadcast to the system package.

[0435] S412: The system encapsulates and reports the broadcast to the hard filter scan.

[0436] The hard filtering scan performs deduplication processing on the broadcast. If the broadcast is not a repeated broadcast, S413 is executed.

[0437] Optionally, in S413, the hard filtering scan directly reports the broadcast to the scanning engine.

[0438] If the filtering configuration information matched by the broadcast indicates that the Windows Bluetooth device cache is enabled, S414 is executed.

[0439] Optionally, S414, the hard filter scan instructs the system package to start Microsoft scanning.

[0440] S415 , the system package instructs Microsoft Scan to start Microsoft Scan.

[0441] S416, the Microsoft Scan instructs the Bluetooth protocol stack to start the Microsoft Scan.

[0442] S417, the Bluetooth protocol stack instructs the Bluetooth chip to set up and start scanning.

[0443] S418: The Bluetooth chip reports the broadcast to the Bluetooth protocol stack through the Microsoft scan channel.

[0444] S419: The Bluetooth protocol stack reports the broadcast to Microsoft Scan through the Microsoft Scan channel.

[0445] S420, Microsoft scans and reports the broadcast to the system package.

[0446] S421, the system encapsulates and reports the broadcast to the hard filter scan.

[0447] S422: Hard filtering scan reports the broadcast to the scanning engine.

[0448] S423, the hard filter scan instructs the system package to stop Microsoft scanning.

[0449] S424, the system package instructs Microsoft Scan to stop Microsoft Scan.

[0450] S425, the Microsoft Scan instructs the Bluetooth protocol stack to stop the Microsoft Scan.

[0451] S426: The Bluetooth protocol stack instructs the Bluetooth chip to stop Microsoft scanning.

[0452] The present invention provides a chip system comprising one or more processors configured to retrieve and execute instructions stored in a memory, thereby executing the method of the present invention. The chip system may be composed of a chip or may include a chip and other discrete devices.

[0453] The chip system may include an input circuit or interface for sending information or data, and an output circuit or interface for receiving information or data.

[0454] The present application also provides a computer program product, which, when executed by a processor, implements the method described in any method embodiment of the present application.

[0455] The computer program product can be stored in a memory and finally converted into an executable target file that can be executed by a processor through preprocessing, compilation, assembly and linking.

[0456] The present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, implements the method described in any method embodiment of the present application. The computer program can be a high-level language program or an executable target program.

[0457] The computer-readable storage medium may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0458] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and equipment and the technical effects produced can refer to the corresponding processes and technical effects in the aforementioned method embodiments, and will not be repeated here.

[0459] In the several embodiments provided in this application, the disclosed systems, devices and methods can be implemented in other ways. For example, some features of the method embodiments described above can be ignored or not executed. The device embodiments described above are merely schematic, and the division of units is only a logical function division. There may be other division methods in actual implementation, and multiple units or components may be combined or integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the above coupling includes electrical, mechanical or other forms of connection.

[0460] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0461] It should be understood that the term "plurality" used herein refers to two or more. The term "and / or" in this document simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the related objects are in an "or" relationship.

[0462] The terms (or numbers) "first", "second", ... etc. that appear in the embodiments of the present application are only used for descriptive purposes, that is, they are only used to distinguish different objects, such as different "coordinates", etc., and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first", "second", ... etc. may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, "at least one (item)" refers to one or more. "Multiple" means two or more. "At least one of the following (item)" or similar expressions refers to any combination of these items, including any combination of a single (item) or plural (items).

[0463] In short, the above description is only a preferred embodiment of the technical solution of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application shall be included in the scope of protection of this application.

Claims

1. A Bluetooth scanning method, applied to a first device, wherein the first device has a Bluetooth chip, characterized in that: The method comprises: configuring a plurality of first filters in the Bluetooth chip according to the plurality of first filtering configuration information, the plurality of first filters being used to filter broadcast data received by the Bluetooth chip to obtain first broadcast data related to a current service, the plurality of first filtering configuration information corresponding one-to-one to the plurality of first filters; acquiring, through the plurality of first filters, second broadcast data from a second device; Determining, from the plurality of first filtering configuration information, second filtering configuration information matching the second broadcast data, the second filtering configuration information including first address information indicating an address of a first callback function for parsing the second broadcast data; The second broadcast data is transmitted to the first callback function according to the first address information.

2. The method according to claim 1, wherein The first device stores a first time, the first time being the time for transmitting third broadcast data to the first callback function, the third broadcast data coming from the second device, the third broadcast data and the second broadcast data belonging to the same broadcast period, and the second filtering configuration information further including an interval threshold; The transmitting the second broadcast data to the first callback function according to the first address information includes: When the interval between the current time and the first time is greater than or equal to the interval threshold, the second broadcast data is transmitted to the first callback function according to the first address information.

3. The method according to claim 2, wherein The method further comprises: When the interval between the current time and the first time is smaller than the interval threshold, the second broadcast data is ignored.

4. The method according to claim 1, wherein The transmitting the second broadcast data to the first callback function according to the first address information includes: In a case where the second filtering configuration information does not include the first indication information, transmitting the second broadcast data to the first callback function according to the first address information; The first device is installed with an operating system, and the method further includes: In a case where the second filtering configuration information includes the first indication information, starting the operating system to perform Bluetooth scanning; The first indication information indicates enabling the operating system to cache information of the scanned device.

5. The method according to claim 4, wherein The first device stores second indication information for indicating that the second broadcast data matches the second filtering configuration information. After starting the operating system to perform Bluetooth scanning, the method further includes: acquiring, through the operating system performing Bluetooth scanning, fourth broadcast data from the second device, where the fourth broadcast data and the second broadcast data belong to the same broadcast period; Determining whether the fourth broadcast data matches the second indication information; In a case where the fourth broadcast data matches the second indication information, the fourth broadcast data is transmitted to the first callback function according to the first address information.

6. The method according to claim 5, wherein The first device stores a second time, the second time being the time for transmitting fifth broadcast data to the first callback function, the fifth broadcast data being a broadcast from the second device obtained using the operating system, the fifth broadcast data and the fourth broadcast data belonging to the same broadcast period, and the second filtering configuration information further including an interval threshold; The transmitting the fourth broadcast data to the first callback function according to the first address information includes: When the interval between the current time and the second time is greater than or equal to the interval threshold, the fourth broadcast data is transmitted to the first callback function according to the first address information.

7. The method according to claim 6, wherein The method further comprises: When the interval between the current time and the second time is smaller than the interval threshold, the fourth broadcast data is ignored.

8. The method according to claim 5, wherein The first device stores third indication information, the third indication information including the second indication information and fourth indication information, the fourth indication information being used to indicate that sixth broadcast data from the third device matches third filtering configuration information, the third filtering configuration information including the first indication information and second address information, the second address information indicating an address of a second callback function for parsing the sixth broadcast data; and the method further comprising: After transmitting the seventh broadcast data matching the third indication information to the corresponding third callback function, stopping the operating system scanning; Among them, the seventh broadcast data includes the fourth broadcast data and the eighth broadcast data, the eighth broadcast data is obtained from the third device through Bluetooth scanning performed by the operating system, the eighth broadcast data and the sixth broadcast data belong to the same broadcast cycle, the eighth broadcast data matches the fourth indication information, and the third callback function includes the first callback function and the second callback function.

9. The method according to claim 1, wherein The determining the second filtering configuration information matching the second broadcast data includes: In a case where the first device stores second indication information, determining second filtering configuration information matching the second broadcast data according to the second indication information, where the second indication information indicates that the second broadcast data matches the second filtering configuration information; Alternatively, when the first device does not store indication information for indicating filtering configuration information that matches the second broadcast data, when the second broadcast data matches a second filter among the multiple first filters, it is determined that the second broadcast data matches the second filtering configuration information of the second filter, and the second indication information for indicating that the second broadcast data matches the second filtering configuration information is saved.

10. The method according to claim 9, wherein In a case where the first device does not store indication information for indicating filtering configuration information matching the second broadcast data, the second filtering configuration information includes an offset, characteristic data of service data, and a mask of the service data, wherein the characteristic data corresponds to bits of the mask in a one-to-one manner, the offset is L, and L is a positive integer. The method further includes: The bit in the feature data corresponding to the first bit whose value in the mask is not 0 is used as the second bit, where the number of the second bits is N, where N is a positive integer; Using N bits starting from the Lth bit in the second broadcast data as the third bit; Determining whether the value of the second bit is the same as the value of the third bit; When the value of the second bit is the same as the value of the third bit, determining that the second broadcast data matches the second filter; Alternatively, when the value of the second bit is different from the value of the third bit, it is determined that the second broadcast data does not match the second filter.

11. The method according to claim 5, wherein The second indication information includes a mapping relationship between a first hash value and the second filtering configuration information, where the first hash value is calculated based on a sum hash algorithm for the second broadcast data. The determining whether the fourth broadcast data matches the second indication information includes: Calculate the second hash value for the fourth broadcast data according to the sum hash algorithm; When the first hash value is the same as the second hash value, determining that the fourth broadcast data matches the second indication information; Alternatively, when the first hash value is different from the second hash value, it is determined that the fourth broadcast data does not match the second indication information.

12. An electronic device, characterized in that: The electronic device includes: one or more processors, and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program code, where the computer program code includes computer instructions. The one or more processors call the computer instructions to enable the electronic device to execute the method according to any one of claims 1 to 11.

13. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 11.

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

Citation Information

Patent Citations

  • Service equipment discovery method based on Bluetooth GAP layer

    CN108769967A

  • Method for filtering Bluetooth broadcast packet in ESL and related device

    CN110191447A

  • Data processing method, Bluetooth module, electronic equipment and readable storage medium

    CN110784830A

  • Multi-Bluetooth equipment management and non-inductive data acquisition algorithm

    CN111711997A

  • Data processing method, filtering information quantity determination and configuration method, equipment and medium

    CN113965889A

Cited By

  • Repeated message filtering system for industrial wireless network

    CN121397539A

  • Duplicate message filtering system for industrial wireless networks

    CN121397539B