Close-range scanning method and related device
By introducing a second processor to the electronic device for message filtering, the high power consumption problem caused by the electronic device scanning a large number of irrelevant Bluetooth messages in close-range communication is solved, and more efficient service processing capabilities are achieved.
Patent Information
- Application Number
- CN202310605017.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-25
- Publication Date
- 2024-11-26
AI Technical Summary
In close-range communication, electronic devices scan a large number of unrelated Bluetooth messages, resulting in a large number of invalid wake-ups from the main processor, which increases the power consumption of the device.
By introducing a second processor into the electronic device, it is responsible for filtering scanned messages and sending only matching service messages to the main processor to avoid irrelevant devices from waking up the main processor and implementing them at the software level Message filtering supports more service processing.
It effectively reduces device power consumption, avoids the main processor of messages from irrelevant devices, and improves the service processing capabilities of electronic devices.
Smart Images

Figure CN119031456A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a close-range scanning method and related devices. Background Art
[0002] With the continuous development of short-range communication technology, short-range communication technology (such as Bluetooth) on electronic devices is increasingly widely used in users' lives. Short-range communication technology on electronic devices can be applied to various scenarios such as smart home, office, car, payment, etc., bringing convenience to users.
[0003] Taking Bluetooth as an example, a Bluetooth device can continuously broadcast Bluetooth signals to be discovered by other devices; a user's electronic device can scan Bluetooth messages sent by surrounding Bluetooth devices, and the main processor of the electronic device implements related services based on the scanned Bluetooth messages.
[0004] However, in actual applications, there may be a large number of irrelevant Bluetooth devices around the electronic device, and the electronic device will scan a large number of Bluetooth messages, which will cause a large number of invalid wake-ups of the main processor of the electronic device and high power consumption of the device. Summary of the invention
[0005] The present application provides a close-range scanning method and related devices, which can prevent the main processor from being invalidly awakened and effectively reduce the power consumption of the device.
[0006] In a first aspect, the present application provides a short-range scanning method, which is applied to a first electronic device, wherein the first electronic device includes a first short-range communication module, a main processor, and a second processor; the method includes: the main processor sends a first instruction to the second processor; the first instruction is used to instruct the second processor to filter messages based on a first filtering condition, and the first filtering condition is used to filter messages from devices of a first service, and the devices of the first service include a first device; the first short-range communication module scans a first message sent by the first device; the first short-range communication module sends the first message to the second processor; the second processor determines that the first message matches the first filtering condition in the second processor, and the second processor sends the first message to the main processor.
[0007] In the implementation of the application embodiment, the short-range communication module sends the scanned message to the low-power second processor, which filters the message of the first service and only sends the filtered message of the first service to the main processor; the message filtering implemented by the second processor does not need to wake up the main processor. In this way, it is possible to avoid the message of irrelevant equipment waking up the main processor, effectively reducing the power consumption of the device. In addition, compared to setting a filter in the short-range communication module to implement message filtering, the second processor implements message filtering at the software level, and the number of services that can be supported is much larger than that of the short-range communication module, which improves the business processing capability of the electronic device.
[0008] In one implementation, the method further includes: the first short-range communication module scans a second message sent by a second device; the first short-range communication module sends the second message to a second processor; the second processor determines that the second message does not match a first filtering condition in the second processor, and the second processor does not send the first message to the main processor. In the implementation of the application embodiment, the message determined by the second processor that does not match the filtering condition of the first service will not be sent to the main processor. In this way, messages from irrelevant devices can be prevented from waking up the main processor, effectively reducing the power consumption of the device.
[0009] In one implementation, the method further includes: based on the first instruction, the second processor sends a second instruction to the first short-range communication module, and the second instruction is used to instruct the first short-range communication module to send the scanned message to the second processor. According to the traditional implementation scheme, the short-range communication module will send the scanned message directly to the main processor; in the implementation of the application embodiment, the second processor instructs the short-range communication module to switch the callback path of the message to the second processor. In this way, the second processor can filter the message and only send the message that matches the filtering condition to the main processor, so as to avoid the message of irrelevant device waking up the main processor and effectively reduce the power consumption of the device.
[0010] In one implementation, the method further includes: based on the first instruction, the second processor sends a second instruction to the first short-distance communication module, the second instruction is used to instruct the first short-distance communication module to send the scanned message of the first type of service to the second processor; the first service belongs to the first type of service. According to the traditional implementation scheme, the short-distance communication module will directly send the scanned message of the first type of service to the main processor, the first type of service includes a variety of services, and the first electronic device only subscribes to some services (such as the first service). In the implementation of the application embodiment, the main processor sends the filtering conditions corresponding to the subscribed service to the second processor, and the second processor instructs the short-distance communication module to switch the callback path of the first type of service to the second processor. In this way, the second processor can filter the message of the first type of service, and only send the message of the device of the first service that matches the filtering condition to the main processor, so as to avoid the message of the device of the unsubscribed service in the first type of service waking up the main processor, and effectively reduce the power consumption of the device.
[0011] In one implementation, before the first short-distance communication module sends the first message to the second processor, it also includes: the main processor sends a second filtering condition to the first short-distance communication module, and the second filtering condition is used to filter messages from devices of the first type of service; the first short-distance communication module sends the first message to the second processor, including: when the first short-distance communication module determines that the first message meets the second filtering condition, the first message is sent to the second processor. In the implementation of the application embodiment, the short-distance communication module preliminarily filters out the messages of the first type of service from the scanned messages and sends them to the second processor. In this way, it is avoided to send messages of other types of services to the second processor, and the power consumption of the second processor is reduced.
[0012] In one implementation, before the second processor sends the first message to the main processor, the main processor also includes: the main processor sends a callback condition to the second processor, and the callback condition is used to instruct the second processor to send the first message to the main processor when the first message meets the callback condition. In the implementation of the application embodiment, the second processor controls the frequency of the message of the same device being called back to the main processor through the callback condition. In this way, the frequency of waking up the main processor can be reduced, and the main processor can be prevented from repeatedly processing the same message, thereby achieving the purpose of controlling power consumption.
[0013] In one implementation, the callback condition of the first message includes any one of the following: receiving the first message for the first time; not receiving the first message for the first time, and the time interval between the time of receiving the first message this time and the time of receiving the first message most recently sent to the main processor is greater than the first time threshold.
[0014] In one implementation, the first message includes a device identifier of the first device, and the method further includes: the main processor obtains a first message attachment associated with the first device from the server based on the device identifier of the first device; and the first application in the main processor executes a first preset function according to the message content in the first message attachment. The embodiment of the present application does not specifically limit the first preset function corresponding to the first service, for example, outputting push information according to the message content.
[0015] In one implementation, the first message includes a device identifier of the first device, and the method further includes: the main processor executes a second preset function based on the device identifier of the first device. The second preset function is not specifically limited in the embodiment of the present application, for example, a command is sent to the vehicle through the vehicle APP to control the vehicle to open a door.
[0016] In one implementation, after the second processor sends the first message to the main processor, the method further includes: the second processor detects that the message of the first device is not received again within a first preset time period after receiving the message of the first device, and the second processor sends a loss event of the first device to the main processor. In the implementation of the application embodiment, the loss event can be detected by the timer function of the second processor without the AP remaining active; compared with the main processor, the second processor has lower power consumption in detecting the loss event.
[0017] In one implementation, the first short-range communication module is a Bluetooth chip, the first service is a first beacon scanning service of a first application, and the first device is a registered beacon device of the first beacon scanning service. In actual applications, there may be beacon devices with unsubscribed beacon scanning services around the first electronic device, and a large number of beacon messages sent by them that are irrelevant to the device will be scanned. The second processor filters the beacon messages scanned by the Bluetooth chip, and only calls back the filtered beacon messages of the devices that have subscribed to the service to the main processor for further processing, and discards other irrelevant beacon messages. In this way, irrelevant beacon messages can be avoided from waking up the main processor, effectively reducing the power consumption of the device, and the number of beacon scanning services that can be supported is much larger than that of the Bluetooth chip, thereby improving the service processing capability of the electronic device.
[0018] In one implementation, the method also includes: the main processor sends a first request message to the server, the first request message carries beacon parameters of a first beacon scanning service, and the first request message is used to detect the legality of the beacon parameters; when the beacon parameters are legal, the main processor receives a first response message sent by the server; the first response message carries a first filtering condition.
[0019] In one implementation, the second filtering condition includes the type of beacon device carried by the message.
[0020] In one implementation, the device identification of the first device includes a first beacon ID, the cloud server stores one or more message attachments associated with the first beacon ID, and the main processor obtains the first message attachment associated with the first device from the server based on the device identification of the first device, including: the main processor sends a second request message to the server, the second request message includes the first beacon ID, and the second request message is used to query the message attachment associated with the first beacon ID; the main processor receives the first message attachment sent by the server, and the first message attachment is any one of the one or more message attachments.
[0021] In one implementation, the first filtering condition indicates the value of one or more of the following filtering fields of the first beacon scanning service: namespace, message type, beacon ID prefix and message content; the first message matches the first filtering condition, including: the first message carries the first filtering field, and the first filter field carried by the first message matches the first filter field indicated by the first filtering condition, and the first filter field is any filter field indicated by the first filtering condition.
[0022] In one implementation, the device identification of the first device includes a first beacon ID, and the first application stores a correspondence between the first beacon ID and a second preset function; the main processor executes the second preset function based on the device identification of the first device, including: the first application in the main processor executes the second preset function corresponding to the first beacon ID according to the correspondence.
[0023] In one implementation, the first filtering condition indicates a first beacon ID of the first device; and the first message matches the first filtering condition, including: the beacon ID carried by the first message is the first beacon ID.
[0024] In a second aspect, the present application provides an electronic device, comprising one or more processors and one or more memories. 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 codes, and the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the close-range scanning method in any possible implementation of any of the above aspects.
[0025] In a third aspect, an embodiment of the present application provides a computer storage medium, including computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the close-range scanning method in any possible implementation of any of the above aspects.
[0026] In a fourth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer executes the close-range scanning method in any possible implementation of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1A and Figure 1B A schematic diagram of the architecture of a communication system provided in an embodiment of the present application;
[0028] FIG. 2A to FIG. 2E A schematic diagram of a scenario provided for an embodiment of the present application;
[0029] FIG. 3A to FIG. 3E A schematic diagram of a scenario provided for an embodiment of the present application;
[0030] Figure 4A A device architecture diagram provided for an embodiment of the present application;
[0031] Figure 4B A Bluetooth protocol architecture diagram provided for an embodiment of the present application;
[0032] FIG. 4C to FIG. 4E A diagram of the device architecture provided for an embodiment of the present application;
[0033] Figure 5 A device architecture diagram provided for an embodiment of the present application;
[0034] Figure 6 A schematic diagram of a flow chart of a close-range scanning method provided in an embodiment of the present application;
[0035] Figure 7 A schematic diagram of a flow chart of a close-range scanning method provided in an embodiment of the present application;
[0036] Figure 8 A flowchart of a callback control provided in an embodiment of the present application;
[0037] Fig. 9 A schematic diagram of a device structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0039] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0040] The term "user interface (UI)" in the following embodiments of the present application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device, and finally presented as content that can be recognized by the user. The commonly used form of user interface is a graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.
[0041] The following is an introduction to the communication system 10 involved in the short-range scanning method provided in an embodiment of the present application.
[0042] Figure 1A and Figure 1B Two schematic diagrams of communication systems 10 provided in the embodiments of the present application are exemplarily shown. The structure shown in this embodiment does not constitute a specific limitation on the communication system 10. In other embodiments of the present application, the communication system 10 may include more or fewer devices than shown in the figure.
[0043] like Figure 1A As shown, the communication system 10 includes an electronic device 100, at least one beacon device 200 near the electronic device 100, and a server 300 for querying a message attachment corresponding to the beacon device 200.
[0044] The electronic device 100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device (smart bracelet), a vehicle-mounted device, a smart home device (smart TV, smart screen, large screen device, etc.) and / or a smart city device. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 100.
[0045] The beacon device 200 is a device that uses the short-range communication technology 1, and can be regarded as an external device for a specific application (such as APP1) on the electronic device 100. Its working principle includes: continuously broadcasting its own unique identity (identity, ID) (this ID can also be called a beacon ID) to the surrounding through the short-range communication technology 1, and the APP1 of the nearby electronic device 100 can scan and parse the ID of the beacon device 200, and finally implement information push or execute the preset function corresponding to the above ID based on the ID of the beacon device 200. The beacon device itself does not have the function of collecting data, does not need to be connected to any host device, and will not steal the identity information of the user of the electronic device 100. The business of scanning the beacon device involved in the embodiment of the present application can be called a beacon scanning business, and the beacon scanning business can include the cloud scanning business and the local scanning business of the beacon. The beacon scanning business will be introduced in detail in the subsequent embodiments.
[0046] In some embodiments, the beacon device 200 can be deployed at a fixed location (such as a shopping mall, a gas station, a user's home, a shared bicycle parking spot, etc.), and the electronic device 100 can scan the beacon device 200 when it is close to the fixed location. In some embodiments, the beacon device 200 can be deployed on a specific device (such as a vehicle, a router, a smart home device, etc.), and the electronic device 100 can scan the beacon device 200 when it is close to the specific device. The above-mentioned specific device can be movable or immovable. The beacon device 200 can be independently deployed or integrated with the above-mentioned specific device. The short-range communication technology 1 can be WiFi communication technology, Bluetooth communication (such as classic Bluetooth (Basic Rate / Enhanced Date Rate, BR / EDR) or Bluetooth Low Energy (Bluetooth Low Energy, BLE)) technology, Ultra Wide Band (UWB) communication technology, Near Field Communication (NFC) technology or ZigBee communication technology, etc., and the embodiments of the present application do not specifically limit this. In actual applications, the type of beacon equipment, deployment method and short-range communication technology used can be determined based on application needs and application scenarios1.
[0047] The subsequent embodiments are exemplified by taking the case where the short-range communication technology 1 is the BLE communication technology. In this example, the beacon device 200 may also be referred to as a Bluetooth beacon, which is a hardware device based on the BLE broadcast protocol and is compatible with the iBeacon protocol or the Eddystone protocol. After the user purchases the beacon device, the hardware parameters of the beacon device (such as beacon type, broadcast interval, power consumption level, etc.) can be configured through the APP1 provided by the manufacturer.
[0048] The server 300 may be a single server, or a server cluster consisting of multiple servers, or a cloud computing center. The server 300 may also be referred to as a cloud server 300. The beacon database of the server 300 is used to store message attachments corresponding to the beacon ID of each beacon device 200. In some embodiments, the electronic device 100 and the server 300 may be indirectly connected via at least one device in a communication network, wherein the communication network includes a wide area network and / or a local area network; the electronic device 100 may query the cloud server 300 for the message attachment corresponding to the beacon ID of the beacon device 200.
[0049] Figure 1A The communication system 10 shown is used to implement a cloud scanning service of a beacon. In some embodiments, the cloud scanning service of a beacon includes two phases, namely phase one and phase two.
[0050] Phase 1: Register the beacon device of the cloud scanning service and start the beacon scanning task. Specifically, the application developer of APP1 registers the beacon device 200 of the cloud scanning service 1 to the cloud server 300, configures the message attachment corresponding to the beacon ID of the beacon device 200, and the message content in the message attachment is the message published by the cloud scanning service 1; after APP1 of the electronic device 100 subscribes to the cloud scanning service 1, it starts the beacon scanning task of the cloud scanning service 1.
[0051] Phase 2: Scan and parse the beacon ID of the beacon device 200, and execute the preset function 1 according to the message attachment 1 corresponding to the beacon ID. Specifically, the beacon device 200 continuously broadcasts its unique beacon ID to the surroundings through BLE; the nearby electronic device 100 can scan and parse the above beacon ID; the electronic device 100 queries the server 300 for the message attachment 1 corresponding to the above beacon ID; APP1 can execute the preset function 1 according to the message content of the message attachment 1. Executing the preset function 1 may include one or more of the following: controlling other devices to execute preset operations; outputting push information 1; calling other APPs to execute preset operations, etc.
[0052] The following is an exemplary description of the application scenario of the beacon cloud scanning service.
[0053] Scenario 1: Information push scenario, APP1 can output push information 1 according to the message content of the message attachment 1. After the introduction of Bluetooth beacons (such as beacon devices 200) in places such as shopping malls, gas stations, and museums, they can be deployed in various product areas / exhibit areas. When a user carries an electronic device 100 (such as a mobile phone 100) and approaches the beacon device 200 of a shopping mall or gas station, the mobile phone 100 will receive and display product discount information of nearby products. When a user carries a mobile phone 100 and approaches the beacon device 200 of a museum, the mobile phone 100 will receive and output a detailed introduction to nearby exhibits (such as voice explanation).
[0054] In an embodiment of the present application, the push information 1 (such as the above-mentioned preferential information and detailed introduction) can be presented in one or more information types such as cards, text, pictures, videos, animations, etc. In one implementation, the push information 1 is presented in the form of rich media content. The push information 1 can be displayed in one or more display areas of the current display interface of the mobile phone 100, the negative first screen, the notification bar, the status bar, and the user interface of APP1. The embodiment of the present application does not specifically limit the display area and presentation form of the push information 1.
[0055] For example, FIG. 2A to FIG. 2E A schematic diagram showing a relevant information push scenario at a gas station.
[0056] like Figure 2A As shown, the gas station is deployed with a beacon device 200, and the beacon ID of the beacon device 200 corresponds to message attachment 1. The message content of message attachment 1 indicates the preferential information of the application payment of the wallet APP (i.e., Huawei Pay) for refueling at the gas station; after the user drives close to the gas station, the user's mobile phone 100 can scan the beacon ID broadcast by the beacon device 200; after the mobile phone 100 obtains the corresponding message attachment 1 from the server 300 according to the beacon ID, the preferential information of the application payment of the wallet APP for refueling at the gas station is displayed according to the message content of message attachment 1.
[0057] For example, Figure 2BAs shown, the mobile phone 100 can display the above-mentioned preferential information on the current display interface of the mobile phone 100. For example, the current display interface of the mobile phone 100 is a main interface 11 for displaying installed applications (applications, APPs); the mobile phone 100 is installed with a wallet APP, and the main interface 11 can display the application icon 101 of the wallet APP. The mobile phone 100 displays a card 102 according to the message content of the message attachment 1, and the card 102 indicates the above-mentioned preferential information. Card 102 includes an application icon and name 102A of the wallet APP, preferential information 102B, and a preferential payment control 102C. Preferential information 102B indicates that a 10% discount can be enjoyed by using the wallet APP for Huawei payment, and the preferential payment control 102C is used to jump to the wallet APP's code scanning interface, QR code interface, home page, or payment interface for gas stations. The interface of the wallet APP after the jump is used to implement Huawei payment for refueling at the gas station. The embodiment of the present application does not specifically limit the interface after the jump. The code scanning interface is an interface for making payments by scanning the payment QR code of the gas station; the QR code interface is an interface for displaying the payment QR code of the wallet APP; the homepage is used to display various function controls of the wallet APP, such as controls for calling up the code scanning interface or the QR code interface; the above-mentioned payment interface is the interface displayed after the mobile phone 100 scans the payment QR code of the gas station through the code scanning interface, or the interface displayed on the mobile phone 100 after the gas station scanning device scans the payment QR code of the wallet APP.
[0058] In one implementation, Figure 2B and Figure 2C As shown, it is detected that the user clicks on the preferential payment control 102C, and the mobile phone 100 displays the QR code interface 12, which includes the payment QR code 103. Figure 2C and Figure 2D As shown, after detecting that the gas station's barcode scanning device has scanned the payment QR code 103, the payment interface 13 is displayed according to the payment amount sent by the barcode scanning device; the payment interface 13 may include: product name (i.e., the model of the vehicle's oil) 201, the product amount before the discount 202, the discount information 203, the actual payment amount after the discount 204, and may also display various payment method selection controls, such as Huawei payment selection controls 205; the selection control has two states: selected and unselected, and the user can switch the state of the selection control. Figure 2D As shown, the current Huawei payment selection control 205 is in a selected state, and the preferential information 203 displays the preferential information of Huawei payment indicated in the message attachment 1, that is, 10% off. The payment interface 13 includes a payment confirmation control 206. After detecting that the user clicks the payment confirmation control 206, the mobile phone 100 can display a payment completion interface after password-free payment, or a password input interface; the password input interface is used to enter the payment password. After detecting that the password entered by the user in the password input interface is correct, the payment completion interface can be displayed. FIG. 2B to FIG. 2D This is an implementation method of the user interface for implementing preferential payment provided by this application. The embodiment of this application can also implement preferential payment of Huawei Pay through other methods, which are not specifically limited here.
[0059] In some embodiments, Figure 2E As shown, the application setting interface 14 of the wallet APP of the mobile phone 100 includes a switch control 207 for beacon push messages, and the switch control 207 includes two states: on and off. Based on the user's input operation (such as a click operation), the mobile phone 100 can switch the state of the switch control 207. When the switch control 207 is in the on state, the wallet APP scans nearby beacon devices and pushes preferential information according to the beacon ID of the beacon device. The embodiment of the present application can also enable the beacon push message of the cloud scanning service in other ways, which is not specifically limited here.
[0060] Scenario 2: Positioning service scenario. Positioning services can be applied to indoor positioning in scenarios such as exhibitions, libraries, museums, hotels, airports, campuses, hospitals, etc., to facilitate the management of people or objects. For example, beacon devices (such as beacon device 200) are deployed in various exhibition areas of the museum, and the mobile phone 100 is installed with a museum APP; when a visitor carries the mobile phone 100 past the beacon device 200, the mobile phone 100 scans and parses the beacon ID of the beacon device 200; the message attachment corresponding to the beacon ID queried by the mobile phone 100 to the cloud indicates the deployment location of the beacon device 200; the museum APP can determine the user's location in the museum based on the deployment location of the beacon device 200, and then indicate the user's location in the map provided by the museum APP.
[0061] Not limited to the above-mentioned scenarios 1 and 2, the cloud scanning service implemented by the short-range scanning method provided in the embodiment of the present application can also be applied to many other scenarios, which are not specifically limited here.
[0062] Figure 1B The communication system 10 shown is used to implement a local scanning service for beacons. Figure 1B As shown, the communication system 10 includes an electronic device 100 and at least one beacon device 400 near the electronic device 100. The local scanning service of the beacon does not need to rely on the cloud service of the beacon, that is, there is no need to configure the message attachment corresponding to the beacon ID, and query the message attachment in the cloud, which provides developers with very high flexibility. The beacon device 400 can refer to the relevant description of the beacon device 200.
[0063] In some embodiments, the local scanning service of the beacon includes two phases, namely phase three and phase four.
[0064] Phase 3: Registering a beacon device for a local scanning service and starting a beacon scanning task. Specifically, APP1 of the electronic device 100 subscribes to a local scanning service 1, APP1 registers a beacon device 400 for the local scanning service 1, and stores a correspondence 1 between the beacon ID of the registered beacon device 400 and the preset function 2.
[0065] Stage four: Scan and parse the beacon ID of the beacon device 400, and execute the preset function 2 corresponding to the beacon ID. Specifically, the beacon device 400 broadcasts its own unique beacon ID to the surroundings through BLE; the APP1 of the nearby electronic device 100 can scan and parse the above beacon ID; the electronic device 100 executes the preset function 2 corresponding to the beacon ID according to the above correspondence 1. Executing the preset function 2 includes one or more of the following: controlling other devices to perform preset operations; outputting push information 2; calling other APPs to perform preset operations, etc. The display area and display format of the push information 2 can refer to the relevant description of the aforementioned push information 1. The embodiment of the present application does not specifically limit the preset function 2.
[0066] The following is an exemplary description of the application scenario of the local scanning service of the beacon.
[0067] Scenario 3: Smart unlocking / door opening scenario. For intelligently controlled door locks such as home doors, car doors, and electric car locks, a beacon device 400 can be deployed in or near the door lock device; when a user brings an electronic device 100 (such as a mobile phone 100) close to the beacon device 400, the mobile phone 100 can automatically control the door lock device to unlock.
[0068] For example, FIG. 3A to FIG. 3E A schematic diagram showing a scenario of intelligent door unlocking.
[0069] like Figure 3A As shown, a beacon device 400 is deployed on the door of the vehicle, and the user carries a mobile phone 100 close to the vehicle. Figure 3B , after the mobile phone 100 scans the beacon message broadcast by the beacon device 400 and obtains the beacon ID, the vehicle APP displays a prompt box 301 according to the above beacon ID. The prompt box 301 includes a prompt message 301A, a confirmation control 301B, and a cancel control 301C. The prompt message 301A is used to prompt the user whether to unlock the door, the confirmation control 301B is used to confirm the unlocking of the door, and the cancel control 301C is used to cancel the unlocking of the door. Upon detecting the user's input operation (such as a click operation) on the confirmation control 301B, the mobile phone 100 sends an instruction 1 to the on-board device of the vehicle 1; based on the instruction 1, the on-board device controls the door to unlock. In some embodiments, after the door is unlocked successfully, the on-board device sends a confirmation message to the mobile phone 100 to feedback that the door has been unlocked; such as Figure 3CAs shown, the mobile phone 100 displays a prompt message 302 based on the above confirmation information, and the prompt message 302 is used to prompt the user that the car door has been unlocked.
[0070] In some embodiments, without the user confirming whether to unlock, based on the beacon ID, the mobile phone 100 can directly send a command 1 to the vehicle-mounted device of the vehicle 1 to control the door unlocking and display the prompt message 302 after the door is unlocked. The display area and display form of the prompt box 301 and the prompt message 302 can refer to the relevant description of the push message 1 above, which will not be repeated here.
[0071] In some embodiments, when a user input operation (eg, click) is detected on the prompt information 302, the mobile phone 100 may display Figure 3D The user interface 15 of the vehicle APP shown in the figure includes a control 303 for controlling the door unlocking; after the door is unlocked, the display content on the control 303 can indicate that the door is unlocked. It can be understood that according to the traditional method, if the user wants to control the door unlocking through the mobile phone, he needs to start the vehicle APP first, find the control 303 in the vehicle APP, and then control the door unlocking through the control 303. However, the close-range scanning method provided in the embodiment of the present application can automatically trigger the door unlocking according to the scanned beacon ID when approaching the vehicle, which is convenient for the user to operate.
[0072] In some embodiments, Figure 3E As shown, the application setting interface 16 of the vehicle APP of the mobile phone 100 includes a switch control 304 for smart unlocking, and the switch control 304 includes two states: on and off. Based on the user's input operation (such as a click operation), the mobile phone 100 can switch the state of the switch control 304. When the switch control 304 is in the on state, the vehicle APP provides the function of realizing smart unlocking through beacon scanning. The embodiment of the present application can also enable this function in other ways, which is not specifically limited here.
[0073] Scenario 4: Attendance punching scenario. A beacon device 400 is deployed in the punching device; when an employee passes by the beacon device 400 with a mobile phone 100, the punching application of the mobile phone 100 can automatically punch in according to the beacon ID of the scanned beacon device 400.
[0074] Not limited to the above-mentioned scenarios 3 and 4, the local scanning service implemented by the short-range scanning method provided in the embodiment of the present application can also be applied to many other scenarios, which are not specifically limited here.
[0075] In some embodiments, Figure 4AIn the device architecture shown, the software system of the electronic device 100 includes APP1 and a near-field communication service (Nearby), the protocol stack includes a Bluetooth protocol stack, and the hardware includes a near-field communication module (such as a Bluetooth chip) using near-field communication technology 1. The server 300 can be a cloud server of the Nearby service. For example, Figure 1A and Figure 1B In the communication system shown, the short-range communication technology 1 is a low-power Bluetooth communication technology. For a beacon scanning service, APP1 of the electronic device 100 can register the beacon scanning task corresponding to the service with Nearby; Nearby can send the beacon scanning task to the Bluetooth chip through the Bluetooth protocol stack to drive the Bluetooth chip to scan the surrounding beacon devices. After the Bluetooth chip scans the beacon message broadcast by the beacon device, it calls back the relevant data of the beacon message to the Bluetooth protocol stack, and the Bluetooth protocol stack reports it to APP1 through Nearby.
[0076] like Figure 4B As shown, the protocol framework of the Bluetooth protocol may include but is not limited to a Bluetooth service (BT service), a Host protocol stack, a Host Controller Interface (HCI), and a controller.
[0077] Among them, the Bluetooth service Service defines the message format and application rules of each application. In order to achieve interoperability between different devices on different platforms, the Bluetooth protocol has formulated specifications for various possible and generally meaningful application scenarios. The Host protocol stack defines core protocols, including but not limited to Bluetooth basic service protocols, logical link control and adaptation protocols, etc. HCI provides a standardized interface for communication between the host protocol stack and the controller. The hardware corresponding to HCI is a physical bus for connecting the main processor and the Bluetooth chip. In other examples, HCI may not be included. The controller defines the underlying hardware part, including wireless radio frequency (RF), baseband (BB) and link management (LM), which can realize the filtering and transmission of data bit streams, and mainly defines the conditions that the Bluetooth transceiver needs to meet for normal operation in this frequency band. Optionally, the host protocol stack Host includes Bluetooth services.
[0078] In some embodiments, Figure 4CAs shown, some or all modules (such as APP1, Nearby) of the software system of the electronic device 100, as well as the host protocol stack Host and Bluetooth service in the Bluetooth protocol framework run on the main processor; the controller runs in the Bluetooth chip. Therefore, after the Bluetooth chip scans the beacon message, when the controller reports the beacon message to the host protocol stack in the main processor, if the main processor is in a dormant state, it is necessary to wake up the main processor. The main processor is an application processor (AP) or a central processing unit (CPU). The subsequent embodiments take AP as an example for exemplary description.
[0079] Figure 4C The device architecture of the electronic device 100 shown has the following problems: 1. In actual applications, there may be a large number of Bluetooth devices around the electronic device 100; the electronic device 100 scans a large number of beacon messages broadcast by irrelevant Bluetooth beacons, resulting in a large number of invalid wake-ups of the main processor and high device power consumption. In addition, in the cloud scanning service of the beacon, after scanning the beacon ID of the beacon device, Nearby needs to query the message attachments in the cloud, resulting in a large number of Nearby cloud interface requests. 2. The same beacon device will broadcast continuously. Since the beacon broadcast interval (for example, two hundred milliseconds) is usually short, if the electronic device 100 is near a beacon device for a long time, the Bluetooth chip will frequently call back the same beacon message to the main processor, causing the main processor to continue to be awakened by the beacon message after processing the beacon message.
[0080] In some embodiments, for the beacon scanning service, when APP1 registers a beacon scanning task with Nearby, it also indicates the filtering conditions of the beacon device corresponding to the task; when Nearby sends the beacon scanning task to the Bluetooth chip, it also sends the corresponding filtering conditions; refer to Figure 4D , the Bluetooth chip sets a filter corresponding to the task based on the filtering condition corresponding to the beacon scanning task issued by Nearby, and the filter is used to filter out the messages that meet the filtering condition in the scanned Bluetooth messages. Usually, one Bluetooth scanning task (such as a beacon scanning task) corresponds to one filter. In this embodiment, Figure 4D The device architecture of the electronic device 100 shown still has the following problem: due to the hardware limitation of the Bluetooth chip, the number of filters that can be set in the Bluetooth chip is limited (for example, 32), and it is unable to support a large number of beacon scanning services of various applications.
[0081] The present application also provides an electronic device 100, see Figure 4E, the electronic device 100 also includes a microprocessor, which is a processor with lower power consumption than the main processor, and the microprocessor can integrate some functions of the main processor. The microprocessor can be a processor such as a micro control unit (Micro Control Unit, MCU), an intelligent sensor hub Sensorhub, etc. The subsequent embodiments are illustrative using Sensorhub as an example. The embodiments of the present application do not specifically limit the physical bus connecting the main processor and the microprocessor, and the physical bus connecting the microprocessor and the Bluetooth chip, such as a bus used to implement I2C (Inter-Integrated Circuit) or a serial peripheral interface (Serial Peripheral Interface, SPI).
[0082] Sensorhub is a hardware and software solution based on a low-power MCU and a lightweight real-time operating system (RTOS). Its main function is to connect and process data from various sensor devices. Sensorhub has low power consumption and can be in operation for a long time.
[0083] like Figure 4E As shown, in an embodiment of the present application, the Sensorhub is also used to connect and process data from the Bluetooth chip. The Sensorhub includes a filtering module and / or a callback module. The AP is also used to send filtering conditions corresponding to the beacon scanning task to the Sensorhub, and the filtering conditions can be used to filter out messages sent by beacon devices that have registered for the beacon scanning service; the filtering module of the Sensorhub is used to set a beacon filter based on the above filtering conditions to filter the messages scanned by the Bluetooth chip; the Sensorhub calls back the filtered beacon message to the main processor for further processing, and discards the beacon messages of other irrelevant beacon devices. The Sensorhub implements message filtering at the software level, and the number of filters / services that can be supported is much larger than that of the Bluetooth chip. In addition, the callback module can control the callback frequency of the beacon message of the same beacon device to the AP based on the callback conditions issued by APP1. In this way, the consumption of filter resources on the hardware can be saved, the processing capability of the electronic device 100 for the beacon scanning service can be improved, the number of wake-up times of the main processor can be reduced, the power consumption of the electronic device 100 can be reduced, low-power and high-efficiency beacon management can be achieved, and the problem of ... Figure 4C and Figure 4D Describe the problem.
[0084] Not limited to beacon scanning services (i.e. not limited to scanning beacon devices), Figure 4EThe device architecture shown is also applicable to other Bluetooth scanning services that need to scan target Bluetooth devices; by setting the corresponding filtering conditions of the above target Bluetooth devices in Sensorhub, the messages of the above target Bluetooth devices can be filtered out from the Bluetooth messages of the scanned surrounding Bluetooth devices. In practical applications, corresponding filtering conditions can be set according to business requirements and the characteristics of the above target Bluetooth devices. The embodiments of the present application do not specifically limit the above Bluetooth scanning services and corresponding filtering conditions.
[0085] It should be noted that when the aforementioned short-distance communication technology 1 is other short-distance communication technologies such as WiFi, NFC, UWB, ZigBee, and the aforementioned short-distance communication module is a communication module (such as a WiFi chip, a UWB chip) using the above other short-distance communication technologies, there is also Figure 4C and Figure 4D Similarly, the short-range scanning method provided in the embodiment of the present application can also be adaptively applied to electronic devices 100 that adopt other short-range communication technologies. For example, taking WiFi as an example, the Sensorhub can filter the messages reported by the WiFi chip according to the filtering conditions of the WiFi scanning task sent by the AP, filter out the messages sent by the target WIFi device, and send them to the AP for further processing; the Sensorhub can control the callback frequency of the beacon message of the same WiFi device to the AP based on the callback conditions sent by APP1.
[0086] The device architecture of the electronic device 100 involved in the embodiment of the present application is introduced in detail below.
[0087] like Figure 5 As shown, the device architecture of the electronic device 100 may include the software system and hardware of the electronic device, and the hardware includes a Bluetooth chip and a microprocessor (eg, MCU, Sensorhub). Some or all modules in the software system of the electronic device run on the main processor.
[0088] The electronic device 100 may be equipped with iOS, Android, Microsoft or other software systems, and the software system is not specifically limited here. The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The following takes the Android system of the layered architecture as an example to illustrate the software structure of the electronic device.
[0089] Figure 5 A software structure block diagram of the software system of the electronic device 100 according to an embodiment of the present application is shown.
[0090] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer (Application), the mobile service center layer (Huawei Mobile Services core, HMS core), the application framework layer (Application Framework), the hardware abstraction layer (HAL) and the kernel layer (Kernel).
[0091] The application layer can include a series of application packages. Figure 5 As shown, the application package may include a wallet APP, a vehicle APP and a museum APP, and may also include other applications such as a camera, a gallery, a calendar, a call, a map, a navigation, a WLAN, a Bluetooth, a music, and a short message. Users can install the required applications according to actual needs, and the above application packages are not specifically limited here.
[0092] HMS core is a mobile service framework based on Huawei terminal devices and Android platform, which is open to application developers and provides various service capabilities. For example, HMS core provides terminal users with basic services such as Huawei account and payment. After logging in to Huawei account, users can access all Huawei services such as Huawei App Market, Cloud Space, Sports Health, etc.; at the same time, it provides developers' applications with message push, Huawei account quick login, in-app payment, positioning and other services, helping developers' applications to bring better user experience to Huawei terminal users.
[0093] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0094] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0095] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0096] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0097] The kernel layer is the layer between hardware and software. The kernel layer provides low-level drivers for various hardware, such as Bluetooth drivers, WiFi drivers, display drivers, audio drivers, sensor drivers (such as touch sensor drivers), etc. It is also responsible for file management, process management, network protocol stack, system security, and memory management.
[0098] The HAL layer is the interface layer between the kernel and the hardware circuit. Its purpose is to abstract the hardware and provide a virtual hardware platform and services for the operating system; it converts upper-layer calls into direct access and control of the hardware. The specific activity is to establish hardware-related drivers.
[0099] In the embodiment of the present application, HMS core includes Nearby, which provides the implementation of core business logic such as subscription to beacon scanning services, registration of beacon scanning tasks, Bluetooth scanning task management, and message management, and provides an interface for APP access at the application layer. The Nearby cloud service provides the ability to manage beacon parameters and message content; developers can configure and publish messages through the Nearby cloud service, and use the Nearby MessageAPI interface on the terminal device (such as electronic device 100) to scan beacon devices and obtain published messages. After the developer application (such as APP1) calls the above interface on the terminal device to subscribe to beacon messages, Nearby will continue to scan beacon messages in the background; when a beacon message is scanned, a callback is sent to notify the above developer application.
[0100] In some embodiments, the functional modules in HMS core can also be integrated into the application framework layer.
[0101] The application framework layer includes Bluetooth services and Multiprotocol Label Switch (MLPS), which encapsulates the interface of a microprocessor (such as an MCU or Sensorhub). MLPS is a packet forwarding technology that replaces IP forwarding with label switching; MPLS is located between the link layer and the network layer in the TCP / IP protocol stack, and is used to provide connection services to the IP layer while receiving services from the link layer.
[0102] The microprocessor encapsulates the logic of beacon message filtering, callback control, etc. in the microprocessor, which can interact with the Bluetooth chip to realize the beacon scanning management capability. The microprocessor can be a low-power processor such as MCU or Sensorhub. The microprocessor includes a filtering module and / or a callback module. For details, please refer to Figure 4E Related description.
[0103] Combine the following Figure 5The device architecture shown provides a detailed introduction to the close-range scanning method provided in the embodiments of the present application for the two aforementioned beacon scanning services.
[0104] Exemplary, for the cloud scanning service 1 of beacon, Figure 6 A schematic flow chart of a short-range scanning method is shown, and the short-range scanning method includes but is not limited to steps S401 to S417.
[0105] Phase 1: Register the beacon device for the cloud scanning service and start the beacon scanning task.
[0106] S401 . The application developer registers the beacon device 200 of the cloud scanning service 1 to the cloud server 300 of Nearby, and configures the message attachment 1 corresponding to the beacon ID of the beacon device 200 . The message content in the message attachment 1 includes the message released by the cloud scanning service 1 .
[0107] In some embodiments, the application developer needs to first register a developer account in the beacon management system (such as Huawei Developer Alliance) provided by Nearby's cloud server 300, create a project, and the system will automatically assign a namespace to each project; configure the NamespaceID and message type of the project to which the cloud scanning service 1 belongs; then, register the beacon device 200 to the project corresponding to the cloud scanning service 1 created in the cloud server 300, configure the hardware parameters of the beacon device 200; configure the message attachment 1, and associate the beacon ID of the beacon device 200 with the message attachment 1. One beacon ID can be associated with multiple message attachments.
[0108] The above message types are defined by developers according to actual business needs. For example, the message type of cloud scanning service 1 is HMS message; hardware parameters may include the beacon ID of beacon device 200, beacon device type (Beacon type), Namespace of the project to which it belongs, broadcast interval, power consumption level and reference transmission power, etc.; beacon device type may include iBeacon type and Eddystone type; message attachment 1 includes the ID of the message attachment, Namespace of the project to which it belongs, message type (Type) and the message content published by cloud scanning service 1. The registration, management and configuration of beacon device 200 can be completed in a variety of ways, such as through a web dashboard, an application installed by the electronic device 100 or a command line; the implementation of step S401 is not specifically limited in the embodiment of the present application.
[0109] In the embodiment of the present application, after the electronic device 100 installs APP1, it can automatically subscribe to the cloud scanning service 1 of APP1 and start the beacon scanning task of the cloud scanning service 1. In some embodiments, after the electronic device 100 installs APP1, in response to the user's input operation, APP1 of the electronic device 100 subscribes to all cloud scanning services of APP1. For example, APP1 is a wallet APP, and the cloud scanning service 1 is FIG. 3A to FIG. 3E Describe the gas station's preferential push service; reference Figure 3E , the above input operation can be an operation of the switch control 207 acting on the beacon message push, and the operation is used to subscribe to all beacon scanning services of APP1. In some embodiments, after the electronic device 100 installs APP1, APP1 provides a variety of cloud scanning services (such as cloud scanning service 1); in response to the user's input operation acting on cloud scanning service 1, APP1 of the electronic device 100 subscribes to cloud scanning service 1.
[0110] In the embodiment of the present application, after APP1 of the electronic device 100 is started, APP1 calls the Bluetooth chip to start the beacon scanning task 1 of the cloud scanning service 1.
[0111] S402, APP1 of electronic device 100 sends instruction 1 to Nearby, where instruction 1 is used to instruct to register beacon scanning task 1 of cloud scanning service 1, and instruction 1 includes beacon parameter 1, which includes one or more of the following data of cloud scanning service 1: Namespace, message type, beacon ID prefix.
[0112] In some embodiments, after the electronic device 100 installs APP1, APP1 pre-stores the beacon parameter 1 of the cloud scanning service 1, or APP1 can obtain the beacon parameter 1 of the cloud scanning service 1 from the cloud server 300.
[0113] In some embodiments, the beacon device continuously sends beacon broadcast messages at a set broadcast interval, and the beacon scanning task 1 is used to scan the beacon broadcast messages of the registered beacon devices of the cloud scanning service 1, and the beacon broadcast messages include the beacon ID.
[0114] The beacon ID is used to uniquely identify the beacon device; the beacon device supports two protocols, iBeacon and Eddystone, wherein the beacon ID generation rules of the beacon device are as follows: (1) The beacon ID of the iBeacon type beacon device includes a proximity universally unique identifier (Proximity UUID), a number (Major), and a label (Minor). (2) The beacon ID of the Eddystone type beacon device includes a NameSpace ID and an Instance ID. In the embodiment of the present application, the fields that make up the beacon ID in the two protocols can also be defined by the application developer or the end user. The beacon ID prefix can be used to filter registered beacon devices that belong to the same beacon scanning service. The beacon ID prefix can be obtained from the beacon ID according to a preset rule; for example, the beacon ID prefix of the iBeacon type beacon device can be the UUID in the beacon ID, and the beacon ID prefix of the Eddystone type beacon device can be the NameSpace ID in the beacon ID. The beacon ID prefix can also be defined by the application developer or the end user based on the beacon ID.
[0115] Exemplarily, the beacon ID of an iBeacon type beacon device is 14a01af0232a45189c0e899aabbccddeeff03e82711, where the UUID in the beacon ID is "14a01af0-232a-4518-9c0e-899a-abbccddeeff0", the Major value is "(short)0x3e8", the Minor value is "(short)0x2711", and the beacon ID prefix of the beacon ID is "14a01af0-232a-4518-9c0e-899a-abbccddeeff0".
[0116] For example, the beacon ID of the Eddystone type beacon device is "5dc33487f02e477d40580117c5986919", wherein the Namespace ID in the beacon ID is "5dc33487f02e477d4058", the Instance ID is "0117c5986919", and the beacon ID prefix of the beacon ID is "5dc33487f02e477d40".
[0117] S403 . Nearby of the electronic device 100 sends a request message 1 to the cloud server 300 . The request message 1 is used to detect the legitimacy of the beacon parameter 1 .
[0118] In some embodiments, a cloud scanning service corresponds to a beacon parameter. In one implementation, based on the request message 1, the cloud server 300 can query whether there is a beacon parameter corresponding to the cloud scanning service that is the same as the beacon parameter 1; if so, the beacon parameter 1 is legal.
[0119] It can be understood that if the electronic device 100 communicates with the cloud server 300 through the communication module 1 (such as a mobile communication module, a WiFi chip or a Bluetooth chip), Nearby sends a request message 1 to the cloud server 300 by calling the above communication module 1.
[0120] S404, when beacon parameter 1 is legal, the cloud server 300 sends a response message 2 to the Nearby of the electronic device 100, and the response message 2 is used to indicate that the beacon parameter 1 is legal. The response message 2 carries the filter condition 1 and callback condition 1 of the beacon scanning task 1; the filter condition 1 is used to filter out the messages from the beacon devices registered with the cloud scanning service 1; the above callback conditions are used to control the callback frequency of the messages of the same beacon device to the AP.
[0121] Filter condition 1 indicates the value of one or more of the following filter fields: Namespace, message type, beacon ID prefix and message content. Filter condition 1 includes: the scanned Bluetooth message carries the filter field indicated by filter condition 1, and the value is the same as the filter field indicated by filter condition 1.
[0122] In some embodiments, see Figure 5 Nearby includes a subscription module and a Bluetooth scanning task management module. APP1 calls Nearby to start a beacon scanning task, including: (1) when APP1 of the electronic device 100 is started, APP1 calls the subscription module of Nearby to subscribe to the cloud scanning service 1, including sending the beacon parameter 1 of the cloud scanning service 1 to the subscription module; the subscription module detects the legitimacy of the beacon parameter 1 to the cloud server 300; if it is legal, the subscription module calls the Bluetooth task management module to register the beacon scanning task 1 of the cloud scanning service 1.
[0123] Steps S403 and S404 are optional. In some embodiments, the legitimacy of beacon parameter 1 does not need to be checked.
[0124] S405. Nearby calls the Bluetooth chip to start beacon scanning task 1.
[0125] In some embodiments, see Figure 5Step S405 includes: (3) the Bluetooth task management module of Nearby calls the Framework interface of the Bluetooth service to start the beacon scanning task 1; (4) the Bluetooth service sends the beacon scanning task 1 to the Bluetooth chip through the Bluetooth driver of the HAL layer; the Bluetooth chip continues to perform Bluetooth scanning based on the beacon scanning task 1.
[0126] S406. Nearby sends instruction 3 to Sensorhub. Instruction 3 is used to instruct Sensorhub to filter and call back beacon scanning task 1. Instruction 3 carries callback condition 1 and filtering condition 1.
[0127] In some embodiments, see Figure 5 , step S406 includes: (3) the Bluetooth task management module calls the MLPS interface to send callback condition 1 and filter condition 1 to MLPS; (4) MLPS transparently transmits callback condition 1 and filter condition 1 to Sensorhub. Sensorhub sets the beacon filter corresponding to beacon scanning task 1 based on filter condition 1. The beacon filter is used to filter out the beacon messages of the registered beacon devices of the cloud scanning service 1, that is, the beacon messages that meet the aforementioned filter condition 1.
[0128] S407. Based on instruction 3, the Sensorhub sends instruction 4 to the Bluetooth chip. Instruction 4 is used to instruct the Bluetooth chip to switch the scan callback channel to the Sensorhub.
[0129] In some embodiments, instruction 4 is used to instruct the Bluetooth chip to switch the scan callback channel of the beacon scanning service to the Sensorhub, and the Sensorhub is only used to implement the message filtering of the beacon scanning service; the message filtering of other Bluetooth scanning services is implemented by the Bluetooth chip, and the Bluetooth chip directly calls back other Bluetooth scanning services after scanning and filtering to the AP. In some embodiments, instruction 4 is used to instruct the Bluetooth chip to switch the callback channels of all messages after scanning and filtering to the Sensorhub. The Sensorhub is not only used to implement the message filtering of the beacon scanning service, but also used to implement the message filtering of other Bluetooth scanning services, that is, filters corresponding to other Bluetooth scanning services are set.
[0130] In some embodiments, see Figure 5 , step S407 includes: (5) Sensorhub instructs the Bluetooth chip to switch the scan callback channel to Sensorhub. At this point, beacon scanning task 1 is successfully started, the Bluetooth chip will continue to scan beacon broadcasts in the background of the device, and the Sensorhub will continue to filter and callback the Bluetooth messages reported by the Bluetooth chip.
[0131] It can be understood that the electronic device 100 can start beacon scanning tasks corresponding to multiple beacon scanning services; accordingly, the Sensorhub sets the corresponding beacon filter based on the filtering condition of each beacon scanning task, and sets the callback condition corresponding to the beacon scanning task based on the callback condition of each beacon scanning task. In some embodiments, the callback conditions corresponding to different beacon scanning tasks may be different. In some embodiments, the beacon scanning tasks of all APP / APP1 share a callback condition, and only one callback condition needs to be sent to the Sensorhub. For example, when Nearby first registers the beacon scanning task of APP1, callback condition 1 is sent to Sensorhub, and the subsequent beacon scanning tasks registered for APP1 do not need to send callback conditions. In some embodiments, APP1 or the electronic device 100 pre-stores a common callback condition 1, and the cloud server 300 does not need to send callback condition 1 to the electronic device 100 in step S404.
[0132] Phase 2: Scan and parse the beacon ID of the beacon device 200, and execute the preset function 1 according to the message attachment 1 corresponding to the beacon ID.
[0133] S408: The Bluetooth chip scans and receives Bluetooth message 1.
[0134] S409, the Bluetooth chip matches the Bluetooth message 1 with the universal filter 1; if the match is successful, the next step is executed.
[0135] S410. The Bluetooth chip reports Bluetooth message 1 to the Sensorhub.
[0136] In some embodiments, see Figure 5 , after switching the scan callback channel of the beacon scanning task, (6) the Bluetooth chip reports the scanned beacon message / beacon broadcast message to the Sensorhub.
[0137] In some embodiments, when Nearby calls the Bluetooth chip to start beacon scanning registration task 1 in step 405, it also sends filtering condition 4 to the Bluetooth chip. The Bluetooth chip sets a general filter 1 based on the condition. The general filter 1 is used to filter out the beacon message / beacon broadcast message of the self-beacon device; the Bluetooth chip uses the general filter 1 to perform preliminary filtering on the scanned Bluetooth message, and reports the filtered Bluetooth message to the Sensorhub. By setting the general filter 1 in the Bluetooth chip, irrelevant Bluetooth messages can be initially filtered out, and only the beacon message / beacon broadcast message required for the beacon scanning service is reported to the Sensorhub, reducing the power consumption of the Sensorhub; in addition, a general filter consumes less hardware resources of the Bluetooth chip.
[0138] In one implementation, the general filter 1 is used to filter out beacon messages, and the beacon broadcast message carries a beacon device type (Beacon type); the filtering condition 4 indicated by the general filter 1 includes: the scanned Bluetooth message includes a beacon device type.
[0139] In one implementation, the general filter 1 is used to filter out beacon broadcast messages, and the destination MAC address of the broadcast message is usually a preset address (for example, the preset address is all 1 / F); the filtering condition 4 indicated by the general filter 1 includes: the scanned Bluetooth message includes a beacon device type, and the destination MAC address is a preset address.
[0140] In some embodiments, instruction 4 is used to instruct the Bluetooth chip to switch the scan callback channel of the beacon scan service to the Sensorhub. For other messages that do not meet the general filter 1, the Bluetooth chip can call back to the AP according to the existing solution.
[0141] It should be noted that when the short-range scanning method provided in the embodiment of the present application is applied to other short-range communication services, a general filter corresponding to the service can also be set in the short-range communication module, and the general filter is used to filter the short-range communication messages from the related devices of the service.
[0142] In some embodiments, instruction 4 is used to instruct the Bluetooth chip to switch the scan callback channel of all services to the Sensorhub, and there is no need to execute S409. The Bluetooth chip directly calls back the scanned Bluetooth message to the Sensorhub.
[0143] S411, Sensorhub matches Bluetooth message 1 with the beacon filters corresponding to each beacon scanning task; if it matches at least one beacon filter successfully, execute the next step.
[0144] In some embodiments, instruction 4 is used to instruct the Bluetooth chip to switch the scan callback channel of the beacon scanning service to the Sensorhub. In step S411, if the Bluetooth message 1 does not match the beacon filter, the message is discarded.
[0145] Filter condition 1 of beacon scanning task 1 indicates the value of one or more of the following filter fields: Namespace, message type, beacon ID prefix and message content. Taking beacon filter 1 corresponding to beacon scanning task 1 as an example, Bluetooth message 1 is matched with beacon filter 1, that is, it is determined whether Bluetooth message 1 meets filter condition 1. If it does, the match is successful. Specifically, Sensorhub can parse Bluetooth 1 and extract the filter fields in Bluetooth message 1 according to the format of the beacon broadcast message; if Bluetooth message 1 includes all the filter fields indicated by filter condition 1, and each filter field matches the filter field indicated by filter condition 1, then Bluetooth message 1 successfully matches the beacon filter.
[0146] When the first filter field is any filter field indicated by filter condition 1, and the first filter field is Namespace, one of the message type and beacon ID prefix, the first filter field carried by the message matches the first filter field indicated by filter condition 1, including: the first filter field carried by the message has the same value as the first filter field indicated by filter condition 1. When the first filter field is message content, the first filter field carried by the message matches the first filter field indicated by filter condition 1, including: the message content carried by the message includes the message content indicated by filter condition 1. Exemplarily, when the message content indicated by filter condition 1 is one or more keywords, such as "discount", and the message content carried by the message includes the above one or more keywords, the message content carried by the message matches the message content indicated by filter condition 1.
[0147] In some embodiments, the filter field indicated by filter condition 1 includes only the beacon ID prefix, i.e., the beacon ID prefix based on the iBeacon protocol (e.g., UUID), or the beacon ID prefix based on the Eddystone protocol (e.g., NamespaceID). If the beacon ID prefix in Bluetooth message 1 is the same as the beacon ID prefix indicated by filter condition 1, Bluetooth message 1 successfully matches beacon filter 1.
[0148] In some embodiments, in step S406, Nearby also sends filtering condition 3 corresponding to beacon scanning task 1 to Sensorhub, filtering condition 3 is used to indicate filtering condition 3 that the scenario characteristics of the scenario in which the electronic device is located in the cloud scanning service 1 need to satisfy, and Sensorhub also sets a scenario filter based on filtering condition 3; or sets beacon filter 1 based on filtering condition 1 and filtering condition 3, and beacon filter 1 integrates the functions of the above-mentioned scenario filter. Specifically, the above-mentioned scenario characteristics may include characteristics of the electronic device 100 (for example, the distance, orientation, speed, distance change trend, etc. relative to the beacon device), and may also include environmental characteristics (for example, weather, temperature, location, etc.). It can be understood that only when the scenario characteristics of the scenario in which the electronic device 100 is located meet filtering condition 3, the electronic device 100 provides the user with the relevant functions of the cloud scanning service 1, and the Sensorhub reports Bluetooth message 1 to the AP.
[0149] Exemplarily, filtering condition 3 includes: the distance relative to the beacon device gradually decreases, and the above distance is less than the preset distance. A beacon device 200 is set next to the product 1 in the mall. When the user gradually approaches the beacon device 200 and is close to the beacon device 200, the APP1 of the electronic device 100 pushes the product information corresponding to the beacon device 200. Specifically, the Bluetooth chip of the electronic device 100 scans the beacon broadcast message of the beacon device 200, and detects the distance between the beacon device 200 and the distance change trend based on the received beacon broadcast message; when the Sensorhub determines that the above distance and distance change trend meet filtering condition 3, it determines that the beacon broadcast message matches the scenario filter of the beacon scanning task 1.
[0150] Exemplarily, filtering condition 3 includes: the weather is rainy. Before the AP goes into sleep, APP1 also sends the weather of the day to Sensorhub. A beacon device 200 is set next to the shared umbrella device. When the user is close to the beacon device 200 and the weather is rainy, APP1 of the electronic device 100 pushes preferential information about shared umbrellas. Specifically, the Bluetooth chip of the electronic device 100 scans the beacon broadcast message of the beacon device 200, and detects the distance to the beacon device 200 based on the received beacon broadcast message; when the Sensorhub determines that the above distance and the weather of the day meet filtering condition 3, it determines that the beacon broadcast message matches the scenario filter of the beacon scanning task 1.
[0151] S412, Sensorhub determines whether Bluetooth message 1 satisfies callback condition 1; if so, executes the next step; otherwise, discards the message.
[0152] The callback control of step S412 will be introduced in detail in subsequent embodiments and will not be described here in detail.
[0153] S413: After the AP wakes up, the Sensorhub reports Bluetooth message 1 to the Nearby in the AP.
[0154] The embodiment of the present application does not specifically limit the execution order of steps S411 and S412, and S412 may be executed first and then S411.
[0155] Step S412 is optional. In some embodiments, there is no need to send callback condition 1 in step S406, and there is no need to execute S412. In step S411, after the Sensorhub uses the beacon filter to match the Bluetooth message, if the match is successful, S413 is executed to call the message back to the AP; otherwise, the message is discarded.
[0156] Step S411 is optional. In some embodiments, in step S406, there is no need to send filtering condition 1, nor to execute S411. After receiving the Bluetooth message reported by the Bluetooth chip, S412 is directly executed; in step S412, after the Sensorhub matches the Bluetooth message 1 with the callback condition 1, if the match is successful, the message is called back to the AP; otherwise, the message is discarded.
[0157] In some embodiments, in step S413, the Sensorhub actively wakes up the AP and reports the Bluetooth message 1, or caches the Bluetooth message 1 and waits for the AP to be woken up by other means before the Sensorhub reports the Bluetooth message 1 to the AP.
[0158] In some embodiments, see Figure 5 , step S413 includes: (7) After the AP wakes up, the Sensorhub calls back the Bluetooth message 1 to the MLPS. (8) The MLPS further calls back the Bluetooth message 1 to the Bluetooth scanning task management module of Nearby.
[0159] S414 , Nearby sends a request message 2 to the cloud server 300 , where the request message 2 includes the beacon ID 1 in the Bluetooth message 1 .
[0160] S415. The cloud server 300 sends message attachment 1 corresponding to beacon ID 1 to Nearby.
[0161] In the embodiment of the present application, after receiving Bluetooth message 1 (e.g., beacon broadcast message of beacon device 200), Nearby parses beacon ID1 in the message, and calls the REST API provided by the Nearby cloud service to query the cloud server 300 for the message attachment corresponding to beacon ID1. The cloud server 300 queries the message attachment corresponding to beacon ID1 in the beacon database, and replies all the queried message attachments to the subscriber, i.e., Nearby of the electronic device 100, at one time.
[0162] In some embodiments, see Figure 5 , step S414 includes: (9) after the AP wakes up, the Nearby message management module requests the Nearby cloud server to query the message attachment 1 corresponding to the beacon ID1; step S415 includes: (10) the Nearby cloud server feeds back the message attachment 1 to the Nearby message management module.
[0163] S416. Nearby sends the message content in message attachment 1 to APP1.
[0164] In some embodiments, see Figure 5 , step S416 includes: (11) After the AP wakes up, the notification module of Nearby sends the message content in message attachment 1 to APP1. It can be understood that Nearby can identify which beacon scanning service the Bluetooth message is for based on the filter field carried in the Bluetooth message 1, and then report the message content of the message attachment corresponding to the Bluetooth message 1 to the APP corresponding to the beacon scanning service, such as APP1 corresponding to the beacon scanning service 1.
[0165] S417 , APP1 executes preset function 1 according to the message content in message attachment 1 .
[0166] The present application embodiment does not specifically limit the preset function 1. In some embodiments, in the aforementioned information push scenario, the preset function 1 includes: APP1 can output push information 1 according to the message content in the message attachment 1. For example, refer to FIG. 3A to FIG. 3D , Bluetooth message 1 is a beacon broadcast message of the beacon device 200 of the gas station, and the message content in the message attachment 1 corresponding to the beacon ID of the beacon device indicates the preferential information of refueling. The wallet APP pushes the preferential information of refueling to the user according to the above message content, for example, it shows Figure 3A The card 102 shown displays discount information for refueling.
[0167] In some embodiments, in the positioning scenario, the message content in the message attachment 1 indicates the location of the beacon device 200; the preset function 1 includes: APP1 determines the location of the electronic device 100 according to the location of the beacon device 200 in the message attachment 1, and displays the location of the electronic device 100 on the map. Specifically, the distance and orientation of the electronic device 100 relative to the beacon device 200 can be determined based on the signal parameters of the received Bluetooth message 1 (such as the received signal strength and the signal arrival angle); and then the location of the electronic device 100 is determined based on the above distance and orientation, as well as the location of the beacon device 200 in the message content.
[0168] Exemplary, for a local scanning service for beacons, Figure 7A schematic flow chart of a short-range scanning method is shown, and the short-range scanning method includes but is not limited to steps S501 to S513.
[0169] Phase 3: Register the beacon device for the local scanning service and start the beacon scanning task
[0170] S501 . APP1 of the electronic device 100 pre-stores the correspondence between the beacon ID2 of the registered beacon device 400 of the local scanning service 1 and the preset function 2 .
[0171] The application developer of APP1 sets a preset function 2 of the local scanning service 1 (e.g., door unlocking) for APP1. In some embodiments, after the electronic device 100 installs and starts APP1, APP1 can automatically subscribe to the local scanning service 1, that is, provide the preset function 2 of the local scanning service 1. In some embodiments, after the electronic device 100 installs and starts APP1, it subscribes to the local scanning service 1 only after receiving an input operation for starting the preset function 2. For example, refer to FIG. 3A to FIG. 3E As described in the related description, the vehicle APP is provided with a switch control 304 for beacon intelligent unlocking. When an input operation for switching the switch control 304 to the on state is detected, APP1 subscribes to the local scanning service 1 corresponding to the function to provide the door unlocking function.
[0172] APP1 registers the beacon device 400 of the local scanning service 1, including storing the correspondence 1 between the beacon ID2 of the registered beacon device 400 and the preset function 2. APP1 of the electronic device 100 can register one or more beacon devices of at least one local scanning service, and the preset functions corresponding to different beacon devices can be the same or different. Among them, the preset function 2 corresponding to the beacon ID2 can be set by the user or preset by APP1 or the electronic device 100, which is not specifically limited here.
[0173] In some embodiments, APP1 registers a beacon device 400 for a local scanning service 1, including: a user brings the electronic device 100 close to the beacon device 400 of interest, and the electronic device 100 and the beacon device 400 are paired and connected via Bluetooth; after successfully establishing the Bluetooth connection, APP1 registers the beacon device 400 as a beacon device for a local scanning service 1, and stores a correspondence 1 between the beacon ID 2 of the beacon device 400 and the preset function 2.
[0174] In some embodiments, APP1 registers the beacon device 400 of the local scanning service 1, including: the beacon device 400 is deployed on the electronic device 500 (for example, a vehicle), and the electronic device 500 stores the beacon ID 2 of the beacon device 400; after the electronic device 100 and the electronic device 500 establish a connection, the electronic device 500 sends the beacon ID 2 of the beacon device 400 to the electronic device 100; APP1 registers the beacon device 400 as the beacon device of the local scanning service 1, and stores the corresponding relationship 1 between the beacon ID 2 of the beacon device 400 and the preset function 2. The connection method between the electronic device 500 and the electronic device 100 is not specifically limited here. Exemplarily, APP1 is a vehicle APP, and the vehicle APP of the electronic device 100 provides a function of adding a vehicle; a beacon device 400 is deployed on vehicle 1, and the preset function 2 corresponding to the beacon ID of the beacon device 400 is door unlocking; based on the user's input operation to add vehicle 1, the vehicle APP adds vehicle 1; after adding vehicle 1, the vehicle APP of the electronic device 100 obtains the beacon ID2 of the beacon device 400 from vehicle 1, and stores the correspondence 1 between the beacon ID2 and the preset function 2.
[0175] In some embodiments, APP1 registers the beacon device 400 of the local scanning service 1, including: the application server of APP1 pre-stores the beacon ID2 of the registered beacon device (for example, the beacon device 400); after the electronic device 100 installs APP1, the application server of APP1 automatically sends the correspondence 1 between the beacon ID2 of the registered beacon device 400 and the preset function 2 to the electronic device 100.
[0176] The embodiment of the present application does not specifically limit the implementation method of APP1 of the electronic device 100 subscribing to the local scanning service and registering the beacon device 400.
[0177] S502 , APP1 of the electronic device 100 sends instruction 5 to Nearby, where instruction 5 is used to instruct to register a beacon scanning task 2 corresponding to the local scanning service 1 , and instruction 5 includes the beacon ID 2 of the beacon device 400 that has been registered with the local scanning service 1 .
[0178] S503, Nearby calls the Bluetooth chip to start beacon scanning task 2.
[0179] S504. Nearby sends instruction 6 to Sensorhub. Instruction 6 is used to instruct Sensorhub to filter and call back beacon scanning task 2. Instruction 6 carries callback condition 2 and filter condition 2. Filter condition 2 indicates the value of the beacon ID. Filter condition 2 is used to filter the Bluetooth messages reported by the Bluetooth chip. Callback condition 2 is used to control the callback frequency of the same beacon device.
[0180] S505. Based on instruction 6, the Sensorhub sends instruction 7 to the Bluetooth chip. Instruction 7 is used to instruct the Bluetooth chip to switch the scan callback channel to the Sensorhub.
[0181] At this point, beacon scanning task 2 is successfully started. The Bluetooth chip will continue to perform beacon broadcast scanning in the background of the device, and the Sensorhub will continue to filter and call back the Bluetooth messages reported by the Bluetooth chip.
[0182] For the specific implementation of steps S502 to S505, reference may be made to the relevant descriptions of steps S402, S405, and S406, respectively, and will not be repeated here.
[0183] Phase 4: Scan and parse the beacon ID2 of the beacon device 400, and execute the preset function 2 corresponding to the beacon ID2.
[0184] S506: The Bluetooth chip scans Bluetooth message 2.
[0185] S507 . The Bluetooth chip matches the Bluetooth message 2 with the universal filter 1 . If the match is successful, execute S508 .
[0186] S508. The Bluetooth chip reports Bluetooth message 2 to the Sensorhub.
[0187] S509, Sensorhub matches Bluetooth message 2 with the beacon filters corresponding to each beacon scanning task; if it matches at least one beacon filter successfully, execute the next step.
[0188] In the embodiment of the present application, if the beacon ID in the Bluetooth message 2 is the same as the beacon ID indicated by the beacon filter, the Bluetooth message 2 and the beacon filter are matched successfully.
[0189] S510, Sensorhub determines whether Bluetooth message 2 meets callback condition 2; if so, executes the next step; otherwise, discards the message.
[0190] S511. After the AP wakes up, the Sensorhub reports Bluetooth message 2 to the Nearby in the AP.
[0191] For the specific implementation of steps S506 to S511, reference may be made to the relevant descriptions of steps S408, S405, and S406, respectively, and will not be repeated here.
[0192] S512 . Nearby sends beacon ID2 in Bluetooth message 2 to APP1 .
[0193] S513, APP1 executes the preset function 2 corresponding to the beacon ID2.
[0194] For example, APP1 is a vehicle APP, and preset function 2 includes door unlocking. FIG. 3A to FIG. 3E In the described smart unlocking scenario, a beacon device 400 is deployed on the door of vehicle 1; when the vehicle APP of the electronic device 100 scans and parses the beacon ID2 of the beacon device 400, an instruction is sent to the on-board device of vehicle 1, which is used to instruct the on-board device 1 to control the door unlocking.
[0195] In an embodiment of the present application, the related functions of scanning filtering and / or message callback of the beacon device are delegated to a low-power Sensorhub. Without waking up the AP, the scanned messages are filtered in the Sensorhub according to a unified scanning filter field to filter out the beacon broadcast messages of the beacon devices that have registered for the subscribed beacon scanning service, thereby shielding the AP wake-up caused by irrelevant beacon broadcasts of non-beacon devices and unregistered beacon devices, and effectively reducing the power consumption of the electronic device 100. In addition, in the cloud scanning service, the number of requests to the Nearby cloud interface can also be reduced.
[0196] Since the beacon device continuously sends Bluetooth broadcasts, when the electronic device enters the beacon broadcast range, it will continuously scan the beacon broadcast message, and then continue to call back the upper layer service, frequently waking up the AP. This embodiment controls the frequency of the broadcast message of the same beacon device in the Sensorhub, reduces the frequency of waking up the AP, and achieves the purpose of controlling power consumption.
[0197] In some embodiments, callback condition 1 in the above step S412 is the same as callback condition 2 in step S510, and callback condition 1 includes: Bluetooth message 1 is discovered for the first time; or, Bluetooth message 1 is not discovered for the first time, but the time difference between time 1 and time 2 of the last callback of Bluetooth message 1 to the AP is less than time threshold 1.
[0198] The Sensorhub caches time 1 and time 2. In some embodiments, time 1 is the time when the Bluetooth chip receives Bluetooth message 1 this time, and time 2 is also the time when the Bluetooth chip receives Bluetooth message 1. In some embodiments, time 1 is the time when the Sensorhub obtains Bluetooth message 1 reported by the Bluetooth chip this time, and time 2 is also the time when the Sensorhub obtains Bluetooth message 1 reported by the Bluetooth chip. In some embodiments, time 1 is the current moment, and time 2 is also the time when the Sensorhub last called back Bluetooth message 1 to the AP.
[0199] For example, Figure 8 As shown, the callback control logic of the beacon broadcast message is exemplified below by taking the callback condition 1, the beacon device 200 and the close-range scanning process of the cloud scanning service 1 as an example.
[0200] The beacon device 200 is a beacon device 200 that has been registered with the cloud scanning service 1. The beacon broadcast message sent by the beacon device 200 can match the aforementioned general filter, or can match the beacon filter corresponding to the cloud scanning service 1. The beacon device 200 continuously sends the beacon broadcast message 1 (i.e., the aforementioned Bluetooth message 1) according to the broadcast interval 1; after the Bluetooth chip of the electronic device 100 starts the beacon scanning task, if the electronic device 100 is near the beacon device 200 (i.e., within the coverage of the Bluetooth broadcast of the beacon device 200), the Bluetooth chip can continuously scan the beacon broadcast message 1 and continuously report the beacon broadcast message 1 to the Sensorhub.
[0201] In some embodiments, Figure 8 As shown, the electronic device 100 discovers the beacon broadcast message 1 of the beacon device 200 for the first time, the aforementioned step S410 is specifically step S410A, step S412 is specifically step S412A, and step S413 is specifically step S413A.
[0202] S410A, the Bluetooth chip reports the first discovered beacon broadcast message 1 to the Sensorhub.
[0203] S412A, Sensorhub determines that beacon broadcast message 1 is discovered for the first time, and this beacon broadcast message 1 meets callback condition 1, and executes the next step (for example, calling back the beacon broadcast message 1 discovered this time to the AP).
[0204] In some embodiments, the Sensorhub caches the beacon ID of the Bluetooth message called back to the AP; if the beacon ID of the cached message is the same as the beacon ID of the beacon broadcast message 1, it is determined that it is not the first time that the beacon broadcast message 1 is discovered; otherwise, it is determined that the beacon broadcast message 1 is discovered for the first time.
[0205] In some embodiments, the Sensorhub caches the beacon ID and MAC address of the Bluetooth message called back to the AP; if the beacon ID and MAC address of the cached message are respectively the same as the beacon ID and MAC address in the beacon broadcast message 1, it is determined that it is not the first time that beacon broadcast message 1 is discovered; otherwise, it is determined that beacon broadcast message 1 is discovered for the first time.
[0206] In some embodiments, the Sensorhub caches a Bluetooth message that is called back to the AP; if there is a cached message that has exactly the same message content as the beacon broadcast message 1, it is determined that it is not the first time that the beacon broadcast message 1 is discovered; otherwise, it is determined that the beacon broadcast message 1 is discovered for the first time.
[0207] In some embodiments, the beacon broadcast message 1 that the Sensorhub calls back to the AP is a Bluetooth message that matches one or more filters among the aforementioned general filter, beacon filter, and scenario filter.
[0208] S413A, Sensorhub reports the first discovered beacon broadcast message 1 to Nearby in AP.
[0209] In some embodiments, Figure 8 As shown, the electronic device 100 discovers the beacon broadcast message 1 of the beacon device 200 for the i-th time, and the aforementioned step S410 is specifically step S410B, and step S412 is specifically step S412B.
[0210] S410B, the Bluetooth chip reports the beacon broadcast message 1 discovered for the i-th time to the Sensorhub.
[0211] S412B, Sensorhub determines that this is not the first time that beacon broadcast message 1 is discovered, and the time interval between time 1 and time 2 of the last callback to the AP of beacon broadcast message 1 is less than time threshold 1. This beacon broadcast message 1 does not meet callback condition 1, and the message is discarded.
[0212] In some embodiments, Figure 8 As shown, the electronic device 100 discovers the beacon broadcast message 1 of the beacon device 200 for the (i+1)th time, the aforementioned step S410 is specifically step S410C, step S412 is specifically step S412C, and step S413 is specifically step S413C.
[0213] S410C, the Bluetooth chip reports the beacon broadcast message 1 discovered for the i+1th time to the Sensorhub.
[0214] S412C, Sensorhub determines that it is not the first time to discover beacon broadcast message 1, and the time interval between time 1 and time 2 of the last callback to the AP beacon broadcast message 1 is greater than time threshold 1. This beacon broadcast message 1 meets callback condition 1, and executes the next step.
[0215] S413C, Sensorhub reports the beacon broadcast message 1 discovered for the (i+1)th time to Nearby in the AP.
[0216] In the embodiment of the present application, by detecting "the first discovered Bluetooth message" and "controlling the callback interval of the Bluetooth message" in the Sensorhub, the continuous Bluetooth callback caused by the continuous broadcasting of the same beacon device can be greatly reduced, the number of AP wake-up times can be significantly reduced, and the power consumption of the device can be reduced.
[0217] In some embodiments, beacon loss logic is also added; after discovering the beacon broadcast message 1 of the beacon device 200, if the beacon broadcast message 1 is not found again within the preset time length 1, the Sensorhub can promptly report the beacon loss event of the beacon device 200 to the AP. Based on the beacon loss event of the beacon device 200, the APP can execute the preset function 3. The embodiment of the present application does not specifically limit the preset function 3. For example, APP1 is a vehicle APP, and the beacon device 200 is used to trigger the unlocking of the door. After the vehicle APP receives the beacon loss event of the beacon device 200 reported by the Sensorhub, if it detects that the door is not locked, it outputs a prompt message to prompt the user to lock the door in time.
[0218] like Figure 8 As shown, in the short-range scanning method provided in the embodiment of the present application, after the beacon broadcast message 1 is first discovered in step S410A, the beacon callback control process further includes steps S601 to S604.
[0219] S601: When the Sensorhub determines that the time from the last discovery of the beacon broadcast message 1 is greater than the preset time 1, S602 is executed.
[0220] S602 , the Sensorhub reports the beacon loss event of the beacon device 200 to the Nearby in the AP.
[0221] The beacon loss event of the beacon device 200 reported by the Sensorhub to Nearby carries the beacon ID of the beacon device 200 .
[0222] S603. Nearby notifies APP1 of the beacon loss event.
[0223] S604. APP1 executes preset function 3 based on the beacon loss event.
[0224] To implement the "beacon loss logic", it is necessary to set a timer with a preset duration of 1. To implement this timer in the AP, the AP needs to remain active and cannot sleep. In the embodiment of the present application, the timer is implemented in the Sensorhub. The AP does not need to remain active and can enter a sleep state. The power consumption of the Sensorhub to implement this timer is lower.
[0225] Based on the above embodiments, the present application provides a short-range scanning method, which is applied to a first electronic device, wherein the first electronic device includes a first short-range communication module, a main processor and a second processor. The method includes steps S701 to S705.
[0226] S701. The main processor sends a first instruction to the second processor.
[0227] S702: A first instruction is used to instruct a second processor to filter messages based on a first filtering condition, where the first filtering condition is used to filter messages from devices of a first service, where the devices of the first service include a first device.
[0228] S703: The first short-range communication module scans a first message sent by a first device.
[0229] S704: The first short-range communication module sends a first message to the second processor.
[0230] S705: The second processor determines that the first message matches the first filtering condition in the second processor, and the second processor sends the first message to the main processor.
[0231] In the embodiment of the present application, the first electronic device may include the aforementioned electronic device 100; the first short-range communication module may include the aforementioned chip; the second processor may include the aforementioned microprocessor. In some embodiments, the first service may include the aforementioned cloud scanning service 1 of the beacon; the first instruction may include the aforementioned instruction 3; the first device may include the aforementioned beacon device 200; the first filtering condition may include the aforementioned filtering condition 1; the first message may include the aforementioned Bluetooth message 1. In some embodiments, the first service may include the aforementioned local scanning service 1 of the beacon; the first instruction may include the aforementioned instruction 6; the first device may include the aforementioned beacon device 400; the first filtering condition may include the aforementioned filtering condition 2; the first message may include the aforementioned Bluetooth message 2.
[0232] In some embodiments, the method further includes: the first short-range communication module scans a second message sent by the second device; the first short-range communication module sends the second message to the second processor; the second processor determines that the second message does not match the first filtering condition in the second processor, and the second processor does not send the first message to the main processor. Exemplarily, the second device is a beacon device of a beacon scanning service that the electronic device 100 has not subscribed to. Exemplarily, the second device is a Bluetooth device of a non-beacon scanning service.
[0233] In some embodiments, the method further includes: based on the first instruction, the second processor sends a second instruction to the first short-range communication module, the second instruction being used to instruct the first short-range communication module to send the scanned message to the second processor.
[0234] In some embodiments, the method further includes: based on the first instruction, the second processor sends a second instruction to the first short-range communication module, the second instruction is used to instruct the first short-range communication module to send the scanned message of the first type of service to the second processor; the first service belongs to the first type of service.
[0235] In the embodiment of the present application, the first type of service may include the aforementioned beacon scanning service. In some embodiments, the first service may include the aforementioned beacon cloud scanning service 1; the second instruction may include the aforementioned instruction 4. In some embodiments, the first service may include the aforementioned beacon local scanning service 1; the second instruction may include the aforementioned instruction 7.
[0236] In some embodiments, before the first short-distance communication module sends the first message to the second processor, it also includes: the main processor sends a second filtering condition to the first short-distance communication module, and the second filtering condition is used to filter messages from devices of the first type of service; the first short-distance communication module sends the first message to the second processor, including: when the first short-distance communication module determines that the first message meets the second filtering condition, the first message is sent to the second processor. In the embodiment of the present application, the second filtering condition may include the aforementioned filtering condition 4.
[0237] In some embodiments, before the second processor sends the first message to the main processor, the main processor also sends a callback condition to the second processor, and the callback condition is used to instruct the second processor to send the first message to the main processor when the first message meets the callback condition. In the embodiment of the present application, the callback condition may include the aforementioned callback condition 1 or callback condition 2.
[0238] In some embodiments, the callback condition of the first message includes any one of the following: the first message is received for the first time; the first message is not received for the first time, and the time interval between the time of receiving the first message this time and the time of receiving the first message most recently sent to the main processor is greater than the first time threshold. In the embodiment of the present application, the first time threshold may include the aforementioned time threshold 1.
[0239] In some embodiments, the first message includes a device identification of the first device, and the method further includes: the main processor obtains a first message attachment associated with the first device from the server based on the device identification of the first device; the first application in the main processor executes a first preset function according to the message content in the first message attachment. In the embodiment of the present application, the device identification of the first device may include a beacon ID of the first device, the first service may include the cloud scanning service 1 of the aforementioned beacon; the first message attachment may include the aforementioned message attachment 1; the first preset function may include the aforementioned preset function 1.
[0240] In some embodiments, the first message includes a device identification of the first device, and the method further includes: the main processor executes a second preset function based on the device identification of the first device. In the embodiment of the present application, the device identification of the first device may include a beacon ID of the first device, the first service may include a local scanning service 1 of the aforementioned beacon; and the second preset function may include the aforementioned preset function 2.
[0241] In some embodiments, after the second processor sends the first message to the main processor, the method further includes: the second processor detects that the message of the first device is not received again within a first preset time length after receiving the message of the first device, and the second processor sends a loss event of the first device to the main processor. In this embodiment of the present application, the first preset time length may include the aforementioned preset time length 1.
[0242] In some embodiments, the first short-range communication module is a Bluetooth chip, the first service is a first beacon scanning service of a first application, and the first device is a registered beacon device of the first beacon scanning service. In the embodiment of the present application, the first application may include the aforementioned APP1, and the first beacon scanning service may include the aforementioned cloud scanning service 1 or local scanning service 1.
[0243] In some embodiments, the method also includes: the main processor sends a first request message to the server, the first request message carries the beacon parameters of the first beacon scanning service, and the first request message is used to detect the legality of the beacon parameters; when the beacon parameters are legal, the main processor receives a first response message sent by the server; the first response message carries the first filtering condition.
[0244] In some embodiments, the second filtering condition includes the type of beacon device carried by the message.
[0245] In some embodiments, the device identification of the first device includes a first beacon ID, the cloud server stores one or more message attachments associated with the first beacon ID, and the main processor obtains the first message attachment associated with the first device from the server based on the device identification of the first device, including: the main processor sends a second request message to the server, the second request message includes the first beacon ID, and the second request message is used to query the message attachment associated with the first beacon ID; the main processor receives the first message attachment sent by the server, and the first message attachment is any one of the one or more message attachments.
[0246] In an embodiment of the present application, the first service may include the aforementioned cloud scanning service 1; the first request message may include the aforementioned request message 1, the first response message may include the aforementioned response message 2; the second request message may include the aforementioned request message 2; the first beacon ID may include the beacon ID 1 of the aforementioned beacon device 200.
[0247] In some embodiments, the first filter condition indicates the value of one or more of the following filter fields of the first beacon scanning service: namespace, message type, beacon ID prefix and message content; the first message matches the first filter condition, including: the first message carries the first filter field, and the first filter field carried by the first message matches the first filter field indicated by the first filter condition, and the first filter field is any filter field indicated by the first filter condition.
[0248] In some embodiments, the device identification of the first device includes a first beacon ID, and the first application stores a correspondence between the first beacon ID and a second preset function; the main processor executes the second preset function based on the device identification of the first device, including: the first application in the main processor executes the second preset function corresponding to the first beacon ID according to the correspondence.
[0249] In some embodiments, the first filtering condition indicates a first beacon ID of the first device; the first message matches the first filtering condition, including: the beacon ID carried by the first message is the first beacon ID.
[0250] In the embodiment of the present application, the first service may include the aforementioned local scanning service 1; the first beacon ID may include the beacon ID 2 of the aforementioned beacon device 400, the second preset function may include the aforementioned preset function 2, and the first filtering condition may include the aforementioned filtering condition 2.
[0251] The structure of the electronic device 100 involved in the embodiment of the present application is exemplarily described below.
[0252] Fig. 9 1 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0253] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0254] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0255] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0256] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0257] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0258] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0259] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0260] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0261] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0262] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0263] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0264] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.
[0265] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0266] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0267] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0268] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0269] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0270] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0271] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0272] The wireless communication module 160 can provide wireless communication solutions 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 (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0273] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0274] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0275] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0276] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0277] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise and brightness of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0278] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0279] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0280] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0281] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0282] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0283] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.; non-volatile memory may include disk storage devices and flash memory.
[0284] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.
[0285] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.
[0286] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0287] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0288] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0289] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0290] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0291] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0292] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by approaching the microphone 170C with his mouth to input the sound signal into the microphone 170C.
[0293] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0294] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc.
[0295] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting.
[0296] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0297] The magnetic sensor 180D includes a Hall sensor, and the electronic device 100 can detect the opening and closing of the flip leather case by using the magnetic sensor 180D.
[0298] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes).
[0299] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser.
[0300] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode.
[0301] The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed brightness of the ambient light.
[0302] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0303] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy.
[0304] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0305] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of a human vocal part.
[0306] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0307] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
[0308] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0309] The SIM card interface 195 is used to connect a SIM card.
[0310] The various implementation modes of the present application can be combined arbitrarily to achieve different technical effects.
[0311] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0312] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0313] In short, the above description is only an embodiment of the technical solution of the present invention, and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.
Claims
1. A short-range scanning method is applied to a first electronic device, the first electronic device comprising a first short-range communication module, a main processor and a second processor; the method comprises: The main processor sends a first instruction to the second processor; The first instruction is used to instruct the second processor to filter messages based on a first filtering condition, where the first filtering condition is used to filter messages from a device of a first service, where the device of the first service includes a first device; The first short-range communication module scans a first message sent by the first device; The first short-range communication module sends the first message to the second processor; The second processor determines that the first message matches the first filtering condition in the second processor, and the second processor sends the first message to the main processor.
2. The method according to claim 1, characterized in that The method further comprises: The first short-range communication module scans a second message sent by a second device; The first short-range communication module sends the second message to the second processor; The second processor determines that the second message does not match the first filtering condition in the second processor, and the second processor does not send the first message to the main processor.
3. The method according to claim 1, characterized in that The method further comprises: Based on the first instruction, the second processor sends a second instruction to the first short-distance communication module, where the second instruction is used to instruct the first short-distance communication module to send the scanned message to the second processor.
4. The method according to claim 1, characterized in that: The method further comprises: Based on the first instruction, the second processor sends a second instruction to the first short-range communication module, where the second instruction is used to instruct the first short-range communication module to send a scanned message of a first type of service to the second processor; the first service belongs to the first type of service.
5. The method according to claim 1 or 4, characterized in that: Before the first short-range communication module sends the first message to the second processor, the method further includes: The main processor sends a second filtering condition to the first short-range communication module, where the second filtering condition is used to filter messages from devices of the first type of service; The first short-range communication module sending the first message to the second processor includes: When the first short-range communication module determines that the first message satisfies the second filtering condition, the first message is sent to the second processor.
6. The method according to claim 1, characterized in that Before the second processor sends the first message to the main processor, the method further includes: The main processor sends a callback condition to the second processor, where the callback condition is used to instruct the second processor to send the first message to the main processor when the first message meets the callback condition.
7. The method according to claim 6, characterized in that The callback condition of the first message includes any one of the following: receiving the first message for the first time; not receiving the first message for the first time, and the time interval between the time of receiving the first message this time and the time of receiving the first message last sent to the main processor is greater than a first time threshold.
8. The method according to claim 1, characterized in that The first message includes a device identifier of the first device, and the method further includes: The main processor obtains a first message attachment associated with the first device from a server based on a device identification of the first device; The first application in the main processor executes a first preset function according to the message content in the first message attachment.
9. The method according to claim 1, characterized in that: The first message includes a device identifier of the first device, and the method further includes: The main processor executes a second preset function based on the device identification of the first device.
10. The method according to claim 1, characterized in that After the second processor sends the first message to the main processor, the method further includes: The second processor detects that no message from the first device is received again within a first preset time period after receiving the message from the first device, and the second processor sends a loss event of the first device to the main processor.
11. The method according to any one of claims 1 to 10, characterized in that: The first short-range communication module is a Bluetooth chip, the first service is a first beacon scanning service of a first application, and the first device is a registered beacon device of the first beacon scanning service.
12. The method according to claim 11, characterized in that The method further comprises: The main processor sends a first request message to the server, where the first request message carries beacon parameters of the first beacon scanning service, and the first request message is used to detect the legitimacy of the beacon parameters; When the beacon parameters are legal, the main processor receives a first response message sent by the server; the first response message carries the first filtering condition.
13. The method according to claim 11, characterized in that The second filtering condition includes the type of beacon device carried by the message.
14. The method according to claim 11, characterized in that The device identification of the first device includes a first beacon ID, the cloud server stores one or more message attachments associated with the first beacon ID, and the main processor obtains a first message attachment associated with the first device from the server based on the device identification of the first device, including: The main processor sends a second request message to the server, where the second request message includes the first beacon ID, and the second request message is used to query a message attachment associated with the first beacon ID; The main processor receives a first message attachment sent by the server, where the first message attachment is any one of the one or more message attachments.
15. The method according to claim 14, characterized in that The first filtering condition indicates the value of one or more of the following filtering fields of the first beacon scanning service: namespace, message type, beacon ID prefix and message content; The first message matches the first filtering condition, including: the first message carries a first filtering field, and the first filtering field carried by the first message matches the first filtering field indicated by the first filtering condition, and the first filtering field is any filtering field indicated by the first filtering condition.
16. The method according to claim 11, characterized in that The device identification of the first device includes a first beacon ID, and the first application stores a correspondence between the first beacon ID and a second preset function; The main processor executes a second preset function based on the device identification of the first device, including: The first application in the main processor executes the second preset function corresponding to the first beacon ID according to the corresponding relationship.
17. The method according to claim 16, characterized in that The first filtering condition indicates the first beacon ID of the first device; The first message matches the first filtering condition, including: a beacon ID carried by the first message is the first beacon ID.
18. A terminal device, characterized in that: The method comprises a memory and a processor, wherein the memory and the processor are electrically coupled, the memory is used to store program instructions, and the processor is configured to call all or part of the program instructions stored in the memory to execute the method according to any one of claims 1 to 17.
19. A computer storage medium, characterized in that: The method comprises computer instructions, which, when executed on a terminal device, cause the terminal device to execute the method according to any one of claims 1 to 17.
Citation Information
Cited By
Near-field scanning method and related apparatus
EP4648495A1
Near-field scanning method and related apparatus
WO2024240191A1
