Bluetooth data processing method and related equipment

By combining the Bluetooth module and the freeze control module, Bluetooth data is unfrozen and processed according to the target identifier, which solves the high power consumption problem caused by the long-term operation of applications in electronic devices, and realizes timely processing of Bluetooth data and reduced power consumption.

CN122002251APending Publication Date: 2026-05-08HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-11-06
Publication Date
2026-05-08

AI Technical Summary

Technical Problem

Applications in electronic devices consume resources when running for extended periods, leading to high power consumption and reduced battery life, especially when connected to external devices via Bluetooth, resulting in delayed data response.

Method used

After receiving data packets via Bluetooth connection, the target application is unfrozen based on the target identifier and frozen again after data processing. By using the Bluetooth module and the freeze control module in conjunction, the application can be frozen and unfrozen, adapting to the Bluetooth Low Energy protocol to ensure timely data processing.

Benefits of technology

It reduces the power consumption of electronic devices, improves the ability to process Bluetooth data in a timely manner, avoids data packet loss, and extends the usage time of devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122002251A_ABST
    Figure CN122002251A_ABST
Patent Text Reader

Abstract

The embodiment of the invention is applied to the field of communication, and provides a Bluetooth data processing method and related equipment, the method is applied to first electronic equipment, and the method comprises the following steps: receiving a Bluetooth data packet sent by second electronic equipment through Bluetooth connection between the first electronic equipment and the second electronic equipment, the Bluetooth data packet carries a target identifier and target data; unfreezing the target application program under the condition that the target application program represented by the target identifier is in a frozen state; and processing the target data through the unfrozen target application program. Based on the technical method provided by the invention, the power consumption of the electronic equipment can be reduced while the timeliness of processing the data packet sent by the second electronic equipment and received through Bluetooth by the application program can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and more specifically, to a Bluetooth data processing method and related equipment. Background Technology

[0002] With the increasing popularity of wearable devices (such as smartwatches and fitness trackers), Bluetooth headsets, and other external devices, more and more people are using them to make and receive calls, monitor exercise and health data, and switch songs on their phones.

[0003] Mobile phones and other electronic devices establish Bluetooth connections with external devices to enable communication between them. The electronic device can have one or more applications running, which can process data sent by the external device via Bluetooth.

[0004] However, applications running on electronic devices for extended periods consume significant resources and power, reducing the device's battery life. Summary of the Invention

[0005] This application provides a Bluetooth data processing method and related device, which can reduce the power consumption of electronic devices while ensuring the timeliness of the application's processing of data packets sent by a second electronic device received via Bluetooth.

[0006] In a first aspect, a Bluetooth data processing method is provided, applied to a first electronic device. The method includes: receiving a Bluetooth data packet sent by the second electronic device via a Bluetooth connection between the first electronic device and the second electronic device, the Bluetooth data packet carrying a target identifier and target data; unfreezing the target application if the target application represented by the target identifier is in a frozen state; and processing the target data through the unfrozen target application.

[0007] The Bluetooth data processing method provided in this application allows the application to be frozen when a Bluetooth connection exists between the first and second electronic devices, reducing the power consumption of the electronic devices. Furthermore, after receiving Bluetooth data packets via this Bluetooth connection, the application represented by the target identifier in the Bluetooth data packet is promptly unfrozen based on the target identifier, ensuring the timely processing of target data in Bluetooth data packets sent by the second electronic device received via Bluetooth.

[0008] In some possible implementations, the target application is frozen after it processes the target data, and the Bluetooth connection exists between the first electronic device and the second electronic device when the target application is frozen.

[0009] When an electronic device is connected to another electronic device via Bluetooth, the applications on that electronic device can be frozen, thereby reducing the power consumption of the electronic device.

[0010] In some possible implementations, the first electronic device includes a Bluetooth module and a freeze control module; the method further includes: after receiving the Bluetooth data packet through the Bluetooth module, sending the target data to the target application and sending a target application identifier to the freeze control module, the target application identifier being used to identify the target application and determined based on the target identifier; and through the freeze control module, determining whether the target application is in a frozen state based on the target application identifier.

[0011] In Bluetooth technology, after receiving a Bluetooth data packet, the Bluetooth module sends target data to the target application represented by the target identifier in the Bluetooth data packet. After identifying the target application, the Bluetooth module adds a step of sending a target application identifier to the freeze control module, enabling the freeze control module to promptly unfreeze the target application from its frozen state. In other words, the freeze control module reuses the Bluetooth module's process of obtaining the target application identifier, making it more adaptable to Bluetooth technology.

[0012] It should be understood that the target application identifier can be either the target identifier or the application identifier corresponding to the target identifier. For example, the freeze control module can be a freeze control application.

[0013] In some possible implementations, the target identifier is a target feature value identifier, and the method further includes: determining, through the Bluetooth module, the target application identifier as the application identifier corresponding to the target identifier based on a first correspondence between the feature value identifier and the application identifier.

[0014] When the target identifier is a feature value identifier, the target application identifier corresponding to the target identifier can be determined based on the first correspondence between the feature value identifier and the application identifier. In Bluetooth technology, feature value identifiers can be used to identify different functions or data types. Each application corresponding to a feature value identifier can process the feature value data corresponding to that feature value identifier. After the Bluetooth module determines the target application identifier based on the target feature value identifier, it sends the target application identifier to the freeze control module, enabling the freeze control module to promptly thaw the target application if the target application identified by the target application identifier is in a frozen state.

[0015] In some possible implementations, where the Bluetooth connection is established based on the Bluetooth Low Energy protocol, in the first correspondence, the application identifier corresponding to each feature value identifier indicates that the application has subscribed to the update information of the feature value corresponding to that feature value identifier in the Bluetooth module, and the target data is the target feature value corresponding to the target feature value identifier.

[0016] When a Bluetooth connection is established based on the Bluetooth Low Energy protocol, the target application can subscribe to the update information of the feature value corresponding to the target feature value identifier in the Bluetooth module. That is, the target application can register to monitor the update of the feature value corresponding to the target identifier.

[0017] When a Bluetooth connection is established based on the Bluetooth Low Energy protocol, the Bluetooth module can include a Target General Attribute Specification Service. After receiving Bluetooth data packets, the Bluetooth module can update the feature value corresponding to the target feature identifier in the Target General Attribute Specification Service to the target feature value. Through the Target General Attribute Specification Service, first update information can be sent to the target application identified by the target application identifier. The first update information can include the updated feature value corresponding to the target feature identifier; that is, the first update information can include target data. Therefore, when a Bluetooth connection is established based on the Bluetooth Low Energy protocol, the Bluetooth module, upon receiving Bluetooth data packets, can promptly unfreeze the target application used to process the target data in the Bluetooth data packets.

[0018] In some possible implementations, the Bluetooth module includes at least one general attribute specification service, each general attribute specification service maintaining at least one feature value identifier, and the at least one feature value identifier maintained by a target general attribute specification service among the at least one general attribute specification services includes the target feature value identifier; the step of determining the target application identifier as the application identifier corresponding to the target identifier through the Bluetooth module according to a first correspondence between the feature value identifier and the application identifier includes: determining the target application identifier as the application identifier corresponding to the target identifier through the target general attribute specification service according to the first correspondence, wherein the first correspondence represents the application identifier corresponding to each feature value identifier among the at least one feature value identifier maintained by the target general attribute specification service.

[0019] The first correspondence can be recorded in the general attribute specification service, thus making the use of the first correspondence more adaptable to the Bluetooth Low Energy protocol in Bluetooth technology.

[0020] In some possible implementations, the step of receiving the Bluetooth data packet via the Bluetooth module and then sending the target data to the target application includes: sending first update information to the target application via the Bluetooth module, the first update information including the target feature value; and repeatedly sending the first update information to the target application via the Bluetooth module if no response to the first update information is received from the target application, until a response to the first update information is received from the target application, at which point the sending of the first update information ends.

[0021] The update information subscribed to by the application can be either a notification or an indication. In scenarios where a target application is unfrozen based on the target identifier in the Bluetooth data packet, there might be a situation where the Bluetooth module has already sent the first update information, including the target data, to the target application, but the unfreezing process is not yet complete. In this case, the unfrozen target application cannot receive the target data, and even after unfreezing, it cannot process the target data, effectively resulting in packet loss. To avoid packet loss, the update information subscribed to by the application can be of the indication type. This allows the Bluetooth module to repeatedly send the first update information if it does not receive a response from the target application. Once unfrozen, the target application can receive the first update information and send a response to the Bluetooth module, thus avoiding packet loss.

[0022] In some possible implementations, the target application identifier is the user identifier, process identifier, or package name of the target application.

[0023] In some possible implementations, the Bluetooth module further includes a marker module. After receiving the Bluetooth data packet through the Bluetooth module, sending the target data to the target application and sending the target application identifier to the freeze control module includes: sending the target application identifier to the freeze control module through the marker module.

[0024] By adding a dotting module to the Bluetooth module and communicating with the freeze control module through inter-process communication, the freeze control module can unfreeze the target application in a timely manner, ensuring the timely processing of target data in the Bluetooth data packets sent by the second electronic device.

[0025] In some possible implementations, the target data is processed by the target application while the target application is running.

[0026] In a second aspect, a Bluetooth data processing device is provided, including a unit for performing the method of the first aspect. This device may be a terminal device or a chip within a terminal device.

[0027] Thirdly, an electronic device is provided, including a memory and a processor, the memory for storing a computer program, and the processor for calling and running the computer program from the memory, causing the electronic device to perform the method of the first aspect.

[0028] Fourthly, a chip is provided, including a processor and a data interface, wherein the processor reads instructions stored in a memory through the data interface to implement the method of the first aspect.

[0029] Fifthly, a computer-readable storage medium is provided, the computer-readable storage medium storing computer program code for implementing the method of the first aspect.

[0030] In a sixth aspect, a computer program product is provided, the computer program product comprising: computer program code, the computer program code being used to implement the method of the first aspect. Attached Figure Description

[0031] Figure 1 This is a schematic diagram of a communication scenario according to an embodiment of this application;

[0032] Figure 2 This is a schematic flowchart of a method for controlling the freeze of an application.

[0033] Figure 3 This is a schematic diagram of a software system applicable to an electronic device of this application;

[0034] Figure 4 This is a schematic flowchart of a Bluetooth data processing method provided in an embodiment of this application;

[0035] Figure 5 This is a schematic flowchart of another Bluetooth data processing method provided in an embodiment of this application;

[0036] Figure 6 This is a schematic flowchart illustrating another Bluetooth data processing method provided in the embodiments of this application;

[0037] Figure 7 This is a schematic flowchart illustrating another Bluetooth data processing method provided in the embodiments of this application;

[0038] Figure 8 This is a schematic diagram of a hardware system for an electronic device applicable to this application. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0040] It should be understood that "at least one" in this application refers to one or more items, and "more than one" refers to two or more items. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist, for example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, to facilitate a clear description of the technical solutions of this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first," "second," etc., do not limit the quantity or execution order, and that "first," "second," etc., do not necessarily imply differences.

[0041] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0042] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties (e.g., the user has given explicit consent, the user has been notified, etc.), and the collection, use and processing of the relevant data must comply with the relevant regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0043] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0044] With the rapid development of electronic technology, wearable devices (such as smartwatches and fitness trackers), Bluetooth headsets, and other peripheral devices are able to perform an increasing number of functions, greatly enriching people's daily lives. External devices extend the functionality of electronic devices, making them more convenient for users.

[0045] like Figure 1 As shown, external device 301 and electronic device 302 can communicate via Bluetooth (BT). Electronic device 302 can have one or more applications running, which can process data sent by external device 301 via Bluetooth.

[0046] For example, external device 301 can send step count information to electronic device 302. A fitness and health application in electronic device 302 can record the step count information and display the exercise information in the user interface provided by the fitness and health application. Alternatively, external device 301 can send clock information to electronic device 302. The clock application in electronic device 302 can compare the received first clock information with the recorded second clock information. If the received first clock information differs from the recorded second clock information in electronic device 302, it can send the second clock information to external device 301.

[0047] For example, both external device 301 and electronic device 302 include some kind of instant messaging application. When a user edits text and clicks send using the instant messaging application in external device 301, external device 301 can send an instant messaging message to electronic device 302, which includes the text edited by the user. The instant messaging application in electronic device 302 can process the messaging message and send the text edited by the user.

[0048] The existence of Bluetooth interaction between external device 301 and electronic device 302 restricts the freezing control policy of electronic device 302 for one or more applications.

[0049] Application freeze management policies are used to control the freezing and unfreezing of applications on electronic devices. Freezing an application means temporarily halting the operation of infrequently used applications on an electronic device, releasing or distributing memory, processor resources, etc., allocated to the application by the operating system. A frozen application does not exit, nor does it affect its data or settings; it is simply temporarily suspended. It can be unfrozen and restored at any time when needed. Application freeze can be understood as a system-level resource management and state preservation mechanism. When an application is frozen, its state data, including user settings, progress, and cache, is saved. This state data is restored after the application is unfrozen, allowing users to continue using the application without starting from scratch. When an application is unfrozen, the system can read the previously saved state data and restore the application to its pre-freeze state. This means users can continue their previous work or game without losing any progress or data.

[0050] If one or more applications that process data sent by external devices via Bluetooth connection are in a frozen state, they may be unable to respond to data sent by external devices via Bluetooth connection in a timely manner, which may cause the external devices to malfunction.

[0051] In some embodiments, to ensure that the application can respond promptly to data sent via Bluetooth, the application is typically not frozen once a Bluetooth connection is established between the electronic device and the external device. For example, if the external device 301 is a wearable device and the application in the electronic device 302 that can process data sent by the wearable device via Bluetooth is a fitness and health application, then... Figure 2 The illustrated embodiment describes a method for controlling application freeze.

[0052] Figure 2 This is a schematic flowchart of a method for controlling the freeze of an application. Figure 2 The method shown includes steps S210 to S250.

[0053] Step S210: Determine whether the sports and health application is running in the foreground.

[0054] For example, step S210 can be performed periodically or non-periodically.

[0055] Foreground and background operation are two different states in which an application runs on an electronic device. An application running in the foreground means that it is currently displayed on the screen and is receiving user actions and input. When the user performs certain actions, such as clicking buttons on the screen, scrolling through pages, or typing text, the application responds to these actions. When an application is running in the background, it does not occupy the screen, and the user cannot directly interact with it. Background applications can perform tasks such as receiving notifications, playing music, downloading files, and updating data, all of which can be done without interfering with the user.

[0056] If the health and fitness app is running in the foreground, this freeze control process can be terminated. Foreground applications can utilize all available system resources, including CPU processing time and network resources.

[0057] If the health and fitness application is not running in the foreground, but rather in the background, step S220 can be performed. For applications running in the background, it can be determined whether to freeze the application.

[0058] Step S220: Determine whether the Health app is outputting an audio stream.

[0059] If the Health app is outputting an audio stream, the freeze control process can be terminated. If the Health app is not outputting an audio stream, step S230 can be performed.

[0060] Step S230: Determine whether the pedometer function of the fitness app is enabled.

[0061] The pedometer function records a user's steps, helping them understand their daily activity level. When the pedometer function is enabled, the fitness app can determine the user's step count based on the output of the accelerometer sensor.

[0062] To enable the pedometer function, the current freeze control process can be terminated when the pedometer function is enabled.

[0063] If the pedometer function is not enabled, step S240 can be performed.

[0064] Step S240: Determine whether a Bluetooth connection exists with an external device.

[0065] When a Bluetooth connection exists between the electronic device and an external device, the fitness and health application can process data in Bluetooth data packets transmitted from the external device to the electronic device. To ensure proper processing of the data in the Bluetooth data packets by the fitness and health application, the current freeze control process can be terminated when a Bluetooth connection exists between the electronic device and the external device.

[0066] If there is no Bluetooth connection between the electronic device and the external device, step S260 can be performed. Alternatively, if other conditions are set in the electronic device, step S250 can be performed.

[0067] Step S250: Determine whether other conditions are met.

[0068] If other conditions are not met, the current freeze control process can be terminated. If other conditions are met, step S260 can be performed.

[0069] Step S260: Freeze the Sports Health app.

[0070] In other words, for fitness and health apps, if there is a Bluetooth connection between the electronic device and an external device, the fitness and health app will not be frozen.

[0071] However, when there is a Bluetooth connection between the electronic device and the external device, the health and fitness application will still consume a lot of resources and generate a lot of power when it is running for a long time, which reduces the usage time of the electronic device given the limited energy stored in the electronic device.

[0072] To address the aforementioned problems, embodiments of this application provide a Bluetooth data processing method, such as... Figure 4As shown. The execution subject of the method provided in this application can be an electronic device, or a software / hardware module in the electronic device capable of image acquisition. For ease of explanation, the following embodiments use an electronic device as an example.

[0073] Figure 4 This is a schematic flowchart of a Bluetooth data processing method provided in an embodiment of this application. Figure 4 The method 500 shown includes steps S410 to S430. Figure 4 The method shown can be applied to a first electronic device.

[0074] Step S410: Through the Bluetooth connection between the first electronic device and the second electronic device, receive the Bluetooth data packet sent by the second electronic device. The Bluetooth data packet carries the target identifier and target data.

[0075] The first electronic device and the second electronic device can be different terminal devices. For example, the second electronic device can be an external device of the first electronic device.

[0076] Bluetooth connections between a first electronic device and a second electronic device can be established based on the Bluetooth Low Energy (BLE) protocol. The attribute protocol (ATT) is one of the core protocols in BLE technology, defining how BLE devices organize and exchange attribute information, and is an important component of the BLE protocol stack. Bluetooth connections established based on BLE technology can also be understood as connections established based on BLE ATT.

[0077] Bluetooth connections between a first electronic device and a second electronic device can also be established using the basic socket protocol. The socket protocol can also be called the basic rate (BR) socket protocol or the BR protocol.

[0078] The target data in the Bluetooth data packet can be data generated by the second electronic device or data forwarded by the second electronic device. For example, the target data may include data collected by sensors in the second electronic device, or it may include data determined by user operation. The target data may be sent from the operating system of the second electronic device to the first electronic device, or it may be sent from an application in the second electronic device to the first electronic device.

[0079] Applications on electronic devices can be in a running, frozen, or closed state. Launching a closed application brings it into a running state. Running applications can run in the foreground or background. Freezing a running application freezes it; this is also called a suspended or paused state. When an application is frozen, the system temporarily stops its operation and may limit its resource usage. Unfreezing an application restores its running state. Closing an application, whether running or frozen, closes it. It should be understood that under normal electronic device operation, applications in a running or frozen state will not be closed unless instructed by the user.

[0080] If the target application represented by the target identifier is in a frozen state, step S420 can be performed, followed by step S430. If the target application represented by the target identifier is in a running state, step S430 can be performed.

[0081] Step S420: Unfreeze the target application.

[0082] Step S430: Process the target data through the target application.

[0083] After a Bluetooth connection is established between the first electronic device and the second electronic device, the target application can be in a running or frozen state. For example, the first electronic device may have at least one application stored. This at least one application may include the target application. After the first electronic device and the second electronic device establish a Bluetooth connection, the first electronic device can determine whether the at least one application is in a closed state. If any of the at least one application is in a closed state, the first electronic device can launch that application.

[0084] In some embodiments, the at least one application may be an application corresponding to a second electronic device. The at least one application may be different for different electronic devices. The first electronic device may determine whether the at least one application corresponding to each electronic device is in a closed state when a Bluetooth connection is established with each electronic device. The application corresponding to the second electronic device can be understood as an application in the first electronic device used to process Bluetooth data sent by the second electronic device via the Bluetooth connection. It should be understood that the at least one application corresponding to the second electronic device may be user-set, determined based on application information sent by the second electronic device, or an application corresponding to the device category to which the second electronic device belongs.

[0085] For example, after the first electronic device and the second electronic device establish a Bluetooth connection, the second electronic device can send application information to the first electronic device through this Bluetooth connection. This application information represents at least one application corresponding to the second electronic device. The at least one application corresponding to the second electronic device can be understood as an application in the first electronic device used to process the data sent by the second electronic device via the Bluetooth connection.

[0086] In other embodiments, the at least one application may also be an application recorded in the first electronic device for processing Bluetooth data sent from other electronic devices. The at least one application may be user-configured or preset in the first electronic device. The first electronic device may determine whether the at least one application is in a closed state when a Bluetooth connection is established with each electronic device. Alternatively, the first electronic device may determine whether the at least one application is in a closed state when a Bluetooth connection is established with one electronic device and no Bluetooth connection exists with other electronic devices.

[0087] For an application that is running, the first electronic device can freeze it, thus freezing the application. Therefore, after a Bluetooth connection is established between the first and second electronic devices, each application in at least one application recorded by the first electronic device can be either running or frozen. That is, the target application can be either running or frozen when the first electronic device receives Bluetooth data packets.

[0088] Alternatively, the target application may begin running after the first electronic device initiates the application based on the user's startup action. From the start of the target application until the first electronic device receives Bluetooth data packets, the first electronic device does not close the target application; therefore, the target application may be running or frozen when the first electronic device receives Bluetooth data packets.

[0089] After the target application processes the target data in step S430, that is, after the target application has completed processing the target data, the target application can be frozen.

[0090] For example, after the target application processes the target data, the target application can be frozen if the freezing conditions are met. For instance, freezing conditions could include the target application running in the background or the target application not outputting an audio stream. It should be understood that the same or different freezing conditions can be set for different applications.

[0091] When freezing a target application, a Bluetooth connection may or may not exist between the first electronic device and the second electronic device. That is, even when a Bluetooth connection exists between the first and second electronic devices, the target application that processes data in the data packets transmitted via the Bluetooth connection can still be frozen, thereby reducing the power consumption of the first electronic device where the target application resides.

[0092] After two electronic devices establish a Bluetooth connection, one of them can periodically or non-periodically send heartbeat packets to the other. A heartbeat packet is a short data packet used to confirm the connection status. Upon receiving a heartbeat packet, the other electronic device sends a response data packet to the first device. If the first device does not receive a response data packet within a first preset time period, it can determine that the Bluetooth connection has been broken, meaning there is no Bluetooth connection between the two electronic devices. If the other electronic device does not receive a heartbeat packet within a second preset time period, it can also determine that the Bluetooth connection has been broken. After the Bluetooth connection is established, the electronic device can determine that the Bluetooth connection exists before determining that it has been broken. The first and second preset time periods can be equal or unequal. For the Bluetooth connection between the first and second electronic devices, the first electronic device can be either the one sending the heartbeat packet or the one sending the response data packet.

[0093] The Bluetooth data processing method provided in this application embodiment can also freeze the target application used for processing Bluetooth data, thereby reducing the power consumption of the electronic device. When the target application represented by the target identifier in the received Bluetooth data packet is in a frozen state, the electronic device unfreezes the target application. After the target application is unfrozen, it can process the target data in the Bluetooth data packet, improving the timeliness of the target application's processing of Bluetooth data.

[0094] The Bluetooth data processing method provided in this application embodiment can be applied to electronic devices. For ease of understanding, the software system of the electronic device will be described below.

[0095] The software system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses the layered architecture Android system as an example to illustrate the software structure of an electronic device.

[0096] Figure 3 This is a software architecture block diagram of an electronic device according to an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer and the kernel layer. The application layer may include a series of application packages.

[0097] like Figure 3 As shown, the application layer can include applications such as camera, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, photo album, freeze control, fitness and health.

[0098] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0099] like Figure 3 As shown, the application framework layer may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0100] The window manager manages window programs. It can obtain the screen size, determine the presence of a status bar, lock the screen, and capture screenshots. The content provider stores and retrieves data, making this data accessible to applications. The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon can include views for displaying text and views for displaying images. The phone manager provides communication functionality for the electronic device 100. The resource manager provides various resources for applications. The notification manager allows applications to display notification information in the status bar, which can be used to convey informational messages and can disappear automatically after a short pause without user interaction.

[0101] The Android runtime consists of core libraries and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system.

[0102] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0103] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0104] The kernel layer is the layer between hardware and software. The kernel layer can include driver modules. Driver modules can include display drivers, camera drivers, audio drivers, and sensor drivers, etc.

[0105] Electronic device 100 may also include a Bluetooth module. The Bluetooth module is an important part of the Android system. The Bluetooth module as a whole does not directly correspond to a specific layer of the operating system (such as the kernel layer, system layer, etc.). The Bluetooth module can generally be understood as an independent component or subsystem, including parts located in multiple layers of the Android system. That is, the Bluetooth module interacts with multiple layers of the Android system. The Bluetooth module is responsible for handling the underlying protocols and data transmission of Bluetooth communication. The Bluetooth module can also be called the Bluetooth protocol stack or the Bluetooth process. For example, the Bluetooth module may include a first submodule located in the application framework layer and a second submodule located in the kernel layer. Alternatively, the Bluetooth module may include more or fewer submodules.

[0106] A Bluetooth module can be understood as a set of protocols and specifications that define the rules and standards for communication between Bluetooth devices. The Bluetooth module is responsible for handling all aspects of Bluetooth communication, including data encapsulation, transmission, reception, and decapsulation. The Bluetooth module can interact directly with the Bluetooth receiver, controlling the operation of the Bluetooth hardware to achieve Bluetooth communication. Alternatively, the Bluetooth module can also interact with the Bluetooth receiver through the kernel layer.

[0107] Bluetooth data packets sent by external devices can include a target identifier and target data. A Bluetooth transceiver in an electronic device can receive Bluetooth data packets and send them to the processor.

[0108] The Bluetooth module in the processor can process Bluetooth data packets sent by external devices. Based on the target identifier, the Bluetooth module can determine the target application identifier, send application information to the freeze control application, and send target data to the sports and health application represented by the target identifier. The freeze control application, when the sports and health application identified by the target application identifier is in a frozen state, will unfreeze the sports and health application. This allows the sports and health application to process the target data in a timely manner.

[0109] It should be understood that the execution subject of the Bluetooth data processing method provided in this application can be an electronic device or a software / hardware module in an electronic device capable of Bluetooth data processing. For ease of explanation, the following embodiments use an electronic device as an example.

[0110] The first electronic device may have, for example Figure 3 The software architecture is shown below. Figure 5 As shown, the first electronic device may include a Bluetooth module 510, a freeze control application 520, and a target application 530.

[0111] Before proceeding to step S501, the Bluetooth module 510 can establish a Bluetooth connection with the second electronic device. After the Bluetooth connection is established, the Bluetooth module 510 can send Bluetooth connection information to the application control module. The application control module can be the freeze control application 520 or other modules. In response to receiving the Bluetooth connection information, the application control module can determine whether each application in at least one application is in a running state or a frozen state. In the at least one application, for applications that are not in a running state and are not in a frozen state, i.e., applications that are in a closed state, the application control module can start the running of that application. Thus, after the first electronic device and the second electronic device establish a Bluetooth connection, the application corresponding to the device identifier of the second electronic device is in a running state or a frozen state.

[0112] During the process of establishing a Bluetooth connection with the second electronic device, the Bluetooth module 510 can obtain the device identifier of the second electronic device. After the Bluetooth connection is established, the Bluetooth module 510 can send Bluetooth connection information to the application control module, which may include the device identifier of the second electronic device. Based on the correspondence between the device identifier and the application, the application control module can determine at least one application corresponding to the device identifier of the second electronic device, and determine whether each application in the at least one application is in a running state or a frozen state.

[0113] The Bluetooth connection information sent by the Bluetooth module 510 to the application control module may also include target category information of the device category to which the second electronic device belongs. Based on the correspondence between the category information and the application, the application control module can determine at least one application corresponding to the target category information, and determine whether each application in the at least one application is running or frozen.

[0114] For example, the freeze control application 520 may record applications that are running and applications that are frozen in the first electronic device. For instance, the freeze control application 520 may record a running list and a frozen list. The running list records applications that are running in the first electronic device. The application control module may interact with the freeze control application 520. The application control module may send application status request information to the freeze control application 520. The application status request information may include the application identifier of each of the at least one determined applications. The freeze control application 520 may send application status response information to the application control module. The application status response information may include whether the application identified by each received application identifier is in a closed state.

[0115] When a Bluetooth connection exists between the first electronic device and the second electronic device, the Bluetooth module 510 can also be used to detect the Bluetooth connection. After the first electronic device and the second electronic device establish a Bluetooth connection, the Bluetooth module 510 in the first electronic device can periodically or non-periodically send heartbeat packets to the second electronic device. If no response data packet is received from the second electronic device within a first preset time period, it can be determined that the Bluetooth connection between the first electronic device and the second electronic device has been broken. Alternatively, after the first electronic device and the second electronic device establish a Bluetooth connection, the Bluetooth module 510 in the first electronic device can receive heartbeat packets periodically or non-periodically sent by the second electronic device. If no heartbeat packet is received from the second electronic device within a second preset time period, it can be determined that the Bluetooth connection between the first electronic device and the second electronic device has been broken.

[0116] The Bluetooth module 510 can perform steps S501 to S504.

[0117] In step S501, the Bluetooth module 510 receives Bluetooth data packets.

[0118] Bluetooth data packets carry target identifiers and target data.

[0119] In step S502, the Bluetooth module 510 identifies the application represented by the target identifier as the target application.

[0120] The Bluetooth module can identify the target application based on the target identifier.

[0121] The target application identifier can be a target identifier. Alternatively, the target application identifier can be the application identifier corresponding to the target identifier.

[0122] In step S503, the Bluetooth module 510 sends a target application identifier to the freeze control application 520. The target application identifier is used to uniquely identify the target application.

[0123] The target application identifier and the target identifier may be the same or different.

[0124] The target application identifier can be a user identifier (UID), a process identifier (PID), or an application package name, etc.

[0125] In an operating system, there is a one-to-one correspondence between a UID and an application. When an application is installed on an electronic device, it is assigned a unique UID. When an application is upgraded, its UID remains unchanged. When an application is uninstalled, its UID is also released and may be reassigned to other newly installed applications.

[0126] In an operating system, each running program (such as an application or system program) can be understood as a process. A process can be an execution instance of various types of programs or tasks. A Process ID (PID) is a number used by the operating system to uniquely identify a process. PID allocation is typically done by the operating system when a process is created; each newly created process is assigned a unique PID. The PID may be reassigned to a new process after the previous one terminates; therefore, the PID is not a persistent identifier.

[0127] In an operating system, an application package name is a name used to uniquely identify an application. The application package name is a string, typically composed of several parts, and named in the form of a reverse domain name. The package name is a unique identifier for an application within the system, ensuring that application names from different developers do not conflict.

[0128] For example, the Bluetooth module 510 may include a tagging module. The tagging module can be used to perform step S503. The tagging module can send a target application identifier to the freeze control application 520 via inter-process communication. For example, the tagging module can send the target application identifier to the freeze control application 520 via Binder.

[0129] Binder is an inter-process communication (IPC) mechanism in the Android system. Binder calls allow one process to request services from another process, enabling inter-process interaction and communication. This mechanism provides an efficient, secure, and reliable communication method, allowing seamless data exchange and calls between different components and applications. In the Android system, the Binder mechanism is widely used for communication between various system services (such as sensor services, location services, and network services), as well as for interaction between applications and system services.

[0130] In step S504, the Bluetooth module 510 transmits target data to the target application 530.

[0131] In other words, the Bluetooth module 510 sends target data to the target application through steps S502 to S503, and sends the target application identifier to the freeze control application 520. The target application identifier is used to identify the target application.

[0132] The freeze control application 520 can proceed to step S505. The Bluetooth module 510 performing step S504 and the freeze control application 520 performing steps S505 to S506 can be performed in parallel. Alternatively, step S504 can begin before or after the freeze control application 520 performs steps S505 to S506. For example, the Bluetooth module 510 can begin performing steps S503 and S504 simultaneously. Alternatively, step S504 can also be performed before or after step S503, for example, step S504 can be performed after steps S503, S505, and S506.

[0133] Step S505, freeze control application 520 determines whether the target application 530 represented by the target identifier is in a frozen state.

[0134] When a Bluetooth connection exists between the first and second electronic devices, the target application can be in a frozen or running state. The freeze control application can freeze applications that are currently running on the electronic device. For example, for a fitness and health application, the freeze control application 520 can... Figure 2 The freeze control method for the application shown includes steps S210 to S230, and steps S250 to S260 are performed if it is determined in step S230 that the pedometer function is not enabled. In other words, for freeze control of fitness apps or other applications, the existence of a Bluetooth connection between the first electronic device and the second electronic device containing the application is no longer a condition for determining whether to freeze the application.

[0135] The freeze control application determines whether the target application 530 is in a frozen state based on the received target application identifier. When the freeze control application 520 freezes an application, it can record the application's identifier. For example, the freeze control application can record the application's identifier in a freeze list. Therefore, if the freeze control application records the target application identifier, for example, if the freeze list includes the target application identifier, the freeze control application 520 can determine that the target application 530 is in a frozen state. If the target application identifier is not recorded, the freeze control application 520 can determine that the target application 530 is not in a frozen state.

[0136] If the target application 530 is not in a frozen state, the freeze control application 520 may not perform further processing. If the target application 530 is in a frozen state, the freeze control application 520 may proceed to step S506.

[0137] Step S506: Freeze the control application 520 and unfreeze the target application 530.

[0138] After the freeze control application 520 unfreezes the target application 530, the unfrozen target application 530 can proceed to step S507. Alternatively, the target application 530, which is not in a frozen state, can proceed to step S507.

[0139] Step S507: Process the target data.

[0140] The Bluetooth module determines the target application based on the target identifier in the received Bluetooth data packet before sending it. According to the Bluetooth data processing method provided in this application, after determining the target application, the Bluetooth module sends a target application identifier to the freeze control application. By adding this step of sending the target application identifier to the freeze control application to the Bluetooth module's processing flow, the freeze control application can unfreeze the target application when it is in a frozen state. This allows the target application to process the target data in the Bluetooth data packet in a timely manner. The modification to the Bluetooth module's Bluetooth data packet processing flow is minimal, exhibiting strong applicability and compatibility.

[0141] After step S506, the freeze control application 520 can also freeze the target application. For example, the freeze control application 520 can freeze the target application after it has processed the target data. The freeze control application 520 can determine whether the target application meets the freeze conditions, and freeze the target application if the freeze conditions are met. Freeze conditions may include the completion of target data processing by the target application.

[0142] The implementation of each step by the Bluetooth module 510 differs depending on whether the Bluetooth connection between the first and second electronic devices is established using the socket protocol or the BLE protocol. The following sections will explain the differences. Figure 6 and Figure 7 The two embodiments are described separately.

[0143] When the Bluetooth connection between the first electronic device and the second electronic device is established based on the socket protocol, the Bluetooth connection established based on the socket protocol can exchange data between the devices through service discovery, serial communication protocols, or other transmission protocols. The various steps performed by the Bluetooth module 510 can be found in [reference needed]. Figure 6 Explanation.

[0144] like Figure 6 As shown, a Bluetooth module may include a transmission module and a tracking module. Both the transmission module and the tracking module can reside in the kernel layer. In other words, a second submodule within a Bluetooth module may include both a transmission module and a tracking module.

[0145] In step S501 of the Bluetooth module, the transmission module in the Bluetooth module can receive Bluetooth data packets.

[0146] Step S502 performed by the Bluetooth module may include steps S621 to S622.

[0147] In step S621, the transmission module uses the application represented by the target identifier as the target application.

[0148] Bluetooth data packets can include a target identifier and target data. The target application can be identified based on the target identifier. The transmission module can extract the target identifier.

[0149] In some embodiments, the target identifier may be the PID, UID, or package name of the target application, etc. The target identifier can serve as the identifier of the target application. Figure 6 The steps shown are illustrated using the target application identifier as the target identifier as an example.

[0150] In other embodiments, the target identifier may be a target feature value identifier. The target feature value identifier can be represented by a universally unique identifier (UUID). The transmission module can determine the application identifier corresponding to the target feature value identifier based on the correspondence between feature value identifiers and application identifiers. The application identifier corresponding to the target feature value identifier determined by the transmission module can be used as the target application identifier.

[0151] Feature identifiers are used to identify feature values. Different feature values ​​represent different attributes or functions. A Bluetooth module may include one or more services, each of which may correspond to one or more feature values. In Bluetooth technology, a service is a core concept, representing a specific function or set of data that a Bluetooth device can provide. Applications on electronic devices are typically associated with specific services. This means that when an electronic device provides a service, it usually has one or more applications to process the data or functions associated with that service. In the correspondence between feature identifiers and application identifiers, the application corresponding to each feature identifier is used to process the data related to the feature value identified by that feature identifier. Each feature identifier corresponds to only one service; therefore, feature identifiers can also be used to identify services. Each service may correspond to one or more feature values.

[0152] In step S622, the dot module obtains the target application identifier from the transmission module.

[0153] For example, the dot module can read the target application identifier from the storage space of the transmission module.

[0154] Following step S622, in step S503 performed by the Bluetooth module, the dot module can send the target application identifier to the freeze control application.

[0155] Step S504 performed by the Bluetooth module may include steps S641 and S642.

[0156] In step S641, the transmission module can store the target data in the Bluetooth data packet in the buffer corresponding to the socket of the target application.

[0157] The transmission module stores the target data in the buffer corresponding to the socket of the target application. This can be understood as the transmission module storing the target data in the buffer corresponding to the socket of the target application represented by the target application identifier. In other words, the transmission module can store the target data based on the target application identifier. The target application identifier obtained by the dot-mapping module in step S622 is the target application identifier on which the transmission module stores the target data.

[0158] The transmission module can route target data in Bluetooth data packets to the target application's socket, thereby storing the target data in the buffer corresponding to the target application's socket. The target application's socket can be created by the target application itself.

[0159] Each application can create its own socket, and each socket created by an application is unique within the system. That is, different applications create different sockets. Furthermore, each socket corresponds to a buffer used to store received data. Different sockets correspond to different buffers. An application's socket can be created when the application starts running, or it can be created when the first electronic device establishes a Bluetooth connection with a second electronic device. An application's socket can be established by the application for Bluetooth data transmission.

[0160] During Bluetooth transmission, the application's socket can also be a Bluetooth socket. A Bluetooth socket is a socket specifically designed for data transmission between Bluetooth devices.

[0161] The application can use the system-provided API to monitor the readable status of its socket. When the transport module stores target data into the buffer corresponding to the target application's socket, the API can notify the target application. Thus, the target application can proceed to step S642.

[0162] Step S642: The target application reads the target data from the buffer corresponding to the target application's socket.

[0163] If the target application is not in a frozen state when the transmission module stores the target data into the buffer corresponding to the target application's socket, the target application can read the target data in the buffer corresponding to its socket upon receiving a notification from the API. The target application not being in a frozen state can be understood as the target application being in an unfrozen state when the transmission module receives the Bluetooth data packet in step S501, or it can be understood as the target application being unfrozen when the transmission module stores the target data into the buffer corresponding to the target application's socket.

[0164] If the unfreezing of the target application is not yet complete when the transmission module stores the target data in the buffer corresponding to the socket of the target application, the target application can process the data stored in the buffer corresponding to the socket of the target application after the unfreezing is completed, thereby reading the target data.

[0165] For Bluetooth connections established based on the socket protocol, since the transmission module stores the target data in the buffer corresponding to the socket of the target application, even if the freezing of the control application to unfreeze the target application takes a certain amount of time, the target application can still process the target data in the Bluetooth data packet, thus avoiding packet loss.

[0166] When the Bluetooth connection between the first electronic device and the second electronic device is established based on the BLE protocol, the various steps performed by the Bluetooth module 510 can be found in [reference needed]. Figure 7 Explanation.

[0167] like Figure 7 As shown, the Bluetooth module may include a transport module, at least one generic attribute profile (GATT) service, and a punctuation module, wherein the at least one GATT service in the Bluetooth module includes a target GATT service. The at least one GATT service and the punctuation module may reside in the application framework layer; that is, the first sub-module in the application framework layer may include at least one GATT service and the punctuation module. The transport module may include a second sub-module located in the kernel layer of the Bluetooth module, and may also include other parts of the first sub-module in the application framework layer of the Bluetooth module besides the at least one GATT service and the punctuation module.

[0168] GATT service is an important concept in the GATT protocol of Bluetooth Low Energy (BLE) technology. The GATT protocol defines a common framework for exchanging data between BLE devices. In the Android system software architecture, access to and operation of GATT service is typically implemented through APIs provided by the application framework layer.

[0169] The GATT service internally maintains one or more characteristic identifiers. Different GATT services maintain different characteristic identifiers. Therefore, based on the target characteristic, the transmission module can uniquely determine the target GATT service maintaining that target characteristic. In the GATT service, there is a one-to-one correspondence between characteristic values ​​and characteristic identifiers. That is, each characteristic has a unique characteristic identifier. In step S501 of the Bluetooth module, the transmission module in the Bluetooth module can receive Bluetooth data packets. Through the target characteristic identifier of the target characteristic, we can find the target GATT service to which the target characteristic belongs. In other words, services and characteristics can be identified through characteristic identifiers.

[0170] Bluetooth data packets can carry a target identifier and a target feature value. The target identifier is the target identifier, and the target feature value is the target data. The target identifier can be represented by a universally unique identifier (UUID), which can be called the target UUID. The following explanation uses both the target identifier and the target feature identifier as an example.

[0171] Step S502 performed by the Bluetooth module may include steps S721 to S724.

[0172] Step S721: The transmission module determines the target GATT service corresponding to the target UUID.

[0173] The target GATT service maintains the characteristic value corresponding to the target UUID. In other words, the transmission module can determine the GATT service that maintains the characteristic value corresponding to the target UUID in at least one GATT based on the target UUID in the Bluetooth data packet.

[0174] Step S722: The transmission module transmits Bluetooth data packets to the target GATT service.

[0175] Step S723: The target GATT service determines the target application identifier.

[0176] The target application identifier identifies the target application that has subscribed to updates to the feature value corresponding to the target UUID. In other words, the target application is the application that has subscribed to updates to the feature value corresponding to the target UUID.

[0177] When the target GATT service maintains multiple feature values, it can determine the application identifier corresponding to the target UUID as the target application identifier based on the mapping between UUIDs and application identifiers. In this mapping, each application identifier corresponding to a UUID represents an application that subscribes to updates to the feature value corresponding to that UUID. An application subscribing to updates to the feature value corresponding to a specific UUID indicates that the application is interested in that feature value. This subscription can also be understood as the application registering with the Bluetooth module to monitor or listen for updates to the feature value corresponding to the UUID.

[0178] If the target GATT service maintains only one feature value, the target GATT service can use the application identifier recorded in the target GATT service as the target application identifier. The application identifier recorded in the target GATT service indicates the application that subscribes to the update information of the feature value corresponding to that UUID.

[0179] Step S724: The dot module obtains the target application identifier from the target GATT service.

[0180] For example, the dot module can read the target application identifier from the storage space of the target GATT service.

[0181] After step S724, in step S503 performed by the Bluetooth module, the dot module can send the target application identifier to the freeze control application.

[0182] It should be understood that the number of applications that have subscribed to the update information of the feature value corresponding to the target UUID can be one or more, that is, the number of target application identifiers determined by the target GATT service can be one or more. Therefore, the target application identifiers obtained by the tracking module can be all the target application identifiers determined by the target GATT service. The target application identifiers sent by the tracking module to the freeze control application can be all the target application identifiers obtained by the tracking module.

[0183] Step S504 performed by the Bluetooth module may include steps S741 and S742.

[0184] Step S741: The target GATT service updates the feature value corresponding to the target UUID to the target feature value.

[0185] In the Bluetooth module, the GATT service can update its feature value data. Upon receiving the target feature value corresponding to the target UUID in a Bluetooth data packet, the GATT service can write the target feature value into the feature value corresponding to the target UUID maintained by the GATT service, that is, update the feature value corresponding to the target UUID.

[0186] In step S742, the target GATT service sends the updated feature value, i.e., the target data, corresponding to the target UUID to the target application that has subscribed to the update information of the feature value.

[0187] If there are multiple target applications that have subscribed to the update information of this feature value, the target GATT service sends the target data to each target application respectively.

[0188] The target GATT service can send the updated characteristic value corresponding to the target UUID to the target application by calling a callback function. The callback mechanism is a programming paradigm that allows a function (called a callback function) to be automatically invoked when another function (called a triggering function) completes execution or when an event occurs.

[0189] When an application subscribes to updates to a feature value in the GATT service, the application can register a callback function with the GATT service. Then, when the feature value in the GATT service changes, the GATT service sends an update to the application by invoking this callback function. The update includes the changed feature value.

[0190] Through steps S741 to S742, the feature value corresponding to the target UUID in the target GATT service is updated to the target feature value via the Bluetooth module, and the updated feature value corresponding to the target UUID is sent to the target application identified by the target application identifier via the target GATT service, i.e., target data is sent. Thus, the target application can receive and process the target data.

[0191] The type of update information that an application subscribes to can be a notification or an indication. When a feature value in the GATT service changes, if an application has subscribed to the update information for that feature value, the GATT service can send the update information, which includes the updated feature value, to the subscribed application.

[0192] If an application has subscribed to notifications for that feature value, the GATT service sends the updated feature value to the application via a notification. The notification is one-way and does not require confirmation from the application.

[0193] If an application has subscribed to an instruction for that feature value, the GATT service sends the updated feature value to the application via the instruction. Unlike notifications, information sent via an instruction requires confirmation of receipt from the application. That is, if the GATT service does not receive a response from the application regarding the information carrying the updated feature value, the GATT service can resend the updated feature value to the application.

[0194] When an application subscribes to an indication of a feature value, if the freeze control application has not yet completed unfreezing the target application and has not sent a response to the target GATT service after the target GATT service first sends an update message carrying the updated feature value, the target GATT service can resend the update message carrying the updated feature value until the freeze control application completes unfreezing the target application. Once the target application receives the update message carrying the updated feature value and sends a response to the target GATT service, the target GATT service can stop sending the indication message carrying the updated feature value to the target application after receiving the response message. Therefore, when the type of update message for the application subscribing to the feature value is indication, packet loss can be avoided.

[0195] Through steps S721 to S724, when the Bluetooth connection is established based on the BLE protocol, the target identifier in the Bluetooth data packet is the target feature value identifier, and the target data is the target feature value corresponding to the target feature value identifier. Thus, the Bluetooth module can determine the target application identifier for the application that subscribes to the update information of the feature value corresponding to the feature value identifier based on the target identifier. This makes the Bluetooth data processing method provided in this application embodiment compatible with the BLE protocol and has stronger compatibility.

[0196] It should be understood that the above examples are provided to help those skilled in the art understand the embodiments of this application, and are not intended to limit the embodiments of this application to the specific values ​​or scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or changes based on the above examples, and such modifications or changes also fall within the scope of the embodiments of this application.

[0197] For electronic devices that apply the Bluetooth data processing method provided in the embodiments of this application, the hardware structure can be found in [reference needed]. Figure 8 Explanation. Figure 8 A schematic diagram of the structure of electronic device 100 is shown. Electronic device 100 may be a first electronic device.

[0198] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 150, power management module 151, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0199] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0200] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0201] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0202] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0203] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0204] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.

[0205] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0206] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with networks and other devices through wireless communication technology.

[0207] This application provides a Bluetooth data processing apparatus, including various functional units for executing the Bluetooth data processing method provided in this application. The term "unit" here can be implemented in software and / or hardware, and is not specifically limited thereto.

[0208] For example, a "unit" can be a software program, a hardware circuit, or a combination of both that implements the above functions. The hardware circuit may include an application-specific integrated circuit (ASIC), electronic circuitry, a processor (e.g., a shared processor, a proprietary processor, or a group processor) and memory for executing one or more software or firmware programs, integrated logic circuitry, and / or other suitable components that support the described functions.

[0209] Therefore, the units of the various examples described in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0210] This application also provides a chip, which includes a data interface and one or more processors. When the one or more processors execute instructions, they read instructions stored in a memory through the data interface to implement the Bluetooth data processing method described in the above method embodiments.

[0211] The one or more processors can be general-purpose processors or special-purpose processors. For example, the one or more processors can be central processing units (CPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, such as discrete gate, transistor logic devices, or discrete hardware components.

[0212] The chip can be used as a component of a terminal device or other electronic device. For example, the chip can be located in electronic device 100.

[0213] Processors and memory can be configured separately or integrated together. For example, processors and memory can be integrated onto a system-on-a-chip (SoC) in a terminal device. That is, the chip can also include memory.

[0214] The memory may store a program, which can be run by the processor to generate instructions, causing the processor to execute the Bluetooth data processing method described in the above method embodiments according to the instructions.

[0215] Optionally, the memory may also store data. Optionally, the processor may also read data stored in the memory, which may be stored at the same memory address as the program, or the data may be stored at a different memory address than the program.

[0216] The chip can be disposed in the first electronic device. For example, the memory can be used to store programs related to the Bluetooth data processing method provided in the embodiments of this application, and the processor can be used to call programs related to the graphics processing method stored in the memory to implement the Bluetooth data processing method of the embodiments of this application. For example, through the Bluetooth connection between the first electronic device and the second electronic device, a Bluetooth data packet sent by the second electronic device is received, the Bluetooth data packet carrying a target identifier and target data; if the target application represented by the target identifier is in a frozen state, the target application is unfrozen; and the target data is processed through the unfrozen target application.

[0217] This application also provides a computer program product that, when executed by a processor, implements the Bluetooth data processing method described in any of the method embodiments of this application.

[0218] The computer program product can be stored in memory, for example, it is a program. The program is eventually converted into an executable object file that can be executed by the processor after processes such as preprocessing, compilation, assembly and linking.

[0219] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, implements the Bluetooth data processing method described in any of the method embodiments of this application. The computer program may be a high-level language program or an executable object program.

[0220] The computer-readable storage medium is, for example, memory. Memory can be volatile or non-volatile, or it can include both volatile and non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0221] In the description of this application, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance, or a specific order or sequence. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0222] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0223] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0224] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0225] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for example, the division of units is merely a logical functional division, and other division methods may exist in actual implementation; for example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0226] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0227] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0228] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A Bluetooth data processing method, characterized in that, Applied to a first electronic device, the method includes: The first electronic device receives Bluetooth data packets sent by the second electronic device through a Bluetooth connection between the first electronic device and the second electronic device. The Bluetooth data packets carry a target identifier and target data. If the target application represented by the target identifier is in a frozen state, the target application is unfrozen; The target data is processed by the target application after it has been unfrozen.

2. The method according to claim 1, characterized in that, After the target application processes the target data, the target application is frozen. When the target application is frozen, the Bluetooth connection exists between the first electronic device and the second electronic device.

3. The method according to claim 1 or 2, characterized in that, The first electronic device includes a Bluetooth module and a freeze control module; The method further includes: After receiving the Bluetooth data packet through the Bluetooth module, the target data is sent to the target application. The target application identifier is sent to the freeze control module via the Bluetooth module. The target application identifier is used to identify the target application and is determined based on the target identifier. The freeze control module determines whether the target application is in a frozen state based on the target application identifier.

4. The method according to claim 3, characterized in that, The target identifier is a target feature value identifier, and the method further includes: The Bluetooth module determines the target application identifier as the application identifier corresponding to the target identifier based on the first correspondence between the feature value identifier and the application identifier.

5. The method according to claim 4, characterized in that, When the Bluetooth connection is established based on the Bluetooth Low Energy protocol, in the first correspondence, the application indicated by the application identifier corresponding to any feature value identifier has subscribed to the update information of the feature value corresponding to the any feature value identifier in the Bluetooth module, and the target data is the target feature value corresponding to the target feature value identifier.

6. The method according to claim 5, characterized in that, The Bluetooth module includes at least one general attribute specification service, each general attribute specification service maintains at least one feature value identifier, and the target general attribute specification service in the at least one general attribute specification service maintains at least one feature value identifier including the target feature value identifier; The step of determining the target application identifier as the application identifier corresponding to the target identifier through the Bluetooth module based on the first correspondence between the feature value identifier and the application identifier includes: Based on the first correspondence, the target application identifier is determined to be the application identifier corresponding to the target identifier through the target general attribute specification service. The first correspondence represents the application identifier corresponding to each feature value identifier in at least one feature value identifier maintained by the target general attribute specification service.

7. The method according to claim 5 or 6, characterized in that, The step of receiving the Bluetooth data packet through the Bluetooth module and then sending the target data to the target application includes: The first update information, including the target feature value, is sent to the target application via the Bluetooth module. The Bluetooth module repeatedly sends the first update information to the target application without receiving a response from the target application, until a response to the first update information is received from the target application, at which point the sending of the first update information ends.

8. The method according to any one of claims 3-7, characterized in that, The target application identifier is the user identifier, process identifier, or package name of the target application.

9. The method according to any one of claims 3-8, characterized in that, The Bluetooth module further includes a marker module. After receiving the Bluetooth data packet through the Bluetooth module, sending the target data to the target application and sending the target application identifier to the freeze control module includes: sending the target application identifier to the freeze control module through the marker module.

10. The method according to any one of claims 1-9, characterized in that, The method further includes: When the target application is running, the target data is processed through the target application.

11. An electronic device, characterized in that, The device includes a processor and a memory, the memory being used to store a computer program, and the processor being used to retrieve and run the computer program from the memory, causing the electronic device to perform the method of any one of claims 1 to 9.

12. A chip, characterized in that, It includes a processor and a data interface, wherein the processor reads instructions stored in memory through the data interface to implement the method as described in any one of claims 1 to 9.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program for implementing the method of any one of claims 1 to 9.

14. A computer program product, characterized in that, When the computer program product is run on an electronic device, the electronic device is used to perform the method of any one of claims 1-9.