Patent ID: 12219451

DESCRIPTION OF EMBODIMENTS

The following describes the embodiments of this application with reference to the accompanying drawings in the 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.1is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown inFIG.1, the Bluetooth system includes an electronic device10and a Bluetooth device20(for example, a vehicle20). The vehicle20may broadcast a Bluetooth broadcast signal. In a process in which a user carries the electronic device10and moves close to the vehicle20, the electronic device10may receive the Bluetooth broadcast signal. An application (application, APP) corresponding to the vehicle20may be installed on the electronic device10. The APP on the electronic device10may 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 vehicle20is automatically unlocked. In the foregoing process of unlocking the vehicle lock of the vehicle20, the vehicle lock of the vehicle20can be unlocked imperceptibly and automatically without the user manually operating the APP on the electronic device10.

The following describes the electronic device10in the Bluetooth system in this embodiment of this application.FIG.2is a schematic diagram of a structure of the electronic device10according to an embodiment of this application.

The electronic device10may include a processor110, an external memory interface120, an internal memory121, a universal serial bus (universal serial bus, USB) port130, a charging management module140, a power management module141, a battery142, an antenna1, an antenna2, a mobile communications module150, a wireless communications module160, an audio module170, a speaker170A, a receiver170B, a microphone170C, a headset jack170D, a sensor module180, a button190, a motor191, an indicator192, a camera193, a display194, a subscriber identification module (subscriber identification module, SIM) card interface195, and the like. The sensor module180may include a pressure sensor180A, a gyro sensor180B, a barometric pressure sensor180C, a magnetic sensor180D, an acceleration sensor180E, a distance sensor180F, an optical proximity sensor180G, a fingerprint sensor180H, a temperature sensor180J, a touch sensor180K, an ambient light sensor180L, a bone conduction sensor180M, 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 device10. In some other embodiments of this application, the electronic device10may 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 processor110may include one or more processing units.

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

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

The charging management module140is configured to receive a charging input from a charger.

The power management module141is configured to connect to the battery142, the charging management module140, and the processor110. The power management module141receives an input from the battery142and/or the charging management module140, and supplies power to the processor110, the internal memory121, an external memory, the display194, the camera193, the wireless communications module160, and the like.

A wireless communication function of the electronic device10may be implemented through the antenna1, the antenna2, the mobile communications module150, the wireless communications module160, a modem processor, a baseband processor, and the like.

The antenna1and the antenna2are configured to transmit and receive electromagnetic wave signals. Each antenna in the electronic device10may be configured to cover one or more communications frequency bands.

The mobile communications module150may provide a solution that is applied to the electronic device10and that includes wireless communications technologies such as 2G, 3G, 4G, and 5G. The mobile communications module150may include at least one filter, a switch, a power amplifier, a low noise amplifier (low noise amplifier, LNA), and the like. The mobile communications module150may receive an electromagnetic wave through the antenna1, 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 module150may further amplify a signal modulated by the modem processor, and convert the signal into an electromagnetic wave for radiation through the antenna1.

The wireless communications module160may provide wireless communication solutions applied to the electronic device10, 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 module160may be one or more components integrating at least one communications processor module. The wireless communications module160receives an electromagnetic wave through the antenna2, performs frequency modulation and filtering processing on an electromagnetic wave signal, and sends a processed signal to the processor110.

The wireless communications module160includes a Bluetooth chip101provided in the embodiments of this application, namely, a Bluetooth chip101shown in any one ofFIG.8toFIG.10andFIG.12AtoFIG.19.

In some embodiments, the antenna1of the electronic device10is coupled to the mobile communications module150, and the antenna2is coupled to the wireless communications module160, so that the electronic device10may communicate with a network and another device by using a wireless communications technology.

The electronic device10implements a display function through a GPU, the display194, an application processor, and the like. The GPU is a microprocessor for image processing, and connects the display194to the application processor.

The display194is configured to display an image, a video, and the like.

The electronic device10may implement a photographing function through an ISP, the camera193, a video codec, the GPU, the display194, the application processor, and the like.

The ISP is configured to process data fed back by the camera193.

The camera193is 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 interface120may be configured to connect to an external memory card, for example, a micro SD card, to extend a storage capability of the electronic device10. The external storage card communicates with the processor110through the external memory interface120, to implement a data storage function.

The internal memory121may be configured to store computer-executable program code. The executable program code includes instructions. The processor110runs the instructions stored in the internal memory121to perform various function applications of the electronic device10and process data. The internal memory121may include a program storage area and a data storage area.

The electronic device10may implement an audio function, for example, music playing and recording, through the audio module170, the speaker170A, the receiver170B, the microphone170C, the headset jack170D, the application processor, and the like.

The electronic device10may also include various types of sensors.

A software system of the electronic device10may 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 device10.

FIG.3is a block diagram of the software structure of the electronic device10according 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.

The application layer may include a series of application packages.

As shown inFIG.3, the application package may include applications such as “camera”, “gallery”, “calendar”, “phone”, “maps”, “navigation”, “WLAN”, “Bluetooth”, “music”, “videos”, and “messages”.

The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for an application at the application layer. The application framework layer includes some predefined functions.

As shown inFIG.3, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like. The application framework layer may further include a Bluetooth agent module105provided in the embodiments of this application, namely, a Bluetooth agent module105in any one of examples shown inFIG.8toFIG.10andFIG.12AtoFIG.19. The Bluetooth agent module105may 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 device10, 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 module105is 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 Android runtime includes a kernel library and a virtual machine. The Android runtime is responsible for scheduling and management of the Android system.

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 kernel layer is a layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.

The following describes a process of starting the vehicle20in the scenario shown inFIG.1with reference to structures of the electronic device10and the vehicle20.FIG.4is a schematic diagram of an architecture of a Bluetooth system according to the conventional technology. As shown inFIG.4, the electronic device10may establish a communication connection to the vehicle20, and the communication connection may be a Bluetooth connection. Specifically, in the scenario shown inFIG.1, in the process in which the user carries the electronic device10and moves close to the vehicle20, the electronic device10establishes the Bluetooth communication connection to the vehicle20.

As shown inFIG.4, the electronic device10includes a Bluetooth chip101, an APP102, an open mobile alliance application programming interface (open mobile alliance application programming interface, OMA API)103, and a secure element (secure element, SE)104. The SE104includes an applet (applet). The vehicle20includes an in-vehicle Bluetooth chip201and an in-vehicle SE202. The in-vehicle SE202includes an in-vehicle applet. The OMA API103is an interface for invoking the applet in the SE by using a rich execution environment (rich execution environment, REE). Alternatively, the in-vehicle Bluetooth chip201and the in-vehicle SE202may be connected through an in-vehicle OMA API. The applet of the SE104may include a ciphertext for unlocking. The in-vehicle SE202also includes a ciphertext for unlocking. The ciphertext in the applet of the SE104is in a one-to-one correspondence with the ciphertext in the in-vehicle SE202.

For example, when a vehicle key service is enabled, a background server of a vehicle factory separately establishes a secure channel with the SE104of the electronic device10and the SE202of the vehicle20, and separately places the same ciphertext into the SE104and the SE202.

The Bluetooth chip101is connected to the APP102. The APP102establishes a connection to the SE104through the OMA API103. The in-vehicle Bluetooth chip201may continuously broadcast a Bluetooth broadcast signal. The Bluetooth chip101may detect the Bluetooth broadcast signal, and then detect whether the vehicle20from 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 device10. The Bluetooth chip101stores device identification information of the vehicle20(for example, a universally unique identifier (universally unique identifier, UUID) of the vehicle20). The Bluetooth broadcast signal broadcast by the in-vehicle Bluetooth chip201includes the device identification information of the vehicle20. After receiving the Bluetooth broadcast signal, the Bluetooth chip101detects that the device identification information of the vehicle20is stored in the Bluetooth chip101. In this case, the Bluetooth chip101determines that the device (the vehicle20) from which the Bluetooth broadcast signal comes is registered with the electronic device10.

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 device10may monitor a scanning result of the Bluetooth chip101. The Bluetooth chip101detects, through scanning, that the vehicle20is a device registered with the electronic device10. If the APP102on the electronic device10is in a running state, the vehicle20establishes a communication channel to the APP102on the electronic device10. The communication channel may be used for communication between the in-vehicle Bluetooth chip201and the APP102in a service execution process.

It may be understood that the ciphertext in the electronic device10is not limited to being stored in the applet of the SE104, 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 module105may establish a channel to the vehicle20. The Bluetooth agent module105may obtain service information from the TEE, and send the service information to the vehicle20through the channel.

The vehicle20may send a ciphertext verification instruction to the electronic device10through the Bluetooth channel. After receiving the ciphertext verification instruction, the electronic device10sends the ciphertext in the applet of the SE104to the vehicle20through the Bluetooth connection. The vehicle20compares the received ciphertext with the ciphertext in the in-vehicle SE202. If the comparison succeeds (for example, if the two ciphertexts are the same, the comparison succeeds), the vehicle lock of the vehicle20is unlocked.

In the foregoing process of unlocking the vehicle lock of the vehicle20, the user needs to manually start the APP102and turn on a Bluetooth scanning switch. This reduces convenience of unlocking the lock of the vehicle20. In addition, the AP in the electronic device10needs to monitor the scanning result of the Bluetooth chip101. This increases power consumption and memory usage of the electronic device10.

The following describes a scenario of imperceptible payment in the embodiments of this application.FIG.5is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown inFIG.5, the Bluetooth system includes an electronic device10, a Bluetooth device30(for example, a payment device30), and a server40.

The electronic device10may establish a communication connection to the server40, and the payment device30may establish a communication connection to the server40. The payment device30may broadcast a Bluetooth broadcast signal. When a user carries the electronic device10and moves close to the payment device30, the electronic device10may receive the Bluetooth broadcast signal. An APP corresponding to the payment device30may be installed on the electronic device10. For example, if the APP is WeChat, the server40is a WeChat server. When payment is required, the user faces the payment device30, and the payment device30collects a facial image, and uploads the facial image to the server40. The server40may 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 device10.

The following describes a process of imperceptible payment in a scenario shown inFIG.6with reference to structures of the electronic device10and the payment device30.FIG.6is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown inFIG.6, the electronic device10includes a Bluetooth chip101and an APP102. The Bluetooth chip101is connected to the APP102. The payment device30may continuously broadcast the Bluetooth broadcast signal.

FIG.7is a schematic flowchart of a service transaction method according to the conventional technology. As shown inFIG.7, based on system architectures described inFIG.7andFIG.8, the service transaction method includes steps S101to S108.S101: The payment device30broadcasts 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 device30. The UUID may identify a payment device that can connect the APP102and the server40. 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 chip101. 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 chip101.S102: The Bluetooth chip101receives the Bluetooth broadcast signal from the payment device30, and detects whether the device (the payment device30) from which the Bluetooth broadcast signal comes is registered with the electronic device10.

For Bluetooth scanning (to be specific, detecting whether a device from which a Bluetooth broadcast signal comes is registered with the electronic device10), refer to the specific description in the example described inFIG.2. Details are not described herein again. The Bluetooth chip101may be a Bluetooth low energy (Bluetooth low energy, BLE) chip. In this case, the Bluetooth chip101can perform step S102only when a Bluetooth scanning switch on the electronic device10is turned on.S103: An application processor of the electronic device10monitors the Bluetooth chip101, and runs the APP102when detecting that the device (the payment device30) from which the Bluetooth broadcast signal comes is registered with the electronic device10.

After detecting that the device from which the Bluetooth broadcast signal comes is registered, the application processor may detect whether the APP102is run. If the APP102is not run, step S104is performed to run the APP102. For a system with a release later than Android 8.0, the AP of the electronic device10may automatically run the APP102by performing step S103.S104: The APP102sends a message carrying the device identity information and an account ID to the server40.

The APP may send a message carrying the device ID and the account ID to the server40. The device ID may be obtained by the Bluetooth chip101from the Bluetooth broadcast signal and sent to the APP102. The server40may obtain one or more account IDs that can receive the Bluetooth broadcast signal from the payment device30. For example, there are currently 10 electronic devices near the payment device30, the Alipay application is installed on each of the 10 electronic devices, and an imperceptible payment service is enabled. Each of the Alipay applications on the 10 electronic devices has an Alipay account ID (for example, an Alipay account). In this case, for each of the 10 electronic devices, service information (for example, device identity information) from an external Bluetooth device51may be transmitted to the APP102by using steps S101to S104, and the APP102transmits the service information to the server40. The server40may obtain the Alipay account ID on each of the 10 electronic devices. In steps S105to S108, facial comparison is performed to determine which Alipay account ID to execute a transaction process.S105: The payment device30collects a facial image.S106: The payment device30sends the collected facial image and the device ID to the server40.

The device ID is in a one-to-one correspondence with the payment device30.S107: The server40obtains an account ID through recognition based on the received facial image and device ID.

After receiving the facial image and the device ID, the server40may 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 server40may determine 10 Alipay account IDs based on device IDs to upload service information (for example, device identity information) to the server40through the payment device30. The server40may obtain a facial image corresponding to each of the 10 Alipay account IDs. Then, the facial image received from the payment device30is compared with the 10 facial images, to obtain an Alipay account ID corresponding to the received facial image.

The server40may 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 server40from another device (for example, the electronic device10). This is not limited in this embodiment of this application.S108: The server40completes a service transaction based on the account ID.

The server40may use the account ID obtained in step S107as a deduction account to complete the service transaction.

In the foregoing process of imperceptible payment, in step S102, the application processor of the electronic device10needs 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 device10. This increases power consumption and memory usage of the electronic device10. In addition, the Bluetooth scanning switch, on the electronic device10, 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 device10. The electronic device10involved in the service execution method includes a Bluetooth agent (Bluetooth agent) module.FIG.8is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown inFIG.8, the Bluetooth system includes an electronic device10, a Bluetooth device50(for example, a vehicle or a payment device), and a server40.

As shown inFIG.8, the electronic device10includes a Bluetooth chip101, an APP102, an OMA API103, an SE104, a Bluetooth agent module105, a TEE106, an APP1021, and an APP1022. The APP1021and the APP1022may be different service applications (for example, one is a payment application and the other is an application associated with a vehicle20). Each of the APP1021and the APP1022corresponds to a Bluetooth device. For example, the APP1021corresponds to a Bluetooth device51, and the APP1022corresponds to a Bluetooth device52.

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 server40and the Bluetooth agent module.

There may be a plurality of Bluetooth devices corresponding to the APP1021. Device identification information of a Bluetooth device is stored in the Bluetooth agent module105and the Bluetooth chip101, and the Bluetooth device corresponds to one APP on the electronic device10. There may also be a plurality of Bluetooth devices corresponding to the APP1022. 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 chip101, the OMA API103, the SE104, and the TEE106, refer to the example shown inFIG.2. For the APP1021, the APP1022, and the server40, refer to the example shown inFIG.6.

This embodiment of this application is described by using an example in which the APP1021is a payment application and the Bluetooth device51is a payment device corresponding to the APP1021, and an example in which the APP1022is a vehicle application and the Bluetooth device52is a vehicle corresponding to the APP1022.

The Bluetooth agent module105is connected to the APP1022. The Bluetooth agent module105is further connected to the TEE106, and the Bluetooth agent module105is further connected to the SE104through the OMA API103.

In a vehicle lock unlocking scenario, the Bluetooth agent module105is started when the Bluetooth chip101detects that a device from which a Bluetooth broadcast signal comes is registered with the electronic device10. The Bluetooth agent module105may establish a channel to an external Bluetooth device, and the Bluetooth agent module105is connected to the SE104, so that service information (for example, a ciphertext) in the SE104may be transmitted to the external Bluetooth device (for example, a vehicle). The Bluetooth agent module105is further connected to the TEE106, so that service information (for example, a ciphertext) in the TEE106may also be transmitted to the external Bluetooth device (for example, the vehicle).

In a payment scenario, the Bluetooth chip101is connected to the Bluetooth agent module105, the Bluetooth agent module105is connected to the APP1021, and the APP1021establishes a communication connection to the server40. The Bluetooth device51establishes a communication connection to the server40. In this service method, when the Bluetooth chip101obtains a first device identifier in device identifiers through scanning, the Bluetooth chip101notifies the Bluetooth agent module105. The Bluetooth agent module105may wake up the APP1021, and service information (for example, a device ID of the Bluetooth device51) from the external Bluetooth device51may be transmitted to the APP1021. The APP1021establishes the communication connection to the server40, so that the service information (for example, the device ID of the Bluetooth device51) from the external Bluetooth device51is transmitted to the server40. The server40may complete a service based on the service information transmitted from the APP1021and user information (for example, a facial image) collected from the Bluetooth device51. A device identifier stored in the Bluetooth chip101is 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 device10succeeds.

The Bluetooth agent module105is started only when the Bluetooth chip101obtains the first device identifier in the device identifiers through scanning. The Bluetooth agent module105and an application processor in the electronic device10do not need to be always in a working state, to reduce power consumption and memory usage of the electronic device10.

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 module105may run the APP1021, but the APP1021does not need to be always run on the electronic device10, and the APP1021may be stopped running by the application processor, to further reduce power consumption and memory usage of the electronic device10.

In this embodiment of this application, the Bluetooth agent module105further provides a Bluetooth scanning management platform for a Bluetooth-related service execution process.

The Bluetooth agent module105is connected to the SE104, and directly establishes a Bluetooth channel between the Bluetooth chip101and a Bluetooth device60without running the APP1022, to further reduce power consumption and memory usage of the electronic device10.

Optionally, the APP1022may further be connected to the TEE106. In this case, the Bluetooth agent module105may wake up the APP1022. The APP1022may obtain the service information (for example, the ciphertext) from the TEE106and transmit the service information to the Bluetooth agent module105. The Bluetooth agent module105establishes 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 APP1022may further be connected to the SE104through an OMA API. In this case, the Bluetooth agent module105may wake up the APP1022, and the APP1022may obtain the service information (for example, the ciphertext) from the SE104and transmit the service information to the Bluetooth agent module105. The Bluetooth agent module105establishes 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: (1) imperceptible facial payment; (2) imperceptible vehicle lock unlocking; and (3) automatically uploading data of a weight scale.

(1) Imperceptible Facial Payment

This service execution method is based on the system architecture described inFIG.5. For example, the service execution process is to perform imperceptible facial payment. A Bluetooth device50may be the payment device30shown inFIG.5. 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.9is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown inFIG.9, the Bluetooth system includes an electronic device10, the Bluetooth device50(for example, the payment device30), and a server40. As shown inFIG.9, the electronic device10includes a Bluetooth chip101, a Bluetooth agent module105, and an APP102. The Bluetooth chip101establishes a connection to the Bluetooth agent module105, and the Bluetooth agent module105establishes a connection to the APP102.

Before the system architecture is used to perform imperceptible facial payment, a user needs to install the APP102on the electronic device10, and the electronic device10completes a registration process. The following processes are separately described: (a) the registration process; (b) a transaction process; and (c) a deregistration process.

(a) Registration Process

The following describes the registration process with reference to the system architecture shown inFIG.9and a process shown inFIG.10.FIG.10is a schematic flowchart of the registration process of the APP102according to an embodiment of this application. The registration process of the APP102includes steps S201to S206.S201: When the APP102is installed on the electronic device10, the APP102sends first registration information to the Bluetooth agent module105.

The first registration information may include one or more of the following:{circle around (1)} APP_ID: an identification (identification, ID) of the APP102on which registration is performed.{circle around (2)} APP_AWAKE_ID: an ID used to wake up the APP102after the Bluetooth chip101obtains first device identification information through scanning.{circle around (3)} CORRESPONDENT_ID: an ID of a communicator during service information transmission.

For example, the ID of the communicator may be the ID of the APP102. In this case, the APP102may be woken up when a Bluetooth broadcast signal is detected through scanning. For another example, the ID of the communicator may alternatively be a UUID of a TA. In this case, when a Bluetooth broadcast signal is detected through scanning, the APP102may be woken up to establish a channel to an external Bluetooth device. For another example, the ID of the communicator may alternatively be an applet identification (applet identification, AID). In this case, when a Bluetooth broadcast signal is detected through scanning, the APP102may be woken up to establish a channel to an external Bluetooth device.{circle around (4)} The first device identification information: identification information of a Bluetooth device that the APP102expects to scan, where for example, the identification information includes but is not limited to a UUID of the external Bluetooth device.

In a possible implementation, the APP102corresponds to one UUID list. The UUID list includes one or more UUIDs. For each UUID in the UUID list, the Bluetooth agent module105verifies a Bluetooth broadcast signal broadcast by an external Bluetooth device corresponding to the UUID.{circle around (5)} OPTION: an entity that receives service information, such as the APP102, a TA in a TEE106, or an applet in an SE104; and whether the Bluetooth chip101wakes up the APP102after obtaining the first device identification information through scanning.S202: The Bluetooth agent module105performs permission verification on the APP102based on the first registration information.

In a possible implementation, the Bluetooth agent module105may store APP_IDs of a plurality of APPS, and the plurality of APP_IDs are approved by the Bluetooth agent module105. The Bluetooth agent module105detects 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 S203is 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 module105may 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 module105may be located at an application framework layer in the example shown inFIG.7, and may be an application/interface at the application framework layer. The Bluetooth agent module105is 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 module105sends the first device identification information to the Bluetooth chip101.

The Bluetooth chip101may store the device identification information whose permission verification succeeds. For example, permission verification performed by the Bluetooth agent module105on an APP1succeeds, and registration information of the APP1includes a UUID1, a UUID2, a UUID3, and a UUID4. Permission verification performed by the Bluetooth agent module105on an APP2succeeds, and registration information of the APP2includes a UUID5and a UUID6. In this case, the Bluetooth chip101may receive and store the UUID1, the UUID2, the UUID3, the UUID4, the UUID5, and the UUID6.

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 module105stores the first registration information of the APP102. The Bluetooth agent module105may find, by using the first registration information and a UUID that is obtained by the Bluetooth chip101through scanning, a corresponding APP, TA, or applet.S204: The Bluetooth agent module105detects whether a Bluetooth scanning function of the Bluetooth chip101is enabled.

When the Bluetooth scanning function of the Bluetooth chip101is enabled, the Bluetooth chip101may receive a Bluetooth broadcast signal, and detect whether device identification information carried in the Bluetooth broadcast signal is stored in the Bluetooth chip101. When the Bluetooth scanning function of the Bluetooth chip101is disabled, the Bluetooth chip101cannot receive a Bluetooth broadcast signal.S205: When detecting that the Bluetooth scanning function of the Bluetooth chip101is not enabled, the Bluetooth agent module105enables the Bluetooth scanning function.

For example, if the Bluetooth chip101is a BLE Bluetooth chip, EnableBLE may be invoked to enable the Bluetooth scanning function.

FIG.11(a),FIG.11(b1), andFIG.11(b2) are schematic diagrams of an application interface according to an embodiment of this application. An application interface100is an application interface in a system setting application. As shown inFIG.11(a), the application interface100includes a Bluetooth scanning switch1001, a Bluetooth scanning prompt1002, a WLAN scanning switch1011, and a WLAN scanning prompt1012.

When the Bluetooth scanning switch1001is in an on state, the Bluetooth scanning function is enabled. When the Bluetooth scanning switch1001is in an off state, the Bluetooth scanning function is disabled. When the Bluetooth scanning switch1001is in the off state, the Bluetooth scanning switch1001may be changed to the on state by using step S105, to enable the Bluetooth scanning function.

As shown inFIG.11(a), the Bluetooth scanning prompt1002prompts 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 switch1001is turned on, the Bluetooth chip101can still perform scanning in step S206.

When the WLAN scanning switch1011is in an on state, a WLAN scanning function is enabled. When the WLAN scanning switch1011is in an off state, the WLAN scanning function is disabled. The WLAN scanning prompt1012prompts 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 chip101performs scanning.

In the scanning process, the Bluetooth chip101may receive a Bluetooth broadcast signal, and detect whether a UUID carried in the Bluetooth broadcast signal is stored in the Bluetooth chip101.

By using steps S201to S206, registration of the APP102on the electronic device10is completed. After the registration is completed, the electronic device10may log in to an account on the APP102in response to a user operation. For example, for an Alipay application, after registration is completed, the electronic device10may 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 device10. 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 device10may include a setting entry of the Bluetooth agent module. As shown inFIG.11(b1), a setting interface200includes a setting entry201of the Bluetooth agent module. In response to a user operation performed by the user on the setting entry201of the Bluetooth agent module, for example, a tapping operation, the electronic device10displays a Bluetooth agent module setting interface300. As shown inFIG.11(b2), the Bluetooth agent module setting interface300includes a Bluetooth agent module switch301, a switch indication302, and a list303of registered applications. Details are as follows:

In response to a tap operation performed by the user on the Bluetooth agent module switch301, the Bluetooth agent module may perform permission verification on the application to complete application registration, that is, perform steps S201to S206.

The switch indication302may indicate a function of the Bluetooth agent module switch30. 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 list303of registered applications may include an identifier of an application that is registered with the electronic device10by using steps S201to S206. For example, the list303of registered applications includes an Alipay identifier3031and a Bluetooth vehicle key identifier3032. Optionally, application identifiers in the list303of registered applications may be classified and displayed based on an application category, for example, classified as a payment application and another application.

(b) Transaction Process

After registration is completed and the account is logged in to, the electronic device10may perform the service execution method according to the embodiments of this application.FIG.12AandFIG.12Bare 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 inFIG.9, and the service transaction method includes steps S301to S310.S301: The Bluetooth device50broadcasts 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 device50.S302: The Bluetooth chip101receives the Bluetooth broadcast signal, and detects whether the device (the Bluetooth device50) from which the received Bluetooth broadcast signal comes is registered with the electronic device10.

When the electronic device10is in a sleep state (for example, the electronic device10is in a screen-off sleep state), if the Bluetooth chip101detects that the device from which the received Bluetooth broadcast signal comes is not registered with the electronic device10, the Bluetooth agent module105may be in a sleep state.S303: When the device from which the received Bluetooth broadcast signal comes is registered with the electronic device10, the Bluetooth chip101wakes up the Bluetooth agent module105, and sends the first device identification information.

If the Bluetooth agent module105is already in a started state, the first device identification information can be sent to the Bluetooth agent module105without waking up the Bluetooth agent module105.S304: The Bluetooth agent module105runs the APP102based on the first device identification information and the first registration information.

The Bluetooth agent module105stores the first registration information in step S203in the registration process shown inFIG.9. The Bluetooth agent module105finds the first registration information by using the first device identification information, and finds and runs the APP102by using the APP_AWAKE_ID in the first registration information.

The {circle around (5)} OPTION in the first registration information may indicate that a data receiving entity is the APP102, and the Bluetooth chip101wakes up the APP102after obtaining the first device identification information through scanning. The Bluetooth agent module105may further determine, based on the OPTION, that the APP102needs to be run. Then, the APP102is run by using the APP_AWAKE_ID in the first registration information.

Optionally, if the APP102is already in a running state, there is no need to run the APP102.S305: The Bluetooth agent module105sends the first device identity information to the APP107.

The first device identity information may be sent by the Bluetooth chip101to the Bluetooth agent module105together with the first device identification information in step S303.S306: The APP102sends, to the server40, a message carrying the first device identity information and a first account ID.

Steps S301to S306are performed, so that service information (for example, a device ID of the Bluetooth device50) from the external Bluetooth device50may be transmitted to the APP102, and the APP102sends the service information to the server40to prepare for a subsequent transaction process. The first account ID is an ID of a login account on the APP102. 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 S307to S310. For steps S307to S310, refer to descriptions of steps S105to S108in the example shown inFIG.7. Details are not described herein again.S307: The Bluetooth device50collects a first facial image.S308: The Bluetooth device50sends, to the server40, a message carrying the first facial image and the first device identity information.S309: The server40obtains the first account ID through recognition based on the first facial image and the first device identity information.S310: The server40completes a service transaction based on the first account ID.

In the foregoing service transaction method process, the Bluetooth agent module105is started only after the device from which the Bluetooth broadcast signal received by the Bluetooth chip101comes is registered with the electronic device10. The Bluetooth agent module105and an application processor in the electronic device10do not need to be always in a working state, to reduce power consumption and memory usage of the electronic device10.

In this embodiment of this application, the Bluetooth agent module105may run the APP102, and the user does not need to manually run the APP102. 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 module105may run the APP102, but the APP102does not need to be always run on the electronic device10, and the APP102may be stopped running by the application processor, to further reduce power consumption and memory usage of the electronic device10.

In this embodiment of this application, the Bluetooth agent module105further provides a Bluetooth scanning management platform for a Bluetooth-related service transaction process.

In a possible implementation, the Bluetooth scanning function in step S302may be implemented by the user manually turning on the Bluetooth scanning switch1001. Refer toFIG.11(a),FIG.11(b1), andFIG.11(b2). In another possible implementation, the Bluetooth scanning function may alternatively be enabled when the electronic device10detects that the Bluetooth scanning function is not enabled. For example, in the example of the registration process described inFIG.12AandFIG.12B, the Bluetooth agent module105enables the Bluetooth scanning function by performing steps S204and S205. Alternatively, after registration is completed, the Bluetooth agent module105may automatically enable the Bluetooth scanning function in the service transaction process. The Bluetooth agent module105may 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.

(c) Deregistration Process

The registered APP102on the electronic device10may further be deregistered in response to a user operation. The following specifically describes the deregistration process according to this embodiment of this application.FIG.13is a schematic flowchart of deregistration of the APP102according to an embodiment of this application. The deregistration process of the APP102includes steps S401to S406.S401: When detecting that the APP102is uninstalled, the Bluetooth agent module105sends a first notification to the Bluetooth chip101. The first notification indicates the Bluetooth chip101to 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 APP102during registration. For example, the first device identification information included in the registration information of the APP102during registration is the UUID1, the UUID2, the UUID3, and the UUID4. In this case, the first notification indicates the Bluetooth chip101to stop scanning for the UUID1, the UUID2, the UUID3, and the UUID4. After step S402is performed, when detecting that the Bluetooth broadcast signal includes the UUID1, the UUID2, the UUID3, and the UUID4, the Bluetooth chip101considers that the device from which the Bluetooth broadcast signal comes is not registered with the electronic device10, and does not wake up the Bluetooth agent module105.

In this embodiment of this application, the application processor may detect that the APP102is uninstalled, and broadcast a broadcast indicating that the APP102is uninstalled. The Bluetooth agent module105determines, based on the broadcast indicating that the APP102is uninstalled, that the APP102is detected to be uninstalled, and performs step S401.S402: The Bluetooth chip101stops, based on the first notification, scanning for the first device identification information.

The Bluetooth chip101may delete the stored device identification information corresponding to the APP102. In the example of step S401, the Bluetooth chip101may delete the stored UUID1, UUID2, UUID3, and UUID4.S403: The Bluetooth agent module105deletes the registration information of the APP102.

Step S403may alternatively be performed before step S402.

After the deregistration process of the APP102is performed, when detecting that the Bluetooth broadcast signal includes the first device identification information, the Bluetooth chip101considers that the device from which the Bluetooth broadcast signal comes is not registered with the electronic device10. In addition, the Bluetooth agent module105is not woken up, and a Bluetooth channel is not established.

(2) Imperceptible Vehicle Lock Unlocking

This service execution method is based on the system architecture described inFIG.1. For example, the service execution process is to imperceptibly unlock a vehicle lock. A Bluetooth device60may be the vehicle20shown inFIG.1. 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.14is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown inFIG.14, the Bluetooth system includes an electronic device10, the Bluetooth device60(for example, the vehicle20), and a server70. As shown inFIG.14, the electronic device10includes a Bluetooth chip101, a Bluetooth agent module105, an APP102, an OMA API103, an SE104, and a TEE106. The Bluetooth system may include either the SE104that is connected to the OMA API103or the TEE106, or may include both the SE104and the TEE106. The Bluetooth chip101establishes a connection to the Bluetooth agent module105. The Bluetooth agent module105is connected to the TEE106, and the Bluetooth agent module105is connected to the SE104through the OMA API103.

Before the system architecture is used for imperceptible vehicle lock unlocking, a user needs to install the APP102on the electronic device10, and the electronic device10completes 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 APP102, refer to specific descriptions in the example shown inFIG.13. Details are not described herein again.

(d) Registration Process

The following describes the registration process with reference to the system architecture shown inFIG.14and a process shown inFIG.15.FIG.15is a schematic flowchart of the registration process of the APP102according to an embodiment of this application. The registration process of the APP102includes steps S501to S506.S501: When the APP102is installed on the electronic device10, the APP102obtains a first certificate from the server70.

In this embodiment of this application, if an APP ID of the APP102is not stored in the Bluetooth agent module105, the APP102may obtain the first certificate from the server70. The first certificate may be used to prove permission of the APP102to the Bluetooth agent module105.

In a possible implementation, when the APP102is installed on the electronic device10, the APP102may send, to the server70, a message used to request to deliver the first certificate. Then, the server70sends the first certificate to the APP102. In another possible implementation, when the APP102is installed on the electronic device10, the server70delivers the first certificate to the APP102.S502: The APP102sends first registration information and the first certificate to the Bluetooth agent module105.

Optionally, the APP102may further send the first certificate to the Bluetooth agent module105. The first certificate may prove the permission of the APP102to the Bluetooth agent module105, so that permission verification performed on the APP102in step S503succeeds.S503: The Bluetooth agent module105performs permission verification on the APP102based on the first registration information and the first certificate.S504: When the permission verification succeeds, the Bluetooth agent module105sends first device identification information to the Bluetooth chip101.S505: The Bluetooth agent module105detects whether a Bluetooth scanning function of the Bluetooth chip101is enabled.S506: When detecting that the Bluetooth scanning function of the Bluetooth chip101is not enabled, the Bluetooth agent module105enables the Bluetooth scanning function.S507: The Bluetooth chip101performs scanning.

The following describes the first certificate in step S502and 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 module105. The first certificate may include a public key of the server70, a name of the server70, and a digital signature of the certificate authority. When the Bluetooth agent module105performs 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 server70, that is reviewed and issued by an authentication center. Therefore, the first certificate may prove, to the Bluetooth agent module105by using the digital signature of the certificate authority, that the server70is authenticated by the certificate authority.

The Bluetooth agent module105stores 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 S504to S507are performed.

For steps S504to S507, refer to descriptions of steps S203to S206in the example shown inFIG.10. Details are not described herein again.

(e) Service Execution Process

After registration is completed and an account is logged in to, the electronic device10may perform the service execution method according to the embodiments of this application.FIG.16is 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 device60and the SE104is used. Establishment of a Bluetooth channel between the external Bluetooth device60and the TEE106is similar. The service execution method is based on the system architecture shown inFIG.14, and the service execution method includes steps S601to S608.S601: The Bluetooth device60broadcasts 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 device50.S602: The Bluetooth chip101receives the Bluetooth broadcast signal from the Bluetooth device60, and detects whether the device from which the received Bluetooth broadcast signal comes is registered with the electronic device10.

When the electronic device10is in a sleep state (for example, the electronic device10is in a screen-off sleep state), if the Bluetooth chip101detects that the device (the Bluetooth device50) from which the Bluetooth broadcast signal comes is not registered with the electronic device10, the Bluetooth agent module105may be in a sleep state.S603: When detecting that the device from which the Bluetooth broadcast signal comes is registered with the electronic device10, the Bluetooth chip101wakes up the Bluetooth agent module105, and sends the first device identification information.

The Bluetooth agent module105stores the first registration information in step S203in the registration process shown inFIG.10. The Bluetooth agent module105finds the first registration information by using the first device identification information. A {circle around (5)} OPTION in the first registration information may indicate that a data receiving entity is the TEE106, and the Bluetooth chip101does not wake up the APP102after 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 device10, the Bluetooth agent module105may establish a channel to the Bluetooth device60. In this case, the channel between the Bluetooth agent module105and the external Bluetooth device is established by using steps S601to S603, and the Bluetooth agent module105may obtain service information of the TEE106and 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 device10and moves close to the Bluetooth device60. Refer to steps S604to S608. For steps S307to S310, refer to descriptions of steps S105to S108in the example shown inFIG.7. Details are not described herein again.

For example, in a scenario in which the Bluetooth device60unlocks the vehicle lock of the vehicle20, when detecting that a distance between the vehicle20and the electronic device10is less than or equal to a specific distance (for example, 30 meters), the vehicle20may perform steps S601to S603to establish the Bluetooth channel to the Bluetooth agent module105. After the channel between the Bluetooth agent module105and the vehicle20is established by using steps S601to S603, the vehicle20may detect the distance between the electronic device10and the vehicle20in real time. When the vehicle20detects that the distance between the vehicle20and the electronic device10is less than or equal to a specific distance (for example, 10 meters), the vehicle20may perform steps S604to S607to complete a verification process. When the vehicle20detects that the distance between the vehicle20and the electronic device10is less than or equal to a specific distance (for example, 3 meters), step S608is performed to unlock the vehicle lock.S604: The Bluetooth device60sends a ciphertext verification instruction to the Bluetooth agent module105through 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 device60, for example, a digital signature including a private key of the Bluetooth device60. The Bluetooth agent module105may store a public key corresponding to the private key of the Bluetooth device60. After receiving the ciphertext verification instruction, the Bluetooth agent module105first uses the public key to verify the digital signature of the Bluetooth device60. If the verification succeeds, step S605is performed.S605: The Bluetooth agent module105obtains a first ciphertext from an applet of the SE104.S606: The Bluetooth agent module105sends the first ciphertext to the Bluetooth device60through the Bluetooth chip101.

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 device60compares the first ciphertext with a ciphertext in an SE.S608: If the ciphertext comparison succeeds, the Bluetooth device60unlocks the vehicle lock of the Bluetooth device60.

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

In the foregoing service execution method process, the Bluetooth agent module105is started only after the Bluetooth chip101detects that the device (the Bluetooth device60) from which the Bluetooth broadcast signal comes is registered with the electronic device10. The Bluetooth agent module105and an application processor in the electronic device10do not need to be always in a working state, to reduce power consumption and memory usage of the electronic device10.

In the foregoing service execution method process, the Bluetooth channel is directly established between the SE104and the Bluetooth device60without running the APP102, to reduce power consumption and memory usage of the electronic device10.

In the foregoing service execution method process, the user does not need to manually run the APP102. 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 APP102does not need to be kept in a running state, to further reduce power consumption and memory usage of the electronic device10. In this embodiment of this application, the Bluetooth agent module105further 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 S602may be implemented by the user manually turning on the Bluetooth scanning switch1001. Refer toFIG.11(a),FIG.11(b1), andFIG.11(b2). In another possible implementation, the Bluetooth scanning function may alternatively be enabled when the electronic device10detects that the Bluetooth scanning function is not enabled. For example, in the example of the registration process described inFIG.15, the Bluetooth agent module105enables the Bluetooth scanning function by performing steps S505and S506. Alternatively, after registration is completed, the Bluetooth agent module105may automatically enable the Bluetooth scanning function in the service process. The Bluetooth agent module105may 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 APP102may further establish a connection to the SE104through the OMA API103. The {circle around (5)} OPTION in the first registration information may indicate that a data receiving entity is the SE104, and the Bluetooth chip101wakes up the APP102after obtaining the first device identification information through scanning. After step S603, the Bluetooth agent module105wakes up the APP102. The Bluetooth agent module105may establish the channel to the external Bluetooth device60, and the Bluetooth agent module105is connected to the SE104, so that service information (for example, a ciphertext) in the SE104may be transmitted to the Bluetooth device60(for example, the vehicle).

In this embodiment of this application, the Bluetooth device60may further establish a communication connection to the server70, as shown inFIG.14. The Bluetooth device60may exchange service information with the server70through the communication connection. For example, the service information is a fingerprint comparison result from the SE104in the electronic device10.

Specifically, after the channel is established between the Bluetooth agent module105and the external Bluetooth device, if the server70needs to verify a user identity on the electronic device10in the transaction process, for example, verify a fingerprint or a facial image of the user, after the verification is completed, the electronic device10may send a comparison result to the server70through the Bluetooth device60. Fingerprint verification is used as an example. First, the electronic device10compares a detected fingerprint with a pre-stored fingerprint, and stores a comparison result in the SE104of the electronic device10. The Bluetooth agent module105obtains the comparison result from the SE104. The Bluetooth agent module105sends the comparison result to the Bluetooth device60through the Bluetooth connection. The Bluetooth device60sends the comparison result to the server70through the communication connection between the Bluetooth device60and the server70, to complete the transaction process.

It may be understood that the communication connection between the Bluetooth device60and the server70is 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 server70may alternatively not be required in the registration process of the APP102. The Bluetooth agent module105stores the APP_ID of the APP102, and the Bluetooth agent module105may perform permission verification on the APP by using the APP_ID of the APP102. Specifically,FIG.17is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown inFIG.17, the Bluetooth system includes the electronic device10and a Bluetooth device80(for example, the vehicle20). As shown inFIG.17, the electronic device10includes the Bluetooth chip101, the Bluetooth agent module105, the APP102, the OMA API103, the SE104, and the TEE106. The Bluetooth system may include either the SE104that is connected to the OMA API103or the TEE106, or may include both the SE104and the TEE106. The Bluetooth chip101establishes a connection to the Bluetooth agent module105. The Bluetooth agent module105is connected to the TEE106, and the Bluetooth agent module105is connected to the SE104through the OMA API103.

After the APP102is installed on the electronic device10, a registration process needs to be completed for the APP. For the registration process, refer to the embodiment described inFIG.10. The registration process is completed only on the electronic device10. For a service execution process, refer to the embodiment described inFIG.16. 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 inFIG.13. Details are not described herein again.

(3) Automatically Uploading the Data of the Weight Scale

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 device50may be a weight scale90. It may be understood that in this embodiment of this application, a scenario of automatically uploading data of the weight scale90is 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 device10may receive a Bluetooth broadcast signal. An APP102corresponding to the weight scale90may be installed on the electronic device10. The APP102on the electronic device10may establish a channel to the weight scale90by using a Bluetooth broadcast signal, and the weight scale90may upload weight data detected in real time to the APP102. In the foregoing process of uploading the data of the weight scale90, the data of the weight scale90can be imperceptibly uploaded without the user manually operating the APP102on the electronic device10.

FIG.18is a schematic diagram of an architecture of a Bluetooth system according to an embodiment of this application. As shown inFIG.18, the Bluetooth system includes the Bluetooth device (for example, the weight scale90) and the electronic device10.

As shown inFIG.18, the electronic device10includes a Bluetooth chip101, a Bluetooth agent module105, and the APP102. The Bluetooth chip101establishes a connection to the Bluetooth agent module105, and the Bluetooth agent module105establishes a connection to the APP102.

After the APP102is installed on the electronic device10, a registration process needs to be completed for the APP. For the registration process, refer to the embodiment described inFIG.10. The registration process is completed only on the electronic device10.

After registration is completed and an account is logged in to, the electronic device10may perform the service execution method according to the embodiments of this application. FIG.19is a schematic flowchart of a service execution method according to an embodiment of this application. As shown inFIG.19, the service execution method includes steps S701to S706.S701: The Bluetooth device90broadcasts 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 device50.S702: The Bluetooth chip101receives the Bluetooth broadcast signal, and detects whether the device (the Bluetooth device90) from which the Bluetooth broadcast signal comes is registered with the electronic device10.

When the electronic device10is in a sleep state (for example, the electronic device10is in a screen-off sleep state), if the Bluetooth chip101detects that the device (the Bluetooth device90) from which the Bluetooth broadcast signal comes is not registered with the electronic device10, the Bluetooth agent module105may be in a sleep state.S703: When detecting that the device from which the Bluetooth broadcast signal comes is registered with the electronic device10, the Bluetooth chip101wakes up the Bluetooth agent module105, and sends the first device identification information.S704: The Bluetooth agent module105runs the APP102based on the first device identification information and first registration information.

For descriptions of steps S701to S704, refer to specific descriptions of steps S301to S304in the service execution method described inFIG.12AandFIG.12B.

When detecting that the device from which the Bluetooth broadcast signal comes is registered with the electronic device10, the Bluetooth agent module105may establish a channel to the Bluetooth device90by using steps S701to S704. Service information (for example, weight information) from the Bluetooth device90may be transmitted to the Bluetooth agent module105. The Bluetooth agent module105may wake up the APP, and transmit the service information (for example, the weight information) to the APP102.

Optionally, the service information (for example, the weight information) from the external Bluetooth device90may alternatively be received by the Bluetooth chip101in a form of a broadcast signal, and transmitted to the Bluetooth agent module105. Then, the service information is transmitted by the Bluetooth agent module105to the APP102.S705: The Bluetooth device90detects 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 APP102through a Bluetooth connection.S706: The Bluetooth device90sends the weight information to the APP102through a channel between the Bluetooth device90and the APP102.

The APP102may store the weight information, and the APP102may further display the weight information.

In the foregoing method process, in a process of establishing a Bluetooth connection between the Bluetooth device90and the Bluetooth chip101, the Bluetooth agent module105is started only after the Bluetooth chip101detects that the device (the Bluetooth device90) from which the Bluetooth broadcast signal comes is registered with the electronic device10. The Bluetooth agent module105and an application processor in the electronic device10do not need to be always in a working state, to reduce power consumption and memory usage of the electronic device10.

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 APP102. 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 APP102does not need to be kept in a running state, to further reduce power consumption and memory usage of the electronic device10. In this embodiment of this application, the Bluetooth agent module105further 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 device10detects that the Bluetooth scanning function is not enabled. For example, in the example of the registration process, the Bluetooth agent module105enables the Bluetooth scanning function. Alternatively, after registration is completed, the Bluetooth agent module105may automatically enable the Bluetooth scanning function in the service execution process. The Bluetooth agent module105may 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.20is a schematic diagram of a structure of an electronic device10according to an embodiment of this application. The method is performed on the electronic device10. The electronic device10may be the electronic device10in any system architecture inFIG.8,FIG.9,FIG.14,FIG.17, orFIG.18. As shown inFIG.20, the electronic device10includes a Bluetooth chip101and a Bluetooth agent module105. The Bluetooth chip101is connected to the Bluetooth agent module105.

FIG.21is a schematic flowchart of a Bluetooth scanning method according to an embodiment of this application. As shown inFIG.21, based on the electronic device10described inFIG.20and any system architecture inFIG.8,FIG.9,FIG.14,FIG.17, orFIG.18, the Bluetooth scanning method includes steps S801to 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 inFIG.10andFIG.15. Details are not described herein again.

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 device10. 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 device10is in a sleep state (for example, the electronic device10is in a screen-off sleep state), if the Bluetooth chip101detects that a received device identifier is not included in a device identifier list pre-stored in the Bluetooth chip101, the Bluetooth agent module105may be in a sleep state. If the Bluetooth chip101detects that the received first device identifier is included in the device identifier list pre-stored in the Bluetooth chip101, the Bluetooth chip101wakes up the Bluetooth agent module105, and sends the first device identifier to the Bluetooth agent module105. In the foregoing Bluetooth scanning method, the Bluetooth agent module105is started only when the Bluetooth chip101obtains the first device identifier in the device identifiers through scanning. In the electronic device10, the Bluetooth agent module105and an application processor do not need to be always in a working state, to reduce power consumption and memory usage of the electronic device10.

In the foregoing Bluetooth scanning method, the Bluetooth agent module105may run an APP102, and a user does not need to manually run the APP102. In this way, an execution process is imperceptible to the user, and convenience of the service execution process is improved. The Bluetooth agent module105may run the APP102, but the APP102does not need to be always run on the electronic device10, and the APP102may be stopped running by the application processor, to further reduce power consumption and memory usage of the electronic device10.

In the foregoing Bluetooth scanning method, the Bluetooth agent module105may be connected to an SE, and directly establishes a Bluetooth channel between the Bluetooth chip101and a Bluetooth device without running the APP102, to further reduce power consumption and memory usage of the electronic device10. The Bluetooth agent module105further provides a Bluetooth scanning management platform for a Bluetooth-related service execution process.

The Bluetooth agent module105may be connected to the SE, and directly establishes a Bluetooth channel between the Bluetooth chip101and a Bluetooth device60without running the APP102, to further reduce power consumption and memory usage of the electronic device10.

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 module105may establish the channel to the external Bluetooth device (the first device), and the Bluetooth agent module105is 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 inFIG.16.

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 inFIG.16. Details are not described herein again.

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.

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 inFIG.16.

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 inFIG.19. Details are not described herein again.

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 inFIG.12AandFIG.12B. Details are not described herein again.

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 S202in the example described inFIG.10. Details are not described herein again.

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 S202in the example described inFIG.10. Details are not described herein again.

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 S501to S503in the example described inFIG.15. Details are not described herein again.

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 inFIG.13. Details are not described herein again.

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 module105may be a Wi-Fi agent module. Similar to the Bluetooth agent module105, 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.

The foregoing descriptions are merely specific implementations of the embodiments of this application, but are not intended to limit the protection scope of the embodiments of this application. Any variation or replacement within the technical scope disclosed in the embodiments of this application shall fall within the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application shall be subject to the protection scope of the claims.