Patent Description:
<CIT> describes that a secure short-distance-based communication and access control system controls access to a restricted area. It is described that a run-time mobile device identifier and keys that may be location-specific, device-specific and time-specific are generated and utilized for secure communication between mobile devices and zone computers, and that the zone computers can validate users via their mobile devices to allow or deny access to the restricted area.

<CIT> describes a method to identify and/or authenticate the user of a mobile equipment in a restricted area, comprising the steps where:a beacon sends a first wireless signal to the mobile equipment; the mobile equipment detects a unique identifier in said first wireless signal; in response to said first wireless signal, the mobile equipment launches an application;the mobile equipment simultaneously sends a second wireless signal to a plurality of receivers; a gateway determines the location of said mobile equipment, based on differences in signals received by said receivers; an authorization access is granted that depends on said location.

With continuous development of a Bluetooth function on an electronic device, the Bluetooth function on the electronic device is more widely applied in a user's life. The Bluetooth function on the electronic device may be used in scenarios such as unlocking a vehicle lock and assisting another device in performing facial payment, to bring convenience to the user.

For example, the Bluetooth function is used to unlock the vehicle lock. The user may start an application, corresponding to a vehicle key, on the electronic device and a Bluetooth scanning function on the electronic device. After a processor of the electronic device obtains, through scanning and by using a Bluetooth chip, a device identifier corresponding to a vehicle, the vehicle may perform security verification on the application corresponding to the vehicle key. If the verification succeeds, the vehicle lock is unlocked.

In the foregoing process of unlocking the vehicle lock by using the Bluetooth function, a real-time operation of the user is required. This reduces convenience. In addition, if the processor in the electronic device keeps monitoring a scanning result of the device identifier of the vehicle for a long time, power consumption and memory usage of the electronic device are significantly increased.

The following describes accompanying drawings used in embodiments of this application.

Terms used in implementations of the embodiments this application are merely intended to explain specific embodiments of this application, and are not intended to limit this application.

First, application scenarios related to the embodiments of this application are described. A Bluetooth function is more widely used in imperceptible services. The imperceptible services include imperceptible vehicle lock unlocking, imperceptible payment, and the like. With reference to a system architecture, the following separately uses application scenarios of the imperceptible vehicle lock unlocking and the imperceptible payment as examples to provide descriptions.

It may be understood that the embodiments of this application are not limited to the foregoing application scenarios, and may further include a service process implemented by using another Bluetooth function, for example, a Bluetooth electronic scale. This is not limited in the embodiments of this application.

<FIG> is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown in <FIG>, the Bluetooth system includes an electronic device <NUM> and a Bluetooth device <NUM> (for example, a vehicle <NUM>). The vehicle <NUM> may broadcast a Bluetooth broadcast signal. In a process in which a user carries the electronic device <NUM> and moves close to the vehicle <NUM>, the electronic device <NUM> may receive the Bluetooth broadcast signal. An application (application, APP) corresponding to the vehicle <NUM> may be installed on the electronic device <NUM>. The APP on the electronic device <NUM> may establish a communication connection to the vehicle by using the Bluetooth broadcast signal, and complete security verification. After the security verification succeeds, a vehicle lock of the vehicle <NUM> is automatically unlocked. In the foregoing process of unlocking the vehicle lock of the vehicle <NUM>, the vehicle lock of the vehicle <NUM> can be unlocked imperceptibly and automatically without the user manually operating the APP on the electronic device <NUM>.

The following describes the electronic device <NUM> in the Bluetooth system in this embodiment of this application. <FIG> is a schematic diagram of a structure of the electronic device <NUM> according to an embodiment of this application.

The electronic device <NUM> may include a processor <NUM>, an external memory interface <NUM>, an internal memory <NUM>, a universal serial bus (universal serial bus, USB) port <NUM>, a charging management module <NUM>, a power management module <NUM>, a battery <NUM>, an antenna <NUM>, an antenna <NUM>, a mobile communications module <NUM>, a wireless communications module <NUM>, an audio module <NUM>, a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module <NUM>, a button <NUM>, a motor <NUM>, an indicator <NUM>, a camera <NUM>, a display <NUM>, a subscriber identification module (subscriber identification module, SIM) card interface <NUM>, and the like. The sensor module <NUM> may include a pressure sensor 180A, a gyro sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, an optical proximity sensor <NUM>, a fingerprint sensor <NUM>, a temperature sensor 180J, a touch sensor <NUM>, an ambient light sensor <NUM>, a bone conduction sensor <NUM>, and the like.

It may be understood that the structure shown in this embodiment of the present invention does not constitute a specific limitation on the electronic device <NUM>. In some other embodiments of this application, the electronic device <NUM> may include more or fewer components than those shown in the figure, or some components may be combined, or some components may be split, or there may be a different component layout. The components shown in the figure may be implemented by hardware, software, or a combination of software and hardware.

The processor <NUM> may include one or more processing units.

A memory may further be disposed in the processor <NUM>, and is configured to store instructions and data. In some embodiments, the memory in the processor <NUM> is a cache memory. The memory may store instructions or data just used or cyclically used by the processor <NUM>. If the processor <NUM> needs to use the instructions or the data again, the processor <NUM> may directly invoke the instructions or the data from the memory, to avoid repeated access and reduce a waiting time of the processor <NUM>, thereby improving system efficiency.

The charging management module <NUM> is configured to receive a charging input from a charger.

The power management module <NUM> is configured to connect to the battery <NUM>, the charging management module <NUM>, and the processor <NUM>. The power management module <NUM> receives an input from the battery <NUM> and/or the charging management module <NUM>, and supplies power to the processor <NUM>, the internal memory <NUM>, an external memory, the display <NUM>, the camera <NUM>, the wireless communications module <NUM>, and the like.

A wireless communication function of the electronic device <NUM> may be implemented through the antenna <NUM>, the antenna <NUM>, the mobile communications module <NUM>, the wireless communications module <NUM>, a modem processor, a baseband processor, and the like.

The antenna <NUM> and the antenna <NUM> are configured to transmit and receive electromagnetic wave signals. Each antenna in the electronic device <NUM> may be configured to cover one or more communications frequency bands.

The mobile communications module <NUM> may provide a solution that is applied to the electronic device <NUM> and that includes wireless communications technologies such as <NUM>, <NUM>, <NUM>, and <NUM>. The mobile communications module <NUM> may include at least one filter, a switch, a power amplifier, a low noise amplifier (low noise amplifier, LNA), and the like. The mobile communications module <NUM> may receive an electromagnetic wave through the antenna <NUM>, perform processing such as filtering or amplification on the received electromagnetic wave, and transmit a processed electromagnetic wave to the modem processor for demodulation. The mobile communications module <NUM> may further amplify a signal modulated by the modem processor, and convert the signal into an electromagnetic wave for radiation through the antenna <NUM>.

The wireless communications module <NUM> may provide wireless communication solutions applied to the electronic device <NUM>, including a wireless local area network (wireless local area network, WLAN) (for example, a wireless fidelity (wireless fidelity, Wi-Fi) network), Bluetooth (Bluetooth, BT), a global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), a near field communication (near field communication, NFC) technology, an infrared (infrared, IR) technology, and the like. The wireless communications module <NUM> may be one or more components integrating at least one communications processor module. The wireless communications module <NUM> receives an electromagnetic wave through the antenna <NUM>, performs frequency modulation and filtering processing on an electromagnetic wave signal, and sends a processed signal to the processor <NUM>.

The wireless communications module <NUM> includes a Bluetooth chip <NUM> provided in the embodiments of this application, namely, a Bluetooth chip <NUM> shown in any one of <FIG> and <FIG>.

In some embodiments, the antenna <NUM> of the electronic device <NUM> is coupled to the mobile communications module <NUM>, and the antenna <NUM> is coupled to the wireless communications module <NUM>, so that the electronic device <NUM> may communicate with a network and another device by using a wireless communications technology.

The electronic device <NUM> implements a display function through a GPU, the display <NUM>, an application processor, and the like. The GPU is a microprocessor for image processing, and connects the display <NUM> to the application processor.

The display <NUM> is configured to display an image, a video, and the like.

The electronic device <NUM> may implement a photographing function through an ISP, the camera <NUM>, a video codec, the GPU, the display <NUM>, the application processor, and the like.

The ISP is configured to process data fed back by the camera <NUM>.

The camera <NUM> is configured to capture a static image or a video. An optical image of an object is generated through a lens, and is projected onto a photosensitive element. The photosensitive element converts an optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert the electrical signal into a digital image signal.

The external memory interface <NUM> may be configured to connect to an external memory card, for example, a micro SD card, to extend a storage capability of the electronic device <NUM>. The external storage card communicates with the processor <NUM> through the external memory interface <NUM>, to implement a data storage function.

The internal memory <NUM> may be configured to store computer-executable program code. The executable program code includes instructions. The processor <NUM> runs the instructions stored in the internal memory <NUM> to perform various function applications of the electronic device <NUM> and process data. The internal memory <NUM> may include a program storage area and a data storage area.

The electronic device <NUM> may implement an audio function, for example, music playing and recording, through the audio module <NUM>, the speaker 170A, the receiver 170B, the microphone 170C, the headset jack 170D, the application processor, and the like.

The electronic device <NUM> may also include various types of sensors.

A software system of the electronic device <NUM> may use a layered architecture, an event-driven architecture, a microkernel architecture, a micro service architecture, or a cloud architecture. In this embodiment of the present invention, an Android system with the layered architecture is used as an example to illustrate a software structure of the electronic device <NUM>.

<FIG> is a block diagram of the software structure of the electronic device <NUM> according to an embodiment of this application.

In a layered architecture, software is divided into several layers, and each layer has a clear role and task. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, namely, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.

As shown in <FIG>, the application package may include applications such as "camera", "gallery", "calendar", "phone", "maps", "navigation", "WLAN", "Bluetooth", "music", "videos", and "messages".

The application framework layer may further include a Bluetooth agent module <NUM> provided in the embodiments of this application, namely, a Bluetooth agent module <NUM> in any one of examples shown in <FIG> and <FIG>. The Bluetooth agent module <NUM> may be an application/interface at the application framework layer.

The window manager is configured to manage a window program. The window manager may obtain a size of a display, determine whether there is a status bar, perform screen locking, take a screenshot, and the like.

The content provider is configured to store and obtain data, and enable the data to be accessed by an application. The data may include a video, an image, audio, calls that are made and received, a browsing history and bookmarks, an address book, and the like.

The view system includes a visual control such as a text display control, or a picture display control. The view system may be configured to construct an application. A display interface may include one or more views.

The phone manager is configured to provide a communication function of the electronic device <NUM>, for example, management of a call status (including answering or declining).

The resource manager provides various resources for an application, such as a localized character string, an icon, a picture, a layout file, and a video file.

The notification manager enables the application to display notification information in the status bar, and may be configured to convey a notification message. The notification manager may automatically disappear after a short pause without a user interaction. For example, the notification manager is configured to notify download completion, give a message notification, and the like. The notification manager may alternatively be a notification that appears in a top status bar of the system in a form of a graph or a scroll bar text.

The Bluetooth agent module <NUM> is configured to indicate a Bluetooth chip to scan for a device identifier. The Bluetooth agent module is further configured to establish a channel to an external Bluetooth device based on a first device identifier, or notify an application corresponding to an external Bluetooth device identifier.

The kernel library includes two parts: a function that needs to be called by a java language and a kernel library of Android.

The application layer and the application framework layer run on the virtual machine.

The system library may include a plurality of function modules, for example, a surface manager (surface manager), a media library (Media Library), a three-dimensional graphics processing library (for example, OpenGL ES), and a 2D graphics engine (for example, SGL).

The following describes a process of starting the vehicle <NUM> in the scenario shown in <FIG> with reference to structures of the electronic device <NUM> and the vehicle <NUM>. <FIG> is a schematic diagram of an architecture of a Bluetooth system according to the conventional technology. As shown in <FIG>, the electronic device <NUM> may establish a communication connection to the vehicle <NUM>, and the communication connection may be a Bluetooth connection. Specifically, in the scenario shown in <FIG>, in the process in which the user carries the electronic device <NUM> and moves close to the vehicle <NUM>, the electronic device <NUM> establishes the Bluetooth communication connection to the vehicle <NUM>.

As shown in <FIG>, the electronic device <NUM> includes a Bluetooth chip <NUM>, an APP <NUM>, an open mobile alliance application programming interface (open mobile alliance application programming interface, OMAAPI) <NUM>, and a secure element (secure element, SE) <NUM>. The SE <NUM> includes an applet (applet). The vehicle <NUM> includes an in-vehicle Bluetooth chip <NUM> and an in-vehicle SE <NUM>. The in-vehicle SE <NUM> includes an in-vehicle applet. The OMA API <NUM> is an interface for invoking the applet in the SE by using a rich execution environment (rich execution environment, REE). Alternatively, the in-vehicle Bluetooth chip <NUM> and the in-vehicle SE <NUM> may be connected through an in-vehicle OMA API. The applet of the SE <NUM> may include a ciphertext for unlocking. The in-vehicle SE <NUM> also includes a ciphertext for unlocking. The ciphertext in the applet of the SE <NUM> is in a one-to-one correspondence with the ciphertext in the in-vehicle SE <NUM>.

For example, when a vehicle key service is enabled, a background server of a vehicle factory separately establishes a secure channel with the SE <NUM> of the electronic device <NUM> and the SE <NUM> of the vehicle <NUM>, and separately places the same ciphertext into the SE <NUM> and the SE <NUM>.

The Bluetooth chip <NUM> is connected to the APP <NUM>. The APP <NUM> establishes a connection to the SE <NUM> through the OMA API <NUM>. The in-vehicle Bluetooth chip <NUM> may continuously broadcast a Bluetooth broadcast signal. The Bluetooth chip <NUM> may detect the Bluetooth broadcast signal, and then detect whether the vehicle <NUM> from which the Bluetooth broadcast signal comes is a registered device. The following describes an implementation of detecting whether a device from which a Bluetooth broadcast signal comes is registered with the electronic device <NUM>. The Bluetooth chip <NUM> stores device identification information of the vehicle <NUM> (for example, a universally unique identifier (universally unique identifier, UUID) of the vehicle <NUM>). The Bluetooth broadcast signal broadcast by the in-vehicle Bluetooth chip <NUM> includes the device identification information of the vehicle <NUM>. After receiving the Bluetooth broadcast signal, the Bluetooth chip <NUM> detects that the device identification information of the vehicle <NUM> is stored in the Bluetooth chip <NUM>. In this case, the Bluetooth chip <NUM> determines that the device (the vehicle <NUM>) from which the Bluetooth broadcast signal comes is registered with the electronic device <NUM>.

In a possible implementation, vehicles of a same brand may have same device identification information, or vehicles of a same model may have same device identification information.

An application processor (application processor, AP) in the electronic device <NUM> may monitor a scanning result of the Bluetooth chip <NUM>. The Bluetooth chip <NUM> detects, through scanning, that the vehicle <NUM> is a device registered with the electronic device <NUM>. If the APP <NUM> on the electronic device <NUM> is in a running state, the vehicle <NUM> establishes a communication channel to the APP <NUM> on the electronic device <NUM>. The communication channel may be used for communication between the in-vehicle Bluetooth chip <NUM> and the APP <NUM> in a service execution process.

It may be understood that the ciphertext in the electronic device <NUM> is not limited to being stored in the applet of the SE <NUM>, and may alternatively be stored in another secure storage area, for example, stored in an application (trusted execution environment application, TA) in a trusted execution environment (trusted execution environment, TEE). In this case, a Bluetooth agent module <NUM> may establish a channel to the vehicle <NUM>. The Bluetooth agent module <NUM> may obtain service information from the TEE, and send the service information to the vehicle <NUM> through the channel.

The vehicle <NUM> may send a ciphertext verification instruction to the electronic device <NUM> through the Bluetooth channel. After receiving the ciphertext verification instruction, the electronic device <NUM> sends the ciphertext in the applet of the SE <NUM> to the vehicle <NUM> through the Bluetooth connection. The vehicle <NUM> compares the received ciphertext with the ciphertext in the in-vehicle SE <NUM>. If the comparison succeeds (for example, if the two ciphertexts are the same, the comparison succeeds), the vehicle lock of the vehicle <NUM> is unlocked.

In the foregoing process of unlocking the vehicle lock of the vehicle <NUM>, the user needs to manually start the APP <NUM> and turn on a Bluetooth scanning switch. This reduces convenience of unlocking the lock of the vehicle <NUM>. In addition, the AP in the electronic device <NUM> needs to monitor the scanning result of the Bluetooth chip <NUM>. This increases power consumption and memory usage of the electronic device <NUM>.

The following describes a scenario of imperceptible payment in the embodiments of this application. <FIG> is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown in <FIG>, the Bluetooth system includes an electronic device <NUM>, a Bluetooth device <NUM> (for example, a payment device <NUM>), and a server <NUM>.

The electronic device <NUM> may establish a communication connection to the server <NUM>, and the payment device <NUM> may establish a communication connection to the server <NUM>. The payment device <NUM> may broadcast a Bluetooth broadcast signal. When a user carries the electronic device <NUM> and moves close to the payment device <NUM>, the electronic device <NUM> may receive the Bluetooth broadcast signal. An APP corresponding to the payment device <NUM> may be installed on the electronic device <NUM>. For example, if the APP is WeChat, the server <NUM> is a WeChat server. When payment is required, the user faces the payment device <NUM>, and the payment device <NUM> collects a facial image, and uploads the facial image to the server <NUM>. The server <NUM> may complete facial verification of the user, and automatically complete a payment service process. In the foregoing facial payment process, imperceptible payment may be implemented without the user manually operating the APP on the electronic device <NUM>.

The following describes a process of imperceptible payment in a scenario shown in <FIG> with reference to structures of the electronic device <NUM> and the payment device <NUM>. <FIG> is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown in <FIG>, the electronic device <NUM> includes a Bluetooth chip <NUM> and an APP <NUM>. The Bluetooth chip <NUM> is connected to the APP <NUM>. The payment device <NUM> may continuously broadcast the Bluetooth broadcast signal.

<FIG> is a schematic flowchart of a service transaction method according to the conventional technology. As shown in <FIG>, based on system architectures described in <FIG> and <FIG>, the service transaction method includes steps S101 to S108.

S101: The payment device <NUM> broadcasts the Bluetooth broadcast signal.

The Bluetooth broadcast signal carries device identity information and device identification information (for example, a UUID). For example, the device identity information may include a device ID. The device ID may uniquely identify the payment device <NUM>. The UUID may identify a payment device that can connect the APP <NUM> and the server <NUM>. For example, for an Alipay application, payment devices that can connect the Alipay application and an Alipay server have a same UUID, and the UUID may be stored in the Bluetooth chip <NUM>. Alternatively, a UUID of a payment device that can connect the Alipay application to the Alipay server is one of several UUIDs. The several UUIDs may be stored in the Bluetooth chip <NUM>.

S102: The Bluetooth chip <NUM> receives the Bluetooth broadcast signal from the payment device <NUM>, and detects whether the device (the payment device <NUM>) from which the Bluetooth broadcast signal comes is registered with the electronic device <NUM>.

For Bluetooth scanning (to be specific, detecting whether a device from which a Bluetooth broadcast signal comes is registered with the electronic device <NUM>), refer to the specific description in the example described in <FIG>. The Bluetooth chip <NUM> may be a Bluetooth low energy (Bluetooth low energy, BLE) chip. In this case, the Bluetooth chip <NUM> can perform step S102 only when a Bluetooth scanning switch on the electronic device <NUM> is turned on.

S103: An application processor of the electronic device <NUM> monitors the Bluetooth chip <NUM>, and runs the APP <NUM> when detecting that the device (the payment device <NUM>) from which the Bluetooth broadcast signal comes is registered with the electronic device <NUM>.

After detecting that the device from which the Bluetooth broadcast signal comes is registered, the application processor may detect whether the APP <NUM> is run. If the APP <NUM> is not run, step S104 is performed to run the APP <NUM>. For a system with a release later than Android <NUM>, the AP of the electronic device <NUM> may automatically run the APP <NUM> by performing step S <NUM>.

S104: The APP <NUM> sends a message carrying the device identity information and an account ID to the server <NUM>.

The APP may send a message carrying the device ID and the account ID to the server <NUM>. The device ID may be obtained by the Bluetooth chip <NUM> from the Bluetooth broadcast signal and sent to the APP <NUM>. The server <NUM> may obtain one or more account IDs that can receive the Bluetooth broadcast signal from the payment device <NUM>. For example, there are currently <NUM> electronic devices near the payment device <NUM>, the Alipay application is installed on each of the <NUM> electronic devices, and an imperceptible payment service is enabled. Each of the Alipay applications on the <NUM> electronic devices has an Alipay account ID (for example, an Alipay account). In this case, for each of the <NUM> electronic devices, service information (for example, device identity information) from an external Bluetooth device <NUM> may be transmitted to the APP <NUM> by using steps S101 to S104, and the APP <NUM> transmits the service information to the server <NUM>. The server <NUM> may obtain the Alipay account ID on each of the <NUM> electronic devices. In steps S105 to S108, facial comparison is performed to determine which Alipay account ID to execute a transaction process.

S105: The payment device <NUM> collects a facial image.

S106: The payment device <NUM> sends the collected facial image and the device ID to the server <NUM>.

The device ID is in a one-to-one correspondence with the payment device <NUM>.

S107: The server <NUM> obtains an account ID through recognition based on the received facial image and device ID.

After receiving the facial image and the device ID, the server <NUM> may determine, based on the device ID, an account ID of the uploaded service information (for example, the device identity information). For example, in the foregoing example, the server <NUM> may determine <NUM> Alipay account IDs based on device IDs to upload service information (for example, device identity information) to the server <NUM> through the payment device <NUM>. The server <NUM> may obtain a facial image corresponding to each of the <NUM> Alipay account IDs. Then, the facial image received from the payment device <NUM> is compared with the <NUM> facial images, to obtain an Alipay account ID corresponding to the received facial image.

The server <NUM> may store an account ID and a corresponding facial image, and the facial image may be prestored by the user. The facial image corresponding to the account may alternatively be obtained by the server <NUM> from another device (for example, the electronic device <NUM>). This is not limited in this embodiment of this application.

S108: The server <NUM> completes a service transaction based on the account ID.

The server <NUM> may use the account ID obtained in step S107 as a deduction account to complete the service transaction.

In the foregoing process of imperceptible payment, in step S102, the application processor of the electronic device <NUM> needs to be always in a working state in a Bluetooth scanning process, to monitor whether a device from which a Bluetooth broadcast signal comes is registered with the electronic device <NUM>. This increases power consumption and memory usage of the electronic device <NUM>. In addition, the Bluetooth scanning switch, on the electronic device <NUM>, that is used to start Bluetooth scanning is turned off by default. This affects Bluetooth scanning, and reduces convenience of the payment process.

The embodiments of this application provide a service execution method, to improve convenience of a service execution process, and reduce power consumption and memory usage of the electronic device <NUM>. The electronic device <NUM> involved in the service execution method includes a Bluetooth agent (Bluetooth agent) module. <FIG> is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown in <FIG>, the Bluetooth system includes an electronic device <NUM>, a Bluetooth device <NUM> (for example, a vehicle or a payment device), and a server <NUM>.

As shown in <FIG>, the electronic device <NUM> includes a Bluetooth chip <NUM>, an APP <NUM>, an OMA API <NUM>, an SE <NUM>, a Bluetooth agent module <NUM>, a TEE <NUM>, an APP <NUM>, and an APP <NUM>. The APP <NUM> and the APP <NUM> may be different service applications (for example, one is a payment application and the other is an application associated with a vehicle <NUM>). Each of the APP <NUM> and the APP <NUM> corresponds to a Bluetooth device. For example, the APP <NUM> corresponds to a Bluetooth device <NUM>, and the APP <NUM> corresponds to a Bluetooth device <NUM>.

In this embodiment of this application, an application on which permission verification is performed during installation and an application participating in a service execution process may be the same APP or different APPs. If the APPs are different, the APP participating in the service execution process is connected to the server <NUM> and the Bluetooth agent module.

There may be a plurality of Bluetooth devices corresponding to the APP <NUM>. Device identification information of a Bluetooth device is stored in the Bluetooth agent module <NUM> and the Bluetooth chip <NUM>, and the Bluetooth device corresponds to one APP on the electronic device <NUM>. There may also be a plurality of Bluetooth devices corresponding to the APP <NUM>. For example, an Alipay application may correspond to a plurality of payment devices, and the service execution process may be completed on the plurality of payment devices.

For descriptions of the Bluetooth chip <NUM>, the OMAAPI <NUM>, the SE <NUM>, and the TEE <NUM>, refer to the example shown in <FIG>. For the APP <NUM>, the APP <NUM>, and the server <NUM>, refer to the example shown in <FIG>.

This embodiment of this application is described by using an example in which the APP <NUM> is a payment application and the Bluetooth device <NUM> is a payment device corresponding to the APP <NUM>, and an example in which the APP <NUM> is a vehicle application and the Bluetooth device <NUM> is a vehicle corresponding to the APP <NUM>.

The Bluetooth agent module <NUM> is connected to the APP <NUM>. The Bluetooth agent module <NUM> is further connected to the TEE <NUM>, and the Bluetooth agent module <NUM> is further connected to the SE <NUM> through the OMA API <NUM>.

In a vehicle lock unlocking scenario, the Bluetooth agent module <NUM> is started when the Bluetooth chip <NUM> detects that a device from which a Bluetooth broadcast signal comes is registered with the electronic device <NUM>. The Bluetooth agent module <NUM> may establish a channel to an external Bluetooth device, and the Bluetooth agent module <NUM> is connected to the SE <NUM>, so that service information (for example, a ciphertext) in the SE <NUM> may be transmitted to the external Bluetooth device (for example, a vehicle). The Bluetooth agent module <NUM> is further connected to the TEE <NUM>, so that service information (for example, a ciphertext) in the TEE <NUM> may also be transmitted to the external Bluetooth device (for example, the vehicle).

In a payment scenario, the Bluetooth chip <NUM> is connected to the Bluetooth agent module <NUM>, the Bluetooth agent module <NUM> is connected to the APP <NUM>, and the APP <NUM> establishes a communication connection to the server <NUM>. The Bluetooth device <NUM> establishes a communication connection to the server <NUM>. In this service method, when the Bluetooth chip <NUM> obtains a first device identifier in device identifiers through scanning, the Bluetooth chip <NUM> notifies the Bluetooth agent module <NUM>. The Bluetooth agent module <NUM> may wake up the APP <NUM>, and service information (for example, a device ID of the Bluetooth device <NUM>) from the external Bluetooth device <NUM> may be transmitted to the APP <NUM>. The APP <NUM> establishes the communication connection to the server <NUM>, so that the service information (for example, the device ID of the Bluetooth device <NUM>) from the external Bluetooth device <NUM> is transmitted to the server <NUM>. The server <NUM> may complete a service based on the service information transmitted from the APP <NUM> and user information (for example, a facial image) collected from the Bluetooth device <NUM>. A device identifier stored in the Bluetooth chip <NUM> is a device identifier corresponding to an application on which verification succeeds. In other words, verification on an application, corresponding to the first device identifier, on the electronic device <NUM> succeeds.

The Bluetooth agent module <NUM> is started only when the Bluetooth chip <NUM> obtains the first device identifier in the device identifiers through scanning. The Bluetooth agent module <NUM> and an application processor in the electronic device <NUM> do not need to be always in a working state, to reduce power consumption and memory usage of the electronic device <NUM>.

In this embodiment of this application, the Bluetooth agent module may run the APP, and a user does not need to manually run the APP. In this way, an execution process is imperceptible to the user, and convenience of the service execution process is improved.

In this embodiment of this application, the Bluetooth agent module <NUM> may run the APP <NUM>, but the APP <NUM> does not need to be always run on the electronic device <NUM>, and the APP <NUM> may be stopped running by the application processor, to further reduce power consumption and memory usage of the electronic device <NUM>.

In this embodiment of this application, the Bluetooth agent module <NUM> further provides a Bluetooth scanning management platform for a Bluetooth-related service execution process.

The Bluetooth agent module <NUM> is connected to the SE <NUM>, and directly establishes a Bluetooth channel between the Bluetooth chip <NUM> and a Bluetooth device <NUM> without running the APP <NUM>, to further reduce power consumption and memory usage of the electronic device <NUM>.

Optionally, the APP <NUM> may further be connected to the TEE <NUM>. In this case, the Bluetooth agent module <NUM> may wake up the APP <NUM>. The APP <NUM> may obtain the service information (for example, the ciphertext) from the TEE <NUM> and transmit the service information to the Bluetooth agent module <NUM>. The Bluetooth agent module <NUM> establishes the channel to the external Bluetooth device, and sends the service information to the external Bluetooth device (for example, the vehicle). The external Bluetooth device may execute a corresponding service, for example, unlock a vehicle key, based on the service information.

Optionally, the APP <NUM> may further be connected to the SE <NUM> through an OMA API. In this case, the Bluetooth agent module <NUM> may wake up the APP <NUM>, and the APP <NUM> may obtain the service information (for example, the ciphertext) from the SE <NUM> and transmit the service information to the Bluetooth agent module <NUM>. The Bluetooth agent module <NUM> establishes the channel to the external Bluetooth device (for example, the vehicle), and sends the service information to the external Bluetooth device (for example, the vehicle). The external Bluetooth device may execute a corresponding service, for example, unlock the vehicle key, based on the service information.

The following describes examples of the service execution method provided in the embodiments of this application. Examples of service execution processes in the following scenarios are separately described: (<NUM>) imperceptible facial payment; (<NUM>) imperceptible vehicle lock unlocking; and (<NUM>) automatically uploading data of a weight scale.

This service execution method is based on the system architecture described in <FIG>. For example, the service execution process is to perform imperceptible facial payment. A Bluetooth device <NUM> may be the payment device <NUM> shown in <FIG>. It may be understood that in this embodiment of this application, the scenario of imperceptible facial payment is used as an example for description, and another service scenario may alternatively be used. This is not limited in this embodiment of this application.

<FIG> is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown in <FIG>, the Bluetooth system includes an electronic device <NUM>, the Bluetooth device <NUM> (for example, the payment device <NUM>), and a server <NUM>. As shown in <FIG>, the electronic device <NUM> includes a Bluetooth chip <NUM>, a Bluetooth agent module <NUM>, and an APP <NUM>. The Bluetooth chip <NUM> establishes a connection to the Bluetooth agent module <NUM>, and the Bluetooth agent module <NUM> establishes a connection to the APP <NUM>.

Before the system architecture is used to perform imperceptible facial payment, a user needs to install the APP <NUM> on the electronic device <NUM>, and the electronic device <NUM> completes a registration process. The following processes are separately described: (a) the registration process; (b) a transaction process; and (c) a deregistration process.

The following describes the registration process with reference to the system architecture shown in <FIG> and a process shown in <FIG> is a schematic flowchart of the registration process of the APP <NUM> according to an embodiment of this application. The registration process of the APP <NUM> includes steps S201 to S206.

S201: When the APP <NUM> is installed on the electronic device <NUM>, the APP <NUM> sends first registration information to the Bluetooth agent module <NUM>.

The first registration information may include one or more of the following:.

S202: The Bluetooth agent module <NUM> performs permission verification on the APP <NUM> based on the first registration information.

In a possible implementation, the Bluetooth agent module <NUM> may store APP_IDs of a plurality of APPs, and the plurality of APP_IDs are approved by the Bluetooth agent module <NUM>. The Bluetooth agent module <NUM> detects whether an APP_ID in the first registration information is included in the stored plurality of APP_IDs. If the APP_ID in the first registration information is included in the stored plurality of APP_IDs, the permission verification succeeds, and step S203 is performed. If the APP_ID in the first registration information is not included in the stored plurality of APP_IDs, the permission verification fails, and the process ends.

It may be understood that the foregoing example of the permission verification process is merely used to explain this embodiment of this application, and should not constitute a limitation. The Bluetooth agent module <NUM> may alternatively have another permission verification method. This is not limited in this embodiment of this application.

In this embodiment of this application, the Bluetooth agent module <NUM> may be located at an application framework layer in the example shown in <FIG>, and may be an application/interface at the application framework layer. The Bluetooth agent module <NUM> is not limited to being located at the application framework layer, and may be located at another layer.

S203: When the permission verification succeeds, the Bluetooth agent module <NUM> sends the first device identification information to the Bluetooth chip <NUM>.

The Bluetooth chip <NUM> may store the device identification information whose permission verification succeeds. For example, permission verification performed by the Bluetooth agent module <NUM> on an APP <NUM> succeeds, and registration information of the APP <NUM> includes a UUID <NUM>, a UUID <NUM>, a UUID <NUM>, and a UUID <NUM>. Permission verification performed by the Bluetooth agent module <NUM> on an APP <NUM> succeeds, and registration information of the APP <NUM> includes a UUID <NUM> and a UUID <NUM>. In this case, the Bluetooth chip <NUM> may receive and store the UUID <NUM>, the UUID <NUM>, the UUID <NUM>, the UUID <NUM>, the UUID <NUM>, and the UUID <NUM>.

It may be understood that in this embodiment of this application, an example in which the device identification information is a UUID is used for description. However, the device identification information is not limited to the UUID, and may alternatively be other device information.

In a possible implementation, when the permission verification succeeds, the Bluetooth agent module <NUM> stores the first registration information of the APP <NUM>. The Bluetooth agent module <NUM> may find, by using the first registration information and a UUID that is obtained by the Bluetooth chip <NUM> through scanning, a corresponding APP, TA, or applet.

S204: The Bluetooth agent module <NUM> detects whether a Bluetooth scanning function of the Bluetooth chip <NUM> is enabled.

When the Bluetooth scanning function of the Bluetooth chip <NUM> is enabled, the Bluetooth chip <NUM> may receive a Bluetooth broadcast signal, and detect whether device identification information carried in the Bluetooth broadcast signal is stored in the Bluetooth chip <NUM>. When the Bluetooth scanning function of the Bluetooth chip <NUM> is disabled, the Bluetooth chip <NUM> cannot receive a Bluetooth broadcast signal.

S205: When detecting that the Bluetooth scanning function of the Bluetooth chip <NUM> is not enabled, the Bluetooth agent module <NUM> enables the Bluetooth scanning function.

For example, if the Bluetooth chip <NUM> is a BLE Bluetooth chip, EnableBLE may be invoked to enable the Bluetooth scanning function.

<FIG>, <FIG>, and <FIG> are schematic diagrams of an application interface according to an embodiment of this application. An application interface <NUM> is an application interface in a system setting application. As shown in <FIG>, the application interface <NUM> includes a Bluetooth scanning switch <NUM>, a Bluetooth scanning prompt <NUM>, a WLAN scanning switch <NUM>, and a WLAN scanning prompt <NUM>.

When the Bluetooth scanning switch <NUM> is in an on state, the Bluetooth scanning function is enabled. When the Bluetooth scanning switch <NUM> is in an off state, the Bluetooth scanning function is disabled. When the Bluetooth scanning switch <NUM> is in the off state, the Bluetooth scanning switch <NUM> may be changed to the on state by using step S105, to enable the Bluetooth scanning function.

As shown in <FIG>, the Bluetooth scanning prompt <NUM> prompts that an application and a service are allowed to scan for a nearby device at any time, even if Bluetooth is disabled. This may be used to improve a location-based feature and service. When Bluetooth is disabled and the Bluetooth scanning switch <NUM> is turned on, the Bluetooth chip <NUM> can still perform scanning in step S206.

When the WLAN scanning switch <NUM> is in an on state, a WLAN scanning function is enabled. When the WLAN scanning switch <NUM> is in an off state, the WLAN scanning function is disabled. The WLAN scanning prompt <NUM> prompts that an application and a service are allowed to scan for a WLAN network at any time, even if the WLAN is disabled. This may be used to improve a location-based feature and service.

S206: The Bluetooth chip <NUM> performs scanning.

In the scanning process, the Bluetooth chip <NUM> may receive a Bluetooth broadcast signal, and detect whether a UUID carried in the Bluetooth broadcast signal is stored in the Bluetooth chip <NUM>.

By using steps S201 to S206, registration of the APP <NUM> on the electronic device <NUM> is completed. After the registration is completed, the electronic device <NUM> may log in to an account on the APP <NUM> in response to a user operation. For example, for an Alipay application, after registration is completed, the electronic device <NUM> may log in to an Alipay account on the Alipay application in response to a user operation. The Alipay account may be an account ID of the Alipay application on the electronic device <NUM>. In a process of logging in to the account, for example, an account password corresponding to the account ID needs to be verified.

In some possible implementations, a setting interface on the electronic device <NUM> may include a setting entry of the Bluetooth agent module. As shown in <FIG> <FIG>, a setting interface <NUM> includes a setting entry <NUM> of the Bluetooth agent module. In response to a user operation performed by the user on the setting entry <NUM> of the Bluetooth agent module, for example, a tapping operation, the electronic device <NUM> displays a Bluetooth agent module setting interface <NUM>. As shown in <FIG>, the Bluetooth agent module setting interface <NUM> includes a Bluetooth agent module switch <NUM>, a switch indication <NUM>, and a list <NUM> of registered applications. Details are as follows:.

In response to a tap operation performed by the user on the Bluetooth agent module switch <NUM>, the Bluetooth agent module may perform permission verification on the application to complete application registration, that is, perform steps S201 to S206.

The switch indication <NUM> may indicate a function of the Bluetooth agent module switch <NUM>. To be specific, after the switch is turned on, the Bluetooth agent module is allowed to verify an identity of an installed application, so that the application is enabled to implement imperceptible payment, imperceptible vehicle lock unlocking, and the like.

The list <NUM> of registered applications may include an identifier of an application that is registered with the electronic device <NUM> by using steps S201 to S206. For example, the list <NUM> of registered applications includes an Alipay identifier <NUM> and a Bluetooth vehicle key identifier <NUM>. Optionally, application identifiers in the list <NUM> of registered applications may be classified and displayed based on an application category, for example, classified as a payment application and another application.

After registration is completed and the account is logged in to, the electronic device <NUM> may perform the service execution method according to the embodiments of this application. <FIG> and <FIG> are a schematic flowchart of a service transaction method according to an embodiment of this application. The service transaction method is based on the system architecture shown in <FIG>, and the service transaction method includes steps S301 to S310.

S301: The Bluetooth device <NUM> broadcasts a Bluetooth broadcast signal.

The Bluetooth broadcast signal may carry the first device identification information (for example, a first UUID) and first device identity information (for example, a first device ID). The first device identity information is in a one-to-one correspondence with the Bluetooth device <NUM>.

S302: The Bluetooth chip <NUM> receives the Bluetooth broadcast signal, and detects whether the device (the Bluetooth device <NUM>) from which the received Bluetooth broadcast signal comes is registered with the electronic device <NUM>.

When the electronic device <NUM> is in a sleep state (for example, the electronic device <NUM> is in a screen-off sleep state), if the Bluetooth chip <NUM> detects that the device from which the received Bluetooth broadcast signal comes is not registered with the electronic device <NUM>, the Bluetooth agent module <NUM> may be in a sleep state.

S303: When the device from which the received Bluetooth broadcast signal comes is registered with the electronic device <NUM>, the Bluetooth chip <NUM> wakes up the Bluetooth agent module <NUM>, and sends the first device identification information.

If the Bluetooth agent module <NUM> is already in a started state, the first device identification information can be sent to the Bluetooth agent module <NUM> without waking up the Bluetooth agent module <NUM>.

S304: The Bluetooth agent module <NUM> runs the APP <NUM> based on the first device identification information and the first registration information.

The Bluetooth agent module <NUM> stores the first registration information in step S203 in the registration process shown in <FIG>. The Bluetooth agent module <NUM> finds the first registration information by using the first device identification information, and finds and runs the APP <NUM> by using the APP_AWAKE_ID in the first registration information.

The ⑤ OPTION in the first registration information may indicate that a data receiving entity is the APP <NUM>, and the Bluetooth chip <NUM> wakes up the APP <NUM> after obtaining the first device identification information through scanning. The Bluetooth agent module <NUM> may further determine, based on the OPTION, that the APP <NUM> needs to be run. Then, the APP <NUM> is run by using the APP_AWAKE_ID in the first registration information.

Optionally, if the APP <NUM> is already in a running state, there is no need to run the APP <NUM>.

S305: The Bluetooth agent module <NUM> sends the first device identity information to the APP <NUM>.

The first device identity information may be sent by the Bluetooth chip <NUM> to the Bluetooth agent module <NUM> together with the first device identification information in step S303.

S306: The APP <NUM> sends, to the server <NUM>, a message carrying the first device identity information and a first account ID.

Steps S301 to S306 are performed, so that service information (for example, a device ID of the Bluetooth device <NUM>) from the external Bluetooth device <NUM> may be transmitted to the APP <NUM>, and the APP <NUM> sends the service information to the server <NUM> to prepare for a subsequent transaction process. The first account ID is an ID of a login account on the APP <NUM>. For example, the account ID of the Alipay APP may be an Alipay account.

After step S306, the user may execute the transaction process (for example, imperceptible facial payment) in a verification manner, for example, facial verification or fingerprint verification. For details, refer to steps S307 to S310. For steps S307 to S310, refer to descriptions of steps S105 to S108 in the example shown in <FIG>.

S307: The Bluetooth device <NUM> collects a first facial image.

S308: The Bluetooth device <NUM> sends, to the server <NUM>, a message carrying the first facial image and the first device identity information.

S309: The server <NUM> obtains the first account ID through recognition based on the first facial image and the first device identity information.

S310: The server <NUM> completes a service transaction based on the first account ID.

In the foregoing service transaction method process, the Bluetooth agent module <NUM> is started only after the device from which the Bluetooth broadcast signal received by the Bluetooth chip <NUM> comes is registered with the electronic device <NUM>. The Bluetooth agent module <NUM> and an application processor in the electronic device <NUM> do not need to be always in a working state, to reduce power consumption and memory usage of the electronic device <NUM>.

In this embodiment of this application, the Bluetooth agent module <NUM> may run the APP <NUM>, and the user does not need to manually run the APP <NUM>. In this way, the service transaction execution process is imperceptible to the user, and convenience of the service execution process is improved.

In this embodiment of this application, the Bluetooth agent module <NUM> further provides a Bluetooth scanning management platform for a Bluetooth-related service transaction process.

In a possible implementation, the Bluetooth scanning function in step S302 may be implemented by the user manually turning on the Bluetooth scanning switch <NUM>. Refer to <FIG>, <FIG>, and <FIG>. In another possible implementation, the Bluetooth scanning function may alternatively be enabled when the electronic device <NUM> detects that the Bluetooth scanning function is not enabled. For example, in the example of the registration process described in <FIG> and <FIG>, the Bluetooth agent module <NUM> enables the Bluetooth scanning function by performing steps S204 and S205. Alternatively, after registration is completed, the Bluetooth agent module <NUM> may automatically enable the Bluetooth scanning function in the service transaction process. The Bluetooth agent module <NUM> may enable the Bluetooth scanning function, so that the user does not need to manually enable the Bluetooth scanning function. In this way, the service transaction execution process is imperceptible to the user, and convenience of the service transaction process is improved.

The registered APP <NUM> on the electronic device <NUM> may further be deregistered in response to a user operation. The following specifically describes the deregistration process according to this embodiment of this application. <FIG> is a schematic flowchart of deregistration of the APP <NUM> according to an embodiment of this application. The deregistration process of the APP <NUM> includes steps S401 to S406.

S401: When detecting that the APP <NUM> is uninstalled, the Bluetooth agent module <NUM> sends a first notification to the Bluetooth chip <NUM>. The first notification indicates the Bluetooth chip <NUM> to stop scanning for the first device identification information.

The first device identification information is first device identification information included in the registration information of the APP <NUM> during registration. For example, the first device identification information included in the registration information of the APP <NUM> during registration is the UUID <NUM>, the UUID <NUM>, the UUID <NUM>, and the UUID <NUM>. In this case, the first notification indicates the Bluetooth chip <NUM> to stop scanning for the UUID <NUM>, the UUID <NUM>, the UUID <NUM>, and the UUID <NUM>. After step S402 is performed, when detecting that the Bluetooth broadcast signal includes the UUID <NUM>, the UUID <NUM>, the UUID <NUM>, and the UUID <NUM>, the Bluetooth chip <NUM> considers that the device from which the Bluetooth broadcast signal comes is not registered with the electronic device <NUM>, and does not wake up the Bluetooth agent module <NUM>.

In this embodiment of this application, the application processor may detect that the APP <NUM> is uninstalled, and broadcast a broadcast indicating that the APP <NUM> is uninstalled. The Bluetooth agent module <NUM> determines, based on the broadcast indicating that the APP <NUM> is uninstalled, that the APP <NUM> is detected to be uninstalled, and performs step S401.

S402: The Bluetooth chip <NUM> stops, based on the first notification, scanning for the first device identification information.

The Bluetooth chip <NUM> may delete the stored device identification information corresponding to the APP <NUM>. In the example of step S401, the Bluetooth chip <NUM> may delete the stored UUID <NUM>, UUID <NUM>, UUID <NUM>, and UUID <NUM>.

S403: The Bluetooth agent module <NUM> deletes the registration information of the APP <NUM>.

Step S403 may alternatively be performed before step S402.

After the deregistration process of the APP <NUM> is performed, when detecting that the Bluetooth broadcast signal includes the first device identification information, the Bluetooth chip <NUM> considers that the device from which the Bluetooth broadcast signal comes is not registered with the electronic device <NUM>. In addition, the Bluetooth agent module <NUM> is not woken up, and a Bluetooth channel is not established.

This service execution method is based on the system architecture described in <FIG>. For example, the service execution process is to imperceptibly unlock a vehicle lock. A Bluetooth device <NUM> may be the vehicle <NUM> shown in <FIG>. It may be understood that in this embodiment of this application, the scenario of imperceptible vehicle lock unlocking is used as an example for description, and another service scenario may alternatively be used. This is not limited in this embodiment of this application.

<FIG> is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown in <FIG>, the Bluetooth system includes an electronic device <NUM>, the Bluetooth device <NUM> (for example, the vehicle <NUM>), and a server <NUM>. As shown in <FIG>, the electronic device <NUM> includes a Bluetooth chip <NUM>, a Bluetooth agent module <NUM>, an APP <NUM>, an OMA API <NUM>, an SE <NUM>, and a TEE <NUM>. The Bluetooth system may include either the SE <NUM> that is connected to the OMA API <NUM> or the TEE <NUM>, or may include both the SE <NUM> and the TEE <NUM>. The Bluetooth chip <NUM> establishes a connection to the Bluetooth agent module <NUM>. The Bluetooth agent module <NUM> is connected to the TEE <NUM>, and the Bluetooth agent module <NUM> is connected to the SE <NUM> through the OMA API <NUM>.

Before the system architecture is used for imperceptible vehicle lock unlocking, a user needs to install the APP <NUM> on the electronic device <NUM>, and the electronic device <NUM> completes a registration process. The following processes are separately described: (d) the registration process and (e) a service execution process. In this embodiment of this application, for a deregistration process of the APP <NUM>, refer to specific descriptions in the example shown in <FIG>.

The following describes the registration process with reference to the system architecture shown in <FIG> and a process shown in <FIG> is a schematic flowchart of the registration process of the APP <NUM> according to an embodiment of this application. The registration process of the APP <NUM> includes steps S501 to S506.

S501: When the APP <NUM> is installed on the electronic device <NUM>, the APP <NUM> obtains a first certificate from the server <NUM>.

In this embodiment of this application, if an APP ID of the APP <NUM> is not stored in the Bluetooth agent module <NUM>, the APP <NUM> may obtain the first certificate from the server <NUM>. The first certificate may be used to prove permission of the APP <NUM> to the Bluetooth agent module <NUM>.

In a possible implementation, when the APP <NUM> is installed on the electronic device <NUM>, the APP <NUM> may send, to the server <NUM>, a message used to request to deliver the first certificate. Then, the server <NUM> sends the first certificate to the APP <NUM>. In another possible implementation, when the APP <NUM> is installed on the electronic device <NUM>, the server <NUM> delivers the first certificate to the APP <NUM>.

S502: The APP <NUM> sends first registration information and the first certificate to the Bluetooth agent module <NUM>.

Optionally, the APP <NUM> may further send the first certificate to the Bluetooth agent module <NUM>. The first certificate may prove the permission of the APP <NUM> to the Bluetooth agent module <NUM>, so that permission verification performed on the APP <NUM> in step S503 succeeds.

S503: The Bluetooth agent module <NUM> performs permission verification on the APP <NUM> based on the first registration information and the first certificate.

S504: When the permission verification succeeds, the Bluetooth agent module <NUM> sends first device identification information to the Bluetooth chip <NUM>.

S505: The Bluetooth agent module <NUM> detects whether a Bluetooth scanning function of the Bluetooth chip <NUM> is enabled.

S506: When detecting that the Bluetooth scanning function of the Bluetooth chip <NUM> is not enabled, the Bluetooth agent module <NUM> enables the Bluetooth scanning function.

S507: The Bluetooth chip <NUM> performs scanning.

The following describes the first certificate in step S502 and the permission verification process in step S503.

The first certificate is a digital certificate digitally signed by a certificate authority (certificate authority, CA). The certificate authority is approved by the Bluetooth agent module <NUM>. The first certificate may include a public key of the server <NUM>, a name of the server <NUM>, and a digital signature of the certificate authority. When the Bluetooth agent module <NUM> performs identity authentication by using the first certificate, the first certificate may randomly generate an identity code. Each digital certificate can generate a corresponding identity code, but an identity code generated each time is different.

The first certificate is electronic data, including identity information of the server <NUM>, that is reviewed and issued by an authentication center. Therefore, the first certificate may prove, to the Bluetooth agent module <NUM> by using the digital signature of the certificate authority, that the server <NUM> is authenticated by the certificate authority.

The Bluetooth agent module <NUM> stores a public key of the certificate authority, and performs verification on the digital signature of the certificate authority in the first certificate by using the public key of the certificate authority. When the verification succeeds, the permission verification succeeds. Then, steps S504 to S507 are performed.

For steps S504 to S507, refer to descriptions of steps S203 to S206 in the example shown in <FIG>.

After registration is completed and an account is logged in to, the electronic device <NUM> may perform the service execution method according to the embodiments of this application. <FIG> is a schematic flowchart of a service execution method according to an embodiment of this application. In the service execution method, an example in which a Bluetooth channel is established between the external Bluetooth device <NUM> and the SE <NUM> is used. Establishment of a Bluetooth channel between the external Bluetooth device <NUM> and the TEE <NUM> is similar. The service execution method is based on the system architecture shown in <FIG>, and the service execution method includes steps S601 to S608.

S601: The Bluetooth device <NUM> broadcasts a Bluetooth broadcast signal.

S602: The Bluetooth chip <NUM> receives the Bluetooth broadcast signal from the Bluetooth device <NUM>, and detects whether the device from which the received Bluetooth broadcast signal comes is registered with the electronic device <NUM>.

When the electronic device <NUM> is in a sleep state (for example, the electronic device <NUM> is in a screen-off sleep state), if the Bluetooth chip <NUM> detects that the device (the Bluetooth device <NUM>) from which the Bluetooth broadcast signal comes is not registered with the electronic device <NUM>, the Bluetooth agent module <NUM> may be in a sleep state.

S603: When detecting that the device from which the Bluetooth broadcast signal comes is registered with the electronic device <NUM>, the Bluetooth chip <NUM> wakes up the Bluetooth agent module <NUM>, and sends the first device identification information.

The Bluetooth agent module <NUM> stores the first registration information in step S203 in the registration process shown in <FIG>. The Bluetooth agent module <NUM> finds the first registration information by using the first device identification information. A ⑤ OPTION in the first registration information may indicate that a data receiving entity is the TEE <NUM>, and the Bluetooth chip <NUM> does not wake up the APP <NUM> after obtaining the first device identification information through scanning. When detecting that the device from which the Bluetooth broadcast signal comes is registered with the electronic device <NUM>, the Bluetooth agent module <NUM> may establish a channel to the Bluetooth device <NUM>. In this case, the channel between the Bluetooth agent module <NUM> and the external Bluetooth device is established by using steps S601 to S603, and the Bluetooth agent module <NUM> may obtain service information of the TEE <NUM> and transmit the service information to the external Bluetooth device.

After step S603, the user may execute a transaction process (for example, imperceptibly unlock the vehicle lock) when the user carries the electronic device <NUM> and moves close to the Bluetooth device <NUM>. Refer to steps S604 to S608. For steps S307 to S310, refer to descriptions of steps S105 to S108 in the example shown in <FIG>.

For example, in a scenario in which the Bluetooth device <NUM> unlocks the vehicle lock of the vehicle <NUM>, when detecting that a distance between the vehicle <NUM> and the electronic device <NUM> is less than or equal to a specific distance (for example, <NUM> meters), the vehicle <NUM> may perform steps S601 to S603 to establish the Bluetooth channel to the Bluetooth agent module <NUM>. After the channel between the Bluetooth agent module <NUM> and the vehicle <NUM> is established by using steps S601 to S603, the vehicle <NUM> may detect the distance between the electronic device <NUM> and the vehicle <NUM> in real time. When the vehicle <NUM> detects that the distance between the vehicle <NUM> and the electronic device <NUM> is less than or equal to a specific distance (for example, <NUM> meters), the vehicle <NUM> may perform steps S604 to S607 to complete a verification process. When the vehicle <NUM> detects that the distance between the vehicle <NUM> and the electronic device <NUM> is less than or equal to a specific distance (for example, <NUM> meters), step S608 is performed to unlock the vehicle lock.

S604: The Bluetooth device <NUM> sends a ciphertext verification instruction to the Bluetooth agent module <NUM> through the channel.

The ciphertext verification instruction may be transmitted after being encrypted by using a digital signature. The ciphertext verification instruction may include a digital signature of the Bluetooth device <NUM>, for example, a digital signature including a private key of the Bluetooth device <NUM>. The Bluetooth agent module <NUM> may store a public key corresponding to the private key of the Bluetooth device <NUM>. After receiving the ciphertext verification instruction, the Bluetooth agent module <NUM> first uses the public key to verify the digital signature of the Bluetooth device <NUM>. If the verification succeeds, step S605 is performed.

S605: The Bluetooth agent module <NUM> obtains a first ciphertext from an applet of the SE <NUM>.

S606: The Bluetooth agent module <NUM> sends the first ciphertext to the Bluetooth device <NUM> through the Bluetooth chip <NUM>.

In a transmission process in step S606, the first ciphertext may be encrypted for transmission. An encryption method is not limited in this embodiment of this application.

S607: The Bluetooth device <NUM> compares the first ciphertext with a ciphertext in an SE.

S608: If the ciphertext comparison succeeds, the Bluetooth device <NUM> unlocks the vehicle lock of the Bluetooth device <NUM>.

For example, if the first ciphertext is the same as a ciphertext in an applet of the SE of the Bluetooth device <NUM>, comparison succeeds.

In the foregoing service execution method process, the Bluetooth agent module <NUM> is started only after the Bluetooth chip <NUM> detects that the device (the Bluetooth device <NUM>) from which the Bluetooth broadcast signal comes is registered with the electronic device <NUM>. The Bluetooth agent module <NUM> and an application processor in the electronic device <NUM> do not need to be always in a working state, to reduce power consumption and memory usage of the electronic device <NUM>.

In the foregoing service execution method process, the Bluetooth channel is directly established between the SE <NUM> and the Bluetooth device <NUM> without running the APP <NUM>, to reduce power consumption and memory usage of the electronic device <NUM>.

In the foregoing service execution method process, the user does not need to manually run the APP <NUM>. In this way, the service execution process is imperceptible to the user, and convenience of the service execution process is improved.

In the foregoing service execution method process, the APP <NUM> does not need to be kept in a running state, to further reduce power consumption and memory usage of the electronic device <NUM>. In this embodiment of this application, the Bluetooth agent module <NUM> further provides a management platform for establishing a Bluetooth channel for a Bluetooth-related service execution process.

In a possible implementation, the Bluetooth scanning function in step S602 may be implemented by the user manually turning on the Bluetooth scanning switch <NUM>. Refer to <FIG>, <FIG>, and <FIG>. In another possible implementation, the Bluetooth scanning function may alternatively be enabled when the electronic device <NUM> detects that the Bluetooth scanning function is not enabled. For example, in the example of the registration process described in <FIG>, the Bluetooth agent module <NUM> enables the Bluetooth scanning function by performing steps S505 and S506. Alternatively, after registration is completed, the Bluetooth agent module <NUM> may automatically enable the Bluetooth scanning function in the service process. The Bluetooth agent module <NUM> may enable the Bluetooth scanning function, so that the user does not need to manually enable the Bluetooth scanning function. In this way, the service execution process is imperceptible to the user, and convenience of the service execution process is improved.

In some other embodiments of this application, the APP <NUM> may further establish a connection to the SE <NUM> through the OMA API <NUM>. The ⑤ OPTION in the first registration information may indicate that a data receiving entity is the SE <NUM>, and the Bluetooth chip <NUM> wakes up the APP <NUM> after obtaining the first device identification information through scanning. After step S603, the Bluetooth agent module <NUM> wakes up the APP <NUM>. The Bluetooth agent module <NUM> may establish the channel to the external Bluetooth device <NUM>, and the Bluetooth agent module <NUM> is connected to the SE <NUM>, so that service information (for example, a ciphertext) in the SE <NUM> may be transmitted to the Bluetooth device <NUM> (for example, the vehicle).

In this embodiment of this application, the Bluetooth device <NUM> may further establish a communication connection to the server <NUM>, as shown in <FIG>. The Bluetooth device <NUM> may exchange service information with the server <NUM> through the communication connection. For example, the service information is a fingerprint comparison result from the SE <NUM> in the electronic device <NUM>.

Specifically, after the channel is established between the Bluetooth agent module <NUM> and the external Bluetooth device, if the server <NUM> needs to verify a user identity on the electronic device <NUM> in the transaction process, for example, verify a fingerprint or a facial image of the user, after the verification is completed, the electronic device <NUM> may send a comparison result to the server <NUM> through the Bluetooth device <NUM>. Fingerprint verification is used as an example. First, the electronic device <NUM> compares a detected fingerprint with a pre-stored fingerprint, and stores a comparison result in the SE <NUM> of the electronic device <NUM>. The Bluetooth agent module <NUM> obtains the comparison result from the SE <NUM>. The Bluetooth agent module <NUM> sends the comparison result to the Bluetooth device <NUM> through the Bluetooth connection. The Bluetooth device <NUM> sends the comparison result to the server <NUM> through the communication connection between the Bluetooth device <NUM> and the server <NUM>, to complete the transaction process.

It may be understood that the communication connection between the Bluetooth device <NUM> and the server <NUM> is not limited to the foregoing function example, and may further be used to transmit other service information in the service execution process. This is not limited in this embodiment of this application.

For the service execution process of imperceptible vehicle lock unlocking, the server <NUM> may alternatively not be required in the registration process of the APP <NUM>. The Bluetooth agent module <NUM> stores the APP_ID of the APP <NUM>, and the Bluetooth agent module <NUM> may perform permission verification on the APP by using the APP_ID of the APP <NUM>. Specifically, <FIG> is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown in <FIG>, the Bluetooth system includes the electronic device <NUM> and a Bluetooth device <NUM> (for example, the vehicle <NUM>). As shown in <FIG>, the electronic device <NUM> includes the Bluetooth chip <NUM>, the Bluetooth agent module <NUM>, the APP <NUM>, the OMA API <NUM>, the SE <NUM>, and the TEE <NUM>. The Bluetooth system may include either the SE <NUM> that is connected to the OMAAPI <NUM> or the TEE <NUM>, or may include both the SE <NUM> and the TEE <NUM>. The Bluetooth chip <NUM> establishes a connection to the Bluetooth agent module <NUM>. The Bluetooth agent module <NUM> is connected to the TEE <NUM>, and the Bluetooth agent module <NUM> is connected to the SE <NUM> through the OMA API <NUM>.

After the APP <NUM> is installed on the electronic device <NUM>, a registration process needs to be completed for the APP. For the registration process, refer to the embodiment described in <FIG>. The registration process is completed only on the electronic device <NUM>. For a service execution process, refer to the embodiment described in <FIG>. Neither the registration process nor the service execution process requires interaction with a server. For a service deregistration process, refer to specific descriptions in the example shown in <FIG>.

In this service execution method, an example in which service information (for example, weight information) is imperceptibly uploaded to an electronic device is used for description. A Bluetooth device <NUM> may be a weight scale <NUM>. It may be understood that in this embodiment of this application, a scenario of automatically uploading data of the weight scale <NUM> is used as an example for description, and another service scenario may alternatively be used. This is not limited in this embodiment of this application. An electronic device <NUM> may receive a Bluetooth broadcast signal. An APP <NUM> corresponding to the weight scale <NUM> may be installed on the electronic device <NUM>. The APP <NUM> on the electronic device <NUM> may establish a channel to the weight scale <NUM> by using a Bluetooth broadcast signal, and the weight scale <NUM> may upload weight data detected in real time to the APP <NUM>. In the foregoing process of uploading the data of the weight scale <NUM>, the data of the weight scale <NUM> can be imperceptibly uploaded without the user manually operating the APP <NUM> on the electronic device <NUM>.

<FIG> is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown in <FIG>, the Bluetooth system includes the Bluetooth device (for example, the weight scale <NUM>) and the electronic device <NUM>.

As shown in <FIG>, the electronic device <NUM> includes a Bluetooth chip <NUM>, a Bluetooth agent module <NUM>, and the APP <NUM>. The Bluetooth chip <NUM> establishes a connection to the Bluetooth agent module <NUM>, and the Bluetooth agent module <NUM> establishes a connection to the APP <NUM>.

After the APP <NUM> is installed on the electronic device <NUM>, a registration process needs to be completed for the APP. For the registration process, refer to the embodiment described in <FIG>. The registration process is completed only on the electronic device <NUM>.

After registration is completed and an account is logged in to, the electronic device <NUM> may perform the service execution method according to the embodiments of this application. <FIG> is a schematic flowchart of a service execution method according to an embodiment of this application. As shown in <FIG>, the service execution method includes steps S701 to S706.

S701: The Bluetooth device <NUM> broadcasts a Bluetooth broadcast signal.

The Bluetooth broadcast signal may carry first device identification information (for example, a first UUID) and first device identity information (for example, a first device ID). The first device identity information is in a one-to-one correspondence with the Bluetooth device <NUM>.

S702: The Bluetooth chip <NUM> receives the Bluetooth broadcast signal, and detects whether the device (the Bluetooth device <NUM>) from which the Bluetooth broadcast signal comes is registered with the electronic device <NUM>.

S703: When detecting that the device from which the Bluetooth broadcast signal comes is registered with the electronic device <NUM>, the Bluetooth chip <NUM> wakes up the Bluetooth agent module <NUM>, and sends the first device identification information.

S704: The Bluetooth agent module <NUM> runs the APP <NUM> based on the first device identification information and first registration information.

For descriptions of steps S701 to S704, refer to specific descriptions of steps S301 to S304 in the service execution method described in <FIG> and <FIG>.

When detecting that the device from which the Bluetooth broadcast signal comes is registered with the electronic device <NUM>, the Bluetooth agent module <NUM> may establish a channel to the Bluetooth device <NUM> by using steps S701 to S704. Service information (for example, weight information) from the Bluetooth device <NUM> may be transmitted to the Bluetooth agent module <NUM>. The Bluetooth agent module <NUM> may wake up the APP, and transmit the service information (for example, the weight information) to the APP <NUM>.

Optionally, the service information (for example, the weight information) from the external Bluetooth device <NUM> may alternatively be received by the Bluetooth chip <NUM> in a form of a broadcast signal, and transmitted to the Bluetooth agent module <NUM>. Then, the service information is transmitted by the Bluetooth agent module <NUM> to the APP <NUM>.

S705: The Bluetooth device <NUM> detects weight information.

The weight information may include data such as a weight value, a body fat value, and a health index. For example, the weight information may be sent to the APP <NUM> through a Bluetooth connection.

S706: The Bluetooth device <NUM> sends the weight information to the APP <NUM> through a channel between the Bluetooth device <NUM> and the APP <NUM>.

The APP <NUM> may store the weight information, and the APP <NUM> may further display the weight information.

In the foregoing method process, in a process of establishing a Bluetooth connection between the Bluetooth device <NUM> and the Bluetooth chip <NUM>, the Bluetooth agent module <NUM> is started only after the Bluetooth chip <NUM> detects that the device (the Bluetooth device <NUM>) from which the Bluetooth broadcast signal comes is registered with the electronic device <NUM>. The Bluetooth agent module <NUM> and an application processor in the electronic device <NUM> do not need to be always in a working state, to reduce power consumption and memory usage of the electronic device <NUM>.

In the foregoing process in which the weight scale uploads the weight information to the application, the user does not need to manually run the APP <NUM>. In this way, the execution process is imperceptible to the user, and convenience of the service execution process is improved.

In the foregoing process in which the weight scale uploads the weight information to the application, the APP <NUM> does not need to be kept in a running state, to further reduce power consumption and memory usage of the electronic device <NUM>. In this embodiment of this application, the Bluetooth agent module <NUM> further provides a management platform for a Bluetooth-related service execution process.

In another possible implementation, a Bluetooth scanning function may alternatively be enabled when the electronic device <NUM> detects that the Bluetooth scanning function is not enabled. For example, in the example of the registration process, the Bluetooth agent module <NUM> enables the Bluetooth scanning function. Alternatively, after registration is completed, the Bluetooth agent module <NUM> may automatically enable the Bluetooth scanning function in the service execution process. The Bluetooth agent module <NUM> may enable the Bluetooth scanning function, so that the user does not need to manually enable the Bluetooth scanning function. In this way, the service execution process is imperceptible to the user, and convenience of the service execution process is improved.

<FIG> is a schematic diagram of a structure of an electronic device <NUM> according to an embodiment of this application. The method is performed on the electronic device <NUM>. The electronic device <NUM> may be the electronic device <NUM> in any system architecture in <FIG>, <FIG>, <FIG>, <FIG>. As shown in <FIG>, the electronic device <NUM> includes a Bluetooth chip <NUM> and a Bluetooth agent module <NUM>. The Bluetooth chip <NUM> is connected to the Bluetooth agent module <NUM>.

<FIG> is a schematic flowchart of a Bluetooth scanning method according to an embodiment of this application. As shown in <FIG>, based on the electronic device <NUM> described in <FIG> and any system architecture in <FIG>, <FIG>, <FIG>, <FIG>, the Bluetooth scanning method includes steps S801 to S803.

S801: The Bluetooth agent module indicates the Bluetooth chip to scan for a device identifier.

In this embodiment of this application, in a phase of registering an application with the electronic device, the Bluetooth agent module indicates a device identifier that needs to be scanned by the Bluetooth chip. For the registration phase of the application, refer to the examples described in <FIG> and <FIG>.

The device identifier is a UUID of an external Bluetooth device.

S802: If a first device identifier in the device identifiers is obtained through scanning, the Bluetooth chip notifies the Bluetooth agent module.

That the first device identifier is obtained through scanning may mean that in a registration process of an application corresponding to the first device identifier, the first device identifier is stored in the Bluetooth chip, and the Bluetooth chip detects that the first device identifier is stored in the Bluetooth chip. In other words, a first device from which the Bluetooth broadcast signal comes is registered with the electronic device <NUM>. In this embodiment of this application, the first device may be an external Bluetooth device, for example, a payment device or a vehicle.

S803: The Bluetooth agent module establishes a channel to the first device based on the first device identifier, or notifies the application corresponding to the first device identifier.

When the electronic device <NUM> is in a sleep state (for example, the electronic device <NUM> is in a screen-off sleep state), if the Bluetooth chip <NUM> detects that a received device identifier is not included in a device identifier list pre-stored in the Bluetooth chip <NUM>, the Bluetooth agent module <NUM> may be in a sleep state. If the Bluetooth chip <NUM> detects that the received first device identifier is included in the device identifier list pre-stored in the Bluetooth chip <NUM>, the Bluetooth chip <NUM> wakes up the Bluetooth agent module <NUM>, and sends the first device identifier to the Bluetooth agent module <NUM>. In the foregoing Bluetooth scanning method, the Bluetooth agent module <NUM> is started only when the Bluetooth chip <NUM> obtains the first device identifier in the device identifiers through scanning. In the electronic device <NUM>, the Bluetooth agent module <NUM> and an application processor do not need to be always in a working state, to reduce power consumption and memory usage of the electronic device <NUM>.

In the foregoing Bluetooth scanning method, the Bluetooth agent module <NUM> may run an APP <NUM>, and a user does not need to manually run the APP <NUM>. In this way, an execution process is imperceptible to the user, and convenience of the service execution process is improved. The Bluetooth agent module <NUM> may run the APP <NUM>, but the APP <NUM> does not need to be always run on the electronic device <NUM>, and the APP <NUM> may be stopped running by the application processor, to further reduce power consumption and memory usage of the electronic device <NUM>.

In the foregoing Bluetooth scanning method, the Bluetooth agent module <NUM> may be connected to an SE, and directly establishes a Bluetooth channel between the Bluetooth chip <NUM> and a Bluetooth device without running the APP <NUM>, to further reduce power consumption and memory usage of the electronic device <NUM>. The Bluetooth agent module <NUM> further provides a Bluetooth scanning management platform for a Bluetooth-related service execution process.

The Bluetooth agent module <NUM> may be connected to the SE, and directly establishes a Bluetooth channel between the Bluetooth chip <NUM> and a Bluetooth device <NUM> without running the APP <NUM>, to further reduce power consumption and memory usage of the electronic device <NUM>.

In a possible implementation, after the Bluetooth agent module establishes the channel to the first device based on the first device identifier, the method further includes: The Bluetooth agent module obtains service information corresponding to the first device identifier, and sends the service information to the first device through the channel.

The Bluetooth agent module <NUM> may establish the channel to the external Bluetooth device (the first device), and the Bluetooth agent module <NUM> is connected to the SE (or a TEE), so that service information (for example, a ciphertext) in the SE (TEE) may be transmitted to the external Bluetooth device (for example, a vehicle).

For example, the service information is verification information, the verification information is used by the first device to perform verification based on locally stored information and the verification information, and a corresponding service is executed if the verification succeeds. For example, the service information is the ciphertext in the example shown in <FIG>.

In a possible implementation, the service information is verification result information, and the verification result information is sent to a server, so that the server executes a corresponding service based on the verification result information.

For example, the verification result information is a fingerprint comparison result or a facial comparison result on the electronic device. A payment process or a vehicle lock unlocking process is executed only when the comparison result indicates that comparison succeeds.

In a possible implementation, the service information is information related to verification of an electronic vehicle key, and executing the corresponding service refers to unlocking a corresponding vehicle lock.

For a service execution process of vehicle lock unlocking, refer to the example shown in <FIG>.

In a possible implementation, after the Bluetooth agent module establishes the channel to the first device based on the first device identifier, the method further includes: The Bluetooth agent module notifies the application corresponding to the first device identifier. The application obtains the service information corresponding to the first device identifier. The application sends the service information corresponding to the first device identifier to the Bluetooth agent module. The Bluetooth agent module sends the service information corresponding to the first device identifier to the first device through the channel.

In a possible implementation, after the Bluetooth agent module notifies, based on the first device identifier, the application corresponding to the first device identifier, the method further includes: The Bluetooth agent module sends the service information from the first device to the application, so that the application displays the service information to the user.

For example, the first device may alternatively be a weight scale, and the service information may be weight information. For a service execution process of weight information transmission, refer to the example described in <FIG>.

In the foregoing service execution method process, in a process of establishing a Bluetooth connection between the Bluetooth device and the Bluetooth chip, the Bluetooth agent module is started only after the Bluetooth chip detects that the device (the Bluetooth device) from which the Bluetooth broadcast signal comes is registered with the electronic device. The Bluetooth agent module and the application processor in the electronic device do not need to be always in the working state, to reduce power consumption and memory usage of the electronic device.

In this embodiment of this application, the user does not need to manually run the APP. In this way, the service transaction execution process is imperceptible to the user, and convenience of the service execution process is improved.

In this embodiment of this application, the APP does not need to be kept in a running state, to further reduce power consumption and memory usage of the electronic device. In this embodiment of this application, the Bluetooth agent module further provides a management platform for a Bluetooth-related service transaction process.

In a possible implementation, that the Bluetooth agent module notifies, based on the first device identifier, the application corresponding to the first device identifier includes: The Bluetooth agent module runs, based on the first device identifier, the application corresponding to the first device identifier, and sends the first device identifier to the application. After the Bluetooth agent module notifies, based on the first device identifier, the application corresponding to the first device identifier, the method further includes: The application obtains the service information from the first device, and sends the service information and user account information to a server, so that the server performs verification based on the service information and the user account information that are sent by the application and user information obtained by the first device, and executes a service transaction if the verification succeeds.

The user information is a facial image, and executing the service transaction refers to executing a payment transaction by using the user account information as a transaction account. For a service transaction process of imperceptible payment, refer to the example described in <FIG> and <FIG>.

In a possible implementation, before the Bluetooth agent module indicates the Bluetooth chip to scan for the device identifier, the method further includes: When detecting that a Bluetooth scanning function is disabled, the Bluetooth agent module enables the Bluetooth scanning function.

For example, in an example of a registration process, the Bluetooth agent module enables the Bluetooth scanning function. Alternatively, after registration is completed, the Bluetooth agent module may automatically enable the Bluetooth scanning function in a service transaction process. The Bluetooth agent module may enable the Bluetooth scanning function, so that the user does not need to manually enable the Bluetooth scanning function. In this way, the service transaction execution process is imperceptible to the user, and convenience of the service transaction process is improved.

In a possible implementation, the Bluetooth agent module is an application/interface at an application framework layer.

In a possible implementation, before the Bluetooth agent module indicates the Bluetooth chip to scan for the device identifier, the method further includes: The Bluetooth agent module performs permission verification on the application. When the permission verification succeeds, the Bluetooth agent module sends the first device identifier to the Bluetooth chip, so that the Bluetooth chip notifies the Bluetooth agent module when obtaining the first device identifier through scanning.

For description of permission verification in the registration process, refer to step S202 in the example described in <FIG>.

In a possible implementation, that the Bluetooth agent module performs permission verification on the application includes: The Bluetooth agent module detects whether the first device identifier is included in a locally stored legal device identifier list. When the first device identifier is included in the legal device identifier list, the permission verification succeeds.

For a locally executed permission verification process, refer to step S202 in the example described in <FIG>.

In a possible implementation, before the Bluetooth agent module performs permission verification on the application, the method further includes: The application obtains a first certificate used to prove permission of the application from a server. The Bluetooth agent module performs permission verification on the application includes: The Bluetooth agent module performs permission verification on the application based on the first certificate.

For a process of performing permission verification by using a certificate on a server side, refer to steps S501 to S503 in the example described in <FIG>.

In a possible implementation, the method further includes: When the application is uninstalled from the electronic device, the Bluetooth agent module indicates the Bluetooth chip to stop scanning for the first device identifier.

For an APP deregistration process, refer to the example described in <FIG>.

It may be understood that Bluetooth scanning is used as an example for description in this embodiment of this application. However, this embodiment of this application is not limited to a service executed through Bluetooth scanning. Alternatively, other short-distance scanning may be used, for example, Wi-Fi scanning, a Wi-Fi connection, or a ZigBee connection. This is not limited in this embodiment of this application.

For example, in a Wi-Fi scanning or Wi-Fi connection scenario, the Bluetooth agent module <NUM> may be a Wi-Fi agent module. Similar to the Bluetooth agent module <NUM>, the Wi-Fi agent module is connected to a Wi-Fi chip and connected to a corresponding application. The Wi-Fi agent module is configured to indicate the Wi-Fi chip to scan for a device identifier, and establish a channel to a device based on the device identifier or notify an application corresponding to the device identifier.

An embodiment of this application further provides a computer-readable storage medium. The computer-readable storage medium stores instructions. When the instructions are run on a computer or a processor, the computer or the processor is enabled to perform one or more steps according to any one of the foregoing methods.

An embodiment of this application further provides a computer program product including instructions. When the computer program product runs on a computer or a processor, the computer or the processor is enabled to perform one or more steps in any one of the foregoing methods.

In the foregoing embodiments, all or some of the functions may be implemented by using software, hardware, or a combination of software and hardware. When the software is used to implement the embodiments, all or some of the embodiments may be implemented in a 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 the computer, the procedure or functions according to the embodiments of this application are all or partially generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or another programmable apparatus. The computer instructions may be stored in a computer-readable storage medium. The computer-readable storage medium may be any usable medium accessible by the computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a DVD), a semiconductor medium (for example, a solid-state disk (solid-state disk, SSD)), or the like.

Claim 1:
A Bluetooth scanning method, applied to an electronic device, wherein the electronic device comprises a Bluetooth chip and a Bluetooth agent module, and the method comprises:
scanning, by the Bluetooth chip of the electronic device, a Bluetooth broadcast signal broadcast by a first device, wherein the Bluetooth broadcast signal comprises the first device identifier, wherein the first device is an external Bluetooth device, and wherein the first device identifier is an identifier of the external Bluetooth device;
in response to the first device identifier received by the electronic device, determining, by the Bluetooth chip, whether the first device identifier is included in a device identifier list stored in the Bluetooth chip of the electronic device;
waking up, by the Bluetooth chip based on the determining that the first device identifier is included in the device identifier list stored in the Bluetooth chip of the electronic device, the Bluetooth agent module;
sending, by the Bluetooth chip based on the determining that the first device identifier is included in the device identifier list stored in the Bluetooth chip of the electronic device, the first device identifier to the Bluetooth agent module; and
notifying, by the Bluetooth agent module based on the first device identifier, an application corresponding to the first device identifier.