Communication method and device, electronic equipment and readable storage medium
By acquiring data transmission requirements and flexibly controlling mode switching and data transmission of Bluetooth devices, the problem of Bluetooth devices increasing power consumption due to frequent mode switching is solved, and the balance between power consumption reduction and data transmission efficiency is achieved.
Patent Information
- Application Number
- CN202510384806.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-28
- Publication Date
- 2025-07-01
AI Technical Summary
Bluetooth devices increase power consumption by frequently switching low-power modes and active modes during frequent data interactions.
By acquiring data transmission requirements, flexible control of mode switching and data transmission, reducing unnecessary mode switching and interface wake-up, including switching to active mode, reducing data transmission frequency or disconnection.
Effectively reduce the power consumption of electronic equipment, improve the balance of power consumption and performance, and ensure the timely transmission of key data.
Smart Images

Figure CN120239022A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of communication technologies, and particularly relates to a communication method, apparatus, electronic device, and readable storage medium. Background Art
[0002] Bluetooth technology is a wireless technology that supports communication for low-power consumption devices. It can build a communication environment for fixed and mobile devices through low-cost short-range wireless connections. Bluetooth technology has been widely used in various electronic devices due to its characteristics such as low power consumption, fast connection, and low-latency response.
[0003] Currently, in order to optimize the power consumption of electronic devices, Bluetooth technology has introduced a low-power consumption mode (Sniff mode). In the low-power consumption mode, the electronic device periodically listens for whether there is a data transmission requirement, thereby reducing power consumption. However, when an electronic device needs to perform data interaction with other electronic devices via Bluetooth, the electronic device will exit the low-power consumption mode and switch to the active mode, and wake up the application interface (such as Uart AP) to process the data interaction.
[0004] In this way, as the types of data interaction between electronic devices increase day by day, the frequent data interaction between electronic devices will cause the electronic device to frequently exit the low-power consumption mode and wake up the relevant interfaces, thereby increasing the power consumption of the electronic device. Summary of the Invention
[0005] The objective of the embodiments of this application is to provide a communication method, apparatus, electronic device, and readable storage medium, which can reduce unnecessary mode switching and interface wake-up, and thus reduce the power consumption of the electronic device.
[0006] In a first aspect, the embodiments of this application provide a communication method, which includes: when a first electronic device is in the low-power consumption mode, the first electronic device obtains a first data transmission requirement; according to the first data transmission requirement, the first electronic device performs at least one of the following: switches from the low-power consumption mode to the active mode; reduces the frequency of sending data to a second electronic device or does not send data to the second electronic device; sends a first instruction to the second electronic device, where the first instruction instructs the second electronic device to reduce the frequency of sending data to the first electronic device or not to send data to the first electronic device; sends a connection disconnection request to the second electronic device, and the connection disconnection request is used to request to disconnect the target communication connection between the first electronic device and the second electronic device.
[0007] Second aspect, an embodiment of the present application provides a communication method, which includes: when the second electronic device is in the low-power mode, the second electronic device obtains a second data transmission requirement; the second electronic device performs at least one of the following according to the second data transmission requirement: switches from the low-power mode to the active mode; reduces the frequency of sending data to the first electronic device or does not send data to the first electronic device.
[0008] Third aspect, an embodiment of the present application provides a communication device, which includes: an acquisition module and a processing module, where: the acquisition module is used to obtain a first data transmission requirement when the first electronic device is in the low-power mode; the processing module is used to perform at least one of the following according to the first data transmission requirement: switches from the low-power mode to the active mode; reduces the frequency of sending data to the second electronic device or does not send data to the second electronic device; sends a first instruction to the second electronic device, and the first instruction instructs the second electronic device to reduce the frequency of sending data to the first electronic device or not to send data to the first electronic device; sends a connection disconnection request to the second electronic device, and the connection disconnection request is used to request to disconnect the target communication connection between the first electronic device and the second electronic device.
[0009] Fourth aspect, an embodiment of the present application provides a communication device, which includes: an acquisition module and a processing module, where: the above acquisition module is used to obtain a second data transmission requirement when the second electronic device is in the low-power mode; the above processing module is used to perform at least one of the following according to the second data transmission requirement: switches from the low-power mode to the active mode; reduces the frequency of sending data to the first electronic device or does not send data to the first electronic device.
[0010] Fifth aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, and the memory stores a program or instruction that can run on the processor. When the program or instruction is executed by the processor, the steps of the method described in the first aspect or the second aspect are implemented.
[0011] Sixth aspect, an embodiment of the present application provides a readable storage medium, and a program or instruction is stored on the readable storage medium. When the program or instruction is executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.
[0012] Seventh aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect or the second aspect.
[0013] In an eighth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect or the second aspect.
[0014] In an embodiment of the present application, when the first electronic device is in a low-power mode, it can obtain the first data transmission requirement, and according to the first data transmission requirement, switch the working mode, or reduce the frequency of sending data to the second electronic device or not send data to the second electronic device, or send an instruction to indicate reducing the frequency of the second electronic device sending data to the first electronic device, or request to disconnect the target communication connection between the first electronic device and the second electronic device, so as to flexibly control mode switching and data transmission according to the actual data transmission requirement, thereby reducing unnecessary mode switching and interface wake-up, and further reducing the power consumption of the electronic device.
[0015] In an embodiment of the present application, when the second electronic device is in a low-power mode, the second electronic device can obtain the second data transmission requirement, and according to the second data transmission requirement, adjust the frequency of sending data to the first electronic device, or not send data to the first electronic device, or disconnect the communication connection with the first electronic device, so as to flexibly control data transmission and mode switching according to the actual data transmission requirement, thereby reducing unnecessary mode switching and interface wake-up, and further reducing the power consumption of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 Schematic flowchart of a communication method provided by some embodiments of the present application;
[0017] Figure 2 Schematic flowchart of a communication method provided by some embodiments of the present application;
[0018] Figure 3 Schematic flowchart of a communication method provided by some embodiments of the present application;
[0019] Figure 4 Schematic flowchart of a communication method provided by some embodiments of the present application;
[0020] Figure 5 Schematic flowchart of a communication method provided by some embodiments of the present application;
[0021] Figure 6 Schematic structural diagram of a communication device provided by some embodiments of the present application;
[0022] Figure 7 Schematic structural diagram of a communication device provided by some embodiments of the present application;
[0023] Figure 8Schematic structural diagram of an electronic device provided for some embodiments of the present application;
[0024] Figure 9 Schematic hardware structure diagram of an electronic device provided for some embodiments of the present application. Detailed implementation manners
[0025] Next, the technical solutions in the embodiments of the present application will be clearly described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, rather than all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0026] The terms "first", "second", etc. in the specification of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type, and the number of objects is not limited. For example, the first object can be one or multiple. In addition, "and / or" in the specification means at least one of the connected objects, and the character " / " generally indicates an "or" relationship between the associated objects before and after.
[0027] The terms "at least one (item)", "at least one of", etc. in the specification of the present application refer to any one, any two or a combination of two or more of the included objects. For example, at least one (item) of a, b, and c can represent: "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two (items)" means two or more, and its expressed meaning is similar to that of "at least one (item)".
[0028] The communication method provided by the embodiments of the present application can be applied to a Bluetooth communication scenario. Among them, the first specific scenario is playing music through a Bluetooth headset. For the scenario of playing music through a Bluetooth headset, after the user pairs and connects the electronic device with the Bluetooth headset, the electronic device transmits the played audio data to the headset through the Bluetooth connection to achieve wireless music playback. The second specific scenario is Bluetooth calling. For the scenario of making a call with a Bluetooth device, the user can answer an incoming call from the electronic device through the Bluetooth device and make a call. The third specific scenario is data synchronization between a smart bracelet and an electronic device. For the scenario of synchronizing data between the electronic device and the smart bracelet, after the user pairs and connects the electronic device with the smart bracelet, the electronic device can send weather information, location information, etc. to the bracelet. The user wears the Bluetooth smart bracelet to exercise, and the bracelet monitors data such as heart rate, steps, and exercise distance. The bracelet synchronizes the data to the sports application on the mobile phone through Bluetooth, so that the user can view their own sports data on the electronic device.
[0029] The following will, with reference to the accompanying drawings, describe in detail the communication method provided by the embodiments of the present application through specific embodiments and their application scenarios.
[0030] Figure 1 is a schematic flowchart of the communication method provided by the embodiments of the present application. As Figure 1 shown, the communication method may include the following steps 201 and 202:
[0031] Step 201: When the first electronic device is in the low-power mode, the first electronic device obtains a first data transmission requirement.
[0032] In some embodiments of the present application, the above-mentioned low-power mode may be Sniff mode.
[0033] It should be noted that Sniff mode is an energy-saving mechanism in Bluetooth communication, which is used to reduce the power consumption of Bluetooth devices when no data is being transmitted. In Sniff mode, the device no longer continuously monitors whether there is a data transmission requirement, but instead wakes up to monitor data periodically at a set interval time to achieve the purpose of reducing power consumption. When there is no data to be transmitted, the device will enter the low-power state to reduce energy consumption.
[0034] It should be noted that the low-power mode may also be referred to as the breathing mode, the listening mode, or the energy-saving mode.
[0035] In some embodiments of the present application, the first electronic device enters the low-power mode when it establishes an asynchronous connectionless (ACL) and protocol connection with the second electronic device and there is no service interaction within a preset time period.
[0036] It should be noted that the ACL link is a physical link for asynchronous data transmission in Bluetooth communication. It allows devices to exchange data in the form of packets without the need to establish a continuous connection. The data types supported by the ACL link include file transfer, audio stream, etc. The above protocol can be the Logical Link Control and Adaptation Protocol (L2CAP).
[0037] In some embodiments of the present application, the connection protocols may include at least one of the following: Advanced Audio Distribution Profile (A2DP), Hands-Free Profile (HFP), and Human Interface Device Profile (HID).
[0038] It should be noted that the Advanced Audio Distribution Protocol is used for media playback to transmit high-quality audio streams; the Hands-Free Protocol is used for calls to implement the voice and control channels between Bluetooth devices (such as headphones) and electronic devices; the Human Interface Device Protocol is used to transmit control flow data.
[0039] In some embodiments of the present application, the first electronic device may include at least one of the following: portable smart devices, tablet computers, laptop computers, in-vehicle devices, smart home centers, Bluetooth headsets, Bluetooth speakers, smart wearable devices, etc.
[0040] In some embodiments of the present application, the second electronic device may include at least one of the following: portable smart devices, tablet computers, laptop computers, in-vehicle devices, smart home centers, Bluetooth headsets, Bluetooth speakers, smart wearable devices, etc.
[0041] Exemplarily, the first electronic device may be a portable smart device, such as a smartphone, and the second electronic device is a smart wearable device, such as a smart watch or a smart bracelet; or, the first electronic device is a smart wearable device and the second electronic device is a portable smart device.
[0042] Exemplarily, taking the first electronic device as a smartphone and the second electronic device as a smart bracelet as an example, after the smartphone establishes an ACL and protocol connection with the smart bracelet, when the smartphone determines that there is no business interaction with the smart bracelet for more than 15 seconds, the smartphone will enter the low-power mode and notify the smart bracelet to enter the low-power mode.
[0043] In some embodiments of the present application, the first electronic device sends a connection request to the second electronic device to request the establishment of a Bluetooth connection. After the connection request is accepted, an ACL link is successfully established between the first electronic device and the second electronic device. Based on this ACL link, the first electronic device sends a protocol connection request to the second electronic device to request the establishment of a higher-level L2CAP connection between the first electronic device and the second electronic device to support specific applications or services. After the ACL link and the protocol connection are established, data transmission can be performed between the first electronic device and the second electronic device.
[0044] In some embodiments of the present application, the above connection request may be a paging request.
[0045] It should be noted that the above paging request may also be referred to as a Page request.
[0046] In some embodiments of the present application, the above protocol connection request may be L2CAP_CONNECTION_REQ.
[0047] In some embodiments of the present application, when the first electronic device establishes an asynchronous connectionless and protocol connection with the second electronic device and there is service interaction within a preset time period, the first electronic device enters the active mode, that is, the Active mode.
[0048] It should be noted that in the Active mode, the device is in a normal operating state mode. In this mode, the device remains active and is ready to transmit or receive data at any time.
[0049] It should be noted that the active mode may also be referred to as the active working mode, the activation mode, or the active mode.
[0050] Exemplarily, taking the first electronic device as a smartphone and the second electronic device as a smart bracelet as an example, after the smartphone establishes an ACL and a protocol connection with the peer device, when the smartphone determines that there is service interaction with the peer device within 15 seconds, the smartphone will enter the active mode and notify the peer device to enter the active mode. Further, after waiting for a preset duration, the smartphone determines again whether there has been no service interaction with the peer device for more than 15 seconds. Exemplarily, the value range of the preset duration may be from 15 to 30 seconds. For example, the preset duration is 15 seconds.
[0051] In some embodiments of the present application, the above first data transmission requirements include at least one of the following: the type of data; the priority of the data; the data volume of the data; the service transmission status parameter of the first electronic device.
[0052] In some embodiments of the present application, the above type of data may include at least one of the following:
[0053] Auxiliary service data, which includes but is not limited to at least one of the following: device status data, environmental context data, monitoring data;
[0054] Core service data, which may include user control instructions, emergency warning data, etc.
[0055] In some embodiments of the present application, the above-mentioned user control instructions may include volume control instructions, call answering control instructions, etc.
[0056] It should be noted that the above-mentioned core service data may also include key data that directly affects the user experience or device security, such as shooting control instructions.
[0057] In some embodiments of the present application, the above-mentioned device status data may include power information, firmware version information, device temperature information, etc.; the above-mentioned environmental context information may include location information, weather information, etc.; the above-mentioned monitoring data may include the number of steps taken, heart rate information, etc.
[0058] It should be noted that the above-mentioned auxiliary service data may also be other data for non-real-time needs, that is, non-urgent data, such as device log data, etc.
[0059] In some embodiments of the present application, the priority of the data may be the transmission priority of the data, and the priority of the data may be predefined or preconfigured.
[0060] It should be noted that the higher the priority of the data, the higher the emergency or importance level of the data.
[0061] In some embodiments of the present application, the data volume of the data may be the size of the data packet to be transmitted.
[0062] In some embodiments of the present application, the service transmission status parameters include but are not limited to at least one of the following: data transmission frequency, data transmission rate, data packet queue length, processor load, memory usage, and active status of the network interface.
[0063] In some embodiments of the present application, the first electronic device may continuously or periodically monitor the data transmission situation between it and the second electronic device, and obtain the first data transmission requirement according to the data transmission situation.
[0064] Step 202: The first electronic device executes at least one of the following according to the first data transmission requirement:
[0065] Switch from the low-power mode to the active mode;
[0066] Reduce the frequency of sending data to the second electronic device or stop sending data to the second electronic device;
[0067] Send a first instruction to a second electronic device, where the first instruction instructs the second electronic device to reduce the frequency of sending data to the first electronic device or not to send data to the first electronic device;
[0068] Send a connection disconnection request to the second electronic device, where the connection disconnection request is used to request disconnection of the target communication connection between the first electronic device and the second electronic device.
[0069] In some embodiments of the present application, the first electronic device determines whether the low-power mode can meet the current data transmission requirements according to the obtained first data transmission requirements, and when it can meet the current data transmission requirements, transmits data in the low-power mode, or when it does not meet the current data transmission requirements, switches from the low-power mode to the active mode to transmit data.
[0070] Exemplarily, when it is necessary to transmit a large amount of data and urgent data, the first electronic device can switch from the low-power mode to the active mode to improve data transmission efficiency.
[0071] Exemplarily, when it is necessary to transmit a small amount of data and non-urgent data, the first electronic device may not exit the low-power mode and perform data transmission in the low-power mode.
[0072] In some embodiments of the present application, the first electronic device may reduce the frequency of sending data to the second electronic device or not send data to the second electronic device when there is non-urgent or unimportant data.
[0073] Exemplarily, when it is necessary to transmit a small amount of data and non-urgent data, the first electronic device may reduce the frequency of sending data to the peer device or not send data to the peer device.
[0074] It can be understood that when the data is unimportant or non-urgent, the first electronic device may not exit the low-power mode and send data to the second electronic device at a lower frequency in the low-power mode; or the first electronic device may not exit the low-power mode and not send data to the second electronic device.
[0075] In some embodiments of the present application, the first electronic device determines the current data transmission status according to the obtained first data transmission requirements, and accordingly sends a first instruction to the second electronic device.
[0076] In some embodiments of the present application, the above first instruction may be an L2cap_echo_req sniff instruction.
[0077] Exemplarily, when the first electronic device is in an idle state, the first electronic device may send a first instruction to the second electronic device to instruct the second electronic device to reduce the frequency of sending data to the first electronic device, or to instruct the second electronic device not to send data to the first electronic device, thereby further reducing the power consumption of the first electronic device.
[0078] Exemplarily, when there is no business data transmission within a preset duration, it indicates that the electronic device enters an idle state. For example, taking the electronic device as a smart phone, when the smart phone service is not coupled with Bluetooth, such as no music and no call, the smart phone will consider itself to enter an idle state after 3 minutes.
[0079] In some embodiments of the present application, after receiving the first instruction, the second electronic device may send a first response to the first electronic device to indicate agreement to reduce the frequency of sending data to the first electronic device or not to send data to the first electronic device. Exemplarily, the first response may be L2cap_echo_res.
[0080] In some embodiments of the present application, the first electronic device determines the current data transmission status according to the obtained first data transmission requirement, and accordingly determines whether to send a connection disconnection request to the second electronic device.
[0081] In some embodiments of the present application, the above connection disconnection request may be L2CAP_CONNECTION_REQ.
[0082] In some embodiments of the present application, the above target communication connection may be a communication connection established through the Logical Link Control and Adaptation Protocol (L2CAP) protocol; Exemplarily, the above target communication connection includes but is not limited to at least one of the following: a communication connection for media playback, a communication connection for calls, and a communication connection for transmitting control flow data.
[0083] It should be noted that the communication connection for media playback is established based on A2DP, the communication connection for calls is established based on HFP, and the communication connection for transmitting control flow data is established based on the HID protocol.
[0084] Exemplarily, when the first data transmission requirement indicates that the electronic device is continuously in an idle state, that is, when the relevant communication connection for data transmission is no longer needed, the first electronic device may send a connection disconnection request to the second electronic device to request disconnection of the target communication connection, thereby further reducing the power consumption of the first electronic device.
[0085] In the communication method provided by the embodiment of the present application, when the first electronic device is in the low-power mode, it can obtain the first data transmission requirement, and according to the first data transmission requirement, switch the working mode, or reduce the frequency of sending data to the second electronic device or not send data to the second electronic device, or send an instruction to indicate reducing the frequency of the second electronic device sending data to the first electronic device, or request to disconnect the target communication connection between the first electronic device and the second electronic device, so as to flexibly control mode switching and data transmission according to the actual data transmission requirement, thereby reducing unnecessary mode switching and interface wake-up, and further reducing the power consumption of the electronic device.
[0086] In some embodiments of the present application, the above step 202 may include the following steps 202a:
[0087] Step 202a: When the first data transmission requirement meets the first condition, the first electronic device switches from the low-power mode to the active mode and sends data in the active mode;
[0088] In some embodiments of the present application, the above first condition includes at least one of the following:
[0089] ① The type of data is core service data, and the above core service data includes at least one of the following: control instructions, alarm data;
[0090] ② The priority of the data is greater than or equal to the first threshold;
[0091] ③ The data volume of the data is greater than or equal to the second threshold.
[0092] In some embodiments of the present application, when the first data transmission requirement meets the fourth condition, the first electronic device maintains the low-power mode, and in this low-power mode, sends data according to the first sending frequency or does not send data.
[0093] In some embodiments of the present application, the above first sending frequency is related to the period of the low-power mode.
[0094] In some embodiments of the present application, the first sending frequency may be N times the period of the low-power mode, where N is an integer greater than or equal to 1.
[0095] In some embodiments of the present application, the above fourth condition includes at least one of the following:
[0096] ① The type of data is auxiliary service data, and the above auxiliary service data includes at least one of the following: device status data, environmental context data, monitoring data;
[0097] ② The priority of the data is less than or equal to the fifth threshold;
[0098] ③ The data volume of the data is less than or equal to the sixth threshold.
[0099] It should be noted that the threshold value (such as the first threshold value) in the embodiments of the present application can be set according to actual requirements, and the embodiments of the present application do not limit this.
[0100] In some embodiments of the present application, the above first transmission frequency can be set to N times the low-power mode period, where N is an integer greater than or equal to 1. For example, if the low-power mode period is 500 ms and N is set to 2, the data is transmitted once every 1000 ms.
[0101] In some examples, when the first electronic device determines that the type of data to be transmitted is auxiliary service data, such as device status data, environmental context data, monitoring data, etc., it maintains the low-power mode, and in the low-power mode, it transmits data or does not transmit data according to the first transmission frequency.
[0102] In some examples, if the first electronic device determines that the data type is critical service data, the first electronic device switches from the low-power mode to the active mode. In the active mode, the first electronic device transmits data at a higher frequency to ensure the timely transmission of the data.
[0103] Exemplarily, for the scenario of smart bracelet data synchronization, after the user pairs and connects the smart phone with the smart bracelet, when the smart phone is in the low-power mode, it regularly obtains the type of data transmitted by the smart phone. When it determines that it needs to synchronize auxiliary service data such as weather or location information to the smart bracelet, the smart phone does not exit the low-power mode and synchronizes the data to the smart bracelet according to the period in the low-power mode.
[0104] Exemplarily, for the scenario of a Bluetooth headset playing music, after the user pairs and connects the smart phone with the Bluetooth headset, when the electronic device is in the low-power mode, it regularly obtains the type of data transmitted by the smart phone. When it determines that it needs to send a volume control instruction to the Bluetooth headset, the smart phone exits the low-power mode and immediately sends the volume control instruction to the Bluetooth headset in the active mode.
[0105] In this way, by judging the data transmission requirements of the data, the first electronic device can more accurately select the working mode according to the first data transmission requirements according to the urgency or importance of the data, thereby improving the balance effect between power consumption and performance. For example, for non-urgent or unimportant auxiliary service data, it is transmitted once every 500 ms or 1000 ms. By reducing the transmission frequency of non-urgent data, the power consumption is effectively reduced; while for relatively important or urgent data, it can quickly switch to the active mode to ensure the timely transmission of the data.
[0106] In some embodiments of the present application, if the priority of the data is higher than the first threshold, the first electronic device switches from the low-power mode to the active mode. In the active mode, the first electronic device sends data at a higher frequency to ensure the timely transmission of the data.
[0107] In some embodiments of the present application, when the first electronic device determines that the priority of the data to be transmitted is less than or equal to the fifth threshold, it maintains the low-power mode, and in the low-power mode, it sends data or does not send data according to the first transmission frequency.
[0108] Exemplarily, assuming that the priority is divided into levels 1-10 and the first threshold is set to 5, the data with a priority of 5 and below meets the condition. For the Bluetooth call scenario, after the electronic device enters the low-power mode, if the priority of the voice data to be transmitted is 6, the electronic device determines that the priority of the voice data to be transmitted is greater than the first threshold, switches from the low-power mode to the active mode, and immediately sends data to the Bluetooth device.
[0109] Exemplarily, for the Bluetooth call scenario, after the electronic device enters the low-power mode, if the priority of the device wearing status data to be transmitted is 4, the electronic device determines that the priority of the voice data to be transmitted is less than the first threshold, maintains the low-power mode, and in the low-power mode, sends the device wearing status data to the Bluetooth device according to the period of the low-power mode. For example, the device wearing status data is sent when 500 ms is reached.
[0110] In this way, by judging the priority of the data, the first electronic device can more accurately select the working mode according to the first data transmission requirement according to the priority of the data, thereby improving the balance effect between power consumption and performance. For example, for the auxiliary service data with a lower priority, it is sent once every 500 ms or 1000 ms. By reducing the transmission frequency of the non-urgent data, the power consumption is effectively reduced; while for the data with a higher priority or a larger data volume, it can quickly switch to the active mode to ensure the timely transmission of the data.
[0111] In some embodiments of the present application, if the first electronic device determines that the data volume of the data is higher than the second threshold, the first electronic device switches from the low-power mode to the active mode. In the active mode, the first electronic device sends data at a higher frequency to ensure the timely transmission of the data.
[0112] In some embodiments of the present application, when the first electronic device determines that the data volume of the data to be transmitted is less than or equal to the sixth threshold, it maintains the low-power mode, and in the low-power mode, it sends data or does not send data according to the first transmission frequency.
[0113] Exemplarily, assume that the data volume is in bytes, the second threshold is set to 100 bytes, and the data with a data volume of 100 bytes or less meets the condition. If the data to be transmitted is non-urgent and the data volume is 90 bytes, the electronic device determines that the data volume of the data to be transmitted is less than the above second threshold, maintains the low-power mode, and in the low-power mode, sends the data or does not send the data according to the period of the low-power mode.
[0114] In this way, by determining whether the first data transmission requirement meets the condition, the first electronic device can more accurately select the working mode according to the first data transmission requirement, thereby improving the balance effect between power consumption and performance. For example, for auxiliary service data that is non-urgent and has a small data volume, it is sent once every 500 ms or 1000 ms. By reducing the transmission frequency of non-urgent data, the power consumption is effectively reduced; while for data with a higher priority or a larger data volume, it can quickly switch to the active mode to ensure the timely transmission of data.
[0115] In the embodiment of the present application, after the first electronic device enters the low-power mode, when transmitting data with a small data volume and that is non-urgent and does not require guaranteed latency, it does not exit the low-power mode, preventing the low-power mode from exiting frequently, achieving the purpose of power saving. For important instructions such as control information (such as media, calls) of the earphone, it can exit the low-power mode and send immediately to ensure the normal use of the function. The first electronic device can intelligently select to maintain the low-power mode or switch to the active mode according to the first data transmission requirement, which not only ensures the low-power transmission of auxiliary service data but also ensures the timely transmission of key service data, thus effectively balancing power consumption and performance.
[0116] In some embodiments of the present application, the process in which the first electronic device sends the first instruction to the second electronic device according to the first data transmission requirement in step 202 may include the following step 202c:
[0117] Step 202c: When the first electronic device is in an idle state, the first electronic device sends the first instruction to the second electronic device.
[0118] In some embodiments of the present application, the first electronic device may determine whether it is in an idle state according to the service transmission status parameter.
[0119] Exemplarily, the first electronic device continuously or periodically monitors its service transmission status parameter, and analyzes the above service transmission status parameter based on a preset idle state determination criterion. For example, when the data packet queue is empty, the processor load is lower than a specific percentage, or the network interface has not received or sent any data for a period of time, the first electronic device determines that it is in an idle state.
[0120] Exemplarily, for a Bluetooth communication scenario, taking the second electronic device as a Bluetooth headset as an example, after the user pairs and connects the electronic device with the Bluetooth headset, when the electronic device is in the low-power mode, it detects whether there is any transmission of music or call data within 3 minutes. If not, the electronic device determines that it has entered the idle state.
[0121] In some embodiments of the present application, after the first electronic device determines that it is in the idle state, it sends a first instruction to the second electronic device to instruct to reduce the frequency of sending data to the first electronic device or to instruct not to send data to the first electronic device.
[0122] Exemplarily, in combination with the above example, after the user pairs and connects the electronic device with the Bluetooth headset, when the electronic device is in the low-power mode, it detects whether there is any transmission of music or call data within 3 minutes. If not, the electronic device determines that it has entered the idle state. Then, the electronic device can send an L2cap_echo_reqsniff instruction to the Bluetooth headset to instruct the Bluetooth headset to reduce the data sending frequency or not to send data. After the Bluetooth headset replies with an L2cap_echo_res, the function takes effect.
[0123] In the embodiments of the present application, after the first electronic device enters the low-power mode and is in the idle state, it sends an instruction to the peer device to reduce the data interaction between the first electronic device and the peer device. For example, unimportant information such as battery power, wearing status, and location can be sent as little as possible or not sent at all, reducing the data sending frequency, thereby achieving the purpose of reducing power consumption.
[0124] In some embodiments of the present application, the process in step 202 where the first electronic device sends a connection disconnection request to the second electronic device according to the first data transmission requirement may include the following step 202d:
[0125] Step 202d: When the first electronic device is in the idle state, the first electronic device sends a connection disconnection request to the second electronic device.
[0126] In some embodiments of the present application, after the first electronic device determines that it is in the idle state, or determines that it has been in the idle state for a certain period of time, it sends a connection disconnection request to the second electronic device to request to disconnect the protocols for call, media communication, and transmission control flow data, so that there is no need to send data packets through the ACL to maintain the protocols for call, media communication, and transmission control flow data, thereby reducing power consumption.
[0127] Exemplarily, in combination with the above example, after the user pairs and connects the electronic device with the Bluetooth headset, when the electronic device is in the low-power mode, it detects whether there is any transmission of music or call data within 3 minutes. If not, the electronic device determines that it has entered the idle state. After that, the electronic device can send an L2CAP_DISCONNECTION_REQ instruction to the Bluetooth headset, requesting to retain only the basic ACL link and disconnect other protocols. After the Bluetooth headset replies with an L2CAP_DISCONNECTION_RSP, the protocol is then disconnected.
[0128] In the embodiments of the present application, the first electronic device can intelligently manage the communication and connection with the second electronic device according to the service transmission status parameter, effectively utilize resources, and reduce unnecessary energy consumption. For example, it automatically disconnects the connection with the smart wearable device during the user's inactive period to extend the battery life of the device, and at the same time quickly re-establishes the connection when needed to ensure the timely synchronization of information and the continuity of services.
[0129] In some embodiments of the present application, the above step 202d may include the following steps 202d1 and 202d2:
[0130] Step 202d1: When the first electronic device is in the idle state, the first electronic device starts a timer to start timing with a preset timing duration.
[0131] In some embodiments of the present application, the first electronic device can control the timer to time with a preset timing duration.
[0132] Step 202d2: After the timer times out, if the first electronic device continues to be in the idle state, the first electronic device sends a connection disconnection request to the second electronic device.
[0133] Wherein, the above target communication connection is a communication connection established through the Logical Link Control and Adaptation Protocol (L2CAP) protocol; the target communication connection includes at least one of the following: a communication protocol for media playback; a communication connection for calls; a communication connection for transmitting control flow data.
[0134] In some embodiments of the present application, the first electronic device starts a timer and sets a preset timing duration, where the timing duration can be configured according to the actual application scenario and requirements. For example, the timing duration can be set to 10 minutes.
[0135] In some embodiments of the present application, after the timer starts timing, the first electronic device continues to monitor its service transmission status. After the timer times out, the first electronic device determines again whether it is still in the idle state. If the first electronic device continues to be in the idle state after the timer times out, the first electronic device sends a connection disconnection request to the second electronic device through the L2CAP protocol to request disconnection of the target communication connection with the second electronic device.
[0136] Exemplarily, for a media playback scenario, taking the first electronic device as a smart phone and the second electronic device as a Bluetooth headset as an example, when a user plays music through the Bluetooth headset using the smart phone, if the music playback stops and the user does not perform any operations for a long time, such as switching songs, adjusting the volume, etc., the smart phone determines that it is in the idle state and starts the timer. After the timer times out, if there is still no audio or other control operations for the call service, the smart phone sends a connection disconnection request to the Bluetooth headset to disconnect at least one of the communication connections for media playback, the communication connection for calls, and the communication connection for transmitting control flow data, so as to save resources.
[0137] Exemplarily, for a call scenario, taking the first electronic device as a smart phone and the second electronic device as a Bluetooth headset as an example, when a user makes a call through the Bluetooth headset using the smart phone, if the call ends and the user does not perform other operations for a long time, such as initiating a new call, the smart phone determines that it is in the idle state and starts the timer. After the timer times out, if there is still no call service or other operations, the smart phone sends a connection disconnection request to the Bluetooth headset to disconnect at least one of the communication connections for media playback, the communication connection for calls, and the communication connection for transmitting control flow data, so as to save resources.
[0138] In the embodiments of the present application, when the electronic device enters the idle state, if the state does not change after a certain period of time (for example, 5 minutes), most of the protocols are disconnected, and only the basic communication protocols are retained to further reduce power consumption. When a service arrives (such as music, call, etc.), the protocols are reconnected to ensure normal functions.
[0139] In the embodiments of the present application, the first electronic device can start a timer to count the duration of the idle state, determine again whether it is still in the idle state after the timer times out, and send a connection disconnection request to request disconnection of unnecessary communication connections when it is still in the idle state, so as to ensure that the first electronic device and the second electronic device automatically disconnect when there is no data transmission for a long time, thus avoiding resource waste.
[0140] In some embodiments of the present application, after the above step 202c, the communication method provided by the embodiments of the present application may further include the following step 203:
[0141] Step 203: When the second condition is satisfied, the first electronic device sends a second instruction to the second electronic device.
[0142] Wherein, the second instruction is used to instruct to resume the frequency of sending data to the first electronic device.
[0143] In some embodiments of the present application, the second condition includes at least one of the following:
[0144] The first electronic device has data to be sent;
[0145] The first electronic device exits the low power consumption mode;
[0146] The first electronic device is not in an idle state.
[0147] It can be understood that the fact that the first electronic device has data to be sent indicates that the first electronic device has data to be sent to the second electronic device, so the frequency of data sending can be resumed or increased; the first electronic device exits the low power consumption mode, indicating that the first electronic device currently has a data transmission requirement; the first electronic device is not in an idle state, indicating that the first electronic device is executing a data service or operation and needs to exchange data with the second electronic device frequently, so the frequency of data sending can be resumed or increased.
[0148] In some embodiments of the present application, the first electronic device continuously or periodically monitors its own state, including whether there is data to be sent and whether it is in an idle state.
[0149] In some embodiments of the present application, the second instruction may be a 2cap_echo_req resume instruction.
[0150] In some embodiments of the present application, when the second condition is satisfied, the first electronic device sends the second instruction to the second electronic device through a Bluetooth communication connection.
[0151] In some embodiments of the present application, the second instruction may indicate a second frequency value, a frequency adjustment range, or a restoration to the default sending frequency.
[0152] In some embodiments of the present application, after receiving the second instruction, the second electronic device parses the content of the second instruction, sends a response to the first electronic device, and adjusts the frequency of sending data to the first electronic device according to the instruction content, such as adjusting the sending interval of data packets.
[0153] Exemplarily, for the communication scenario between a smartwatch and a smartphone, assuming that the smartwatch regularly sends health monitoring data to the smartphone, when the smartphone needs to send warning data to the smartwatch or the smartphone is not in an idle state, the smartphone meets the second condition. At this time, the smartphone sends a 2cap_echo_req resume instruction to the smartwatch, instructing the smartwatch to increase the frequency of sending health monitoring data so as to obtain user health information more timely.
[0154] Exemplarily, for the scenario of playing music through a Bluetooth headset, when the smartphone is playing music through the Bluetooth headset and needs to send the volume to the Bluetooth headset, the smartphone meets the second condition. At this time, the smartphone sends a 2cap_echo_req resume instruction to the smartwatch, instructing the smartwatch to increase the frequency of sending response data so as to receive the response of the smartwatch more timely. After receiving the instruction, the smartwatch replies with an L2cap_echo_res instruction to the phone and resets its own state to restore to the normal sending state. Further, the smartphone can set a timer to wait for 3 minutes to determine whether it is in an idle state again.
[0155] In the embodiments of the present application, the first electronic device can flexibly adjust the frequency at which the second electronic device sends data to it according to its own state and data sending requirements, thereby saving resources and improving the response speed and reliability of communication.
[0156] In some embodiments of the present application, after the first electronic device sends a connection disconnection request to the second electronic device according to the first data transmission requirement in step 202 above, or after step 202d above, or after step 202d2 above, the communication method provided by the embodiments of the present application may further include the following step 204:
[0157] Step 204: When the second condition is met, the first electronic device sends a connection request to the second electronic device.
[0158] Wherein, the above connection request is used to request the establishment of a target communication connection.
[0159] In some embodiments of the present application, when the second condition is met, the first electronic device sends a connection request to the second electronic device through a Bluetooth communication connection.
[0160] It should be noted that the explanation of the second condition can be referred to the description of the above embodiments and will not be elaborated here.
[0161] In some embodiments of the present application, the above connection request may be an L2CAP_CONNECTION_REQ.
[0162] In some embodiments of the present application, the above connection request includes information for requesting to establish a target communication connection, such as connection type, communication parameters, and other information.
[0163] In some embodiments of the present application, after receiving the connection request, the second electronic device parses the content of the connection request and sends a response to the first electronic device according to the connection request to confirm the establishment of a target communication connection with the first electronic device to start data transmission or interaction.
[0164] Exemplarily, for a call scenario, taking the first electronic device as a smart phone and the second electronic device as a Bluetooth headset as an example, in combination with the above example, when the smart phone currently needs to answer a call or initiate a call through the Bluetooth headset, that is, when the smart phone does not meet the idle state condition, the set timer is removed, and an L2CAP_CONNECTION_REQ instruction is sent to the Bluetooth headset to connect all the disconnected protocols. The connected protocols may include A2DP, HFP, HID, etc. After receiving the L2CAP_CONNECTION_REQ instruction, the smart watch sends a response instruction to the smart phone according to the instruction to confirm the connection of the above protocols.
[0165] In the embodiments of the present application, the first electronic device can flexibly send a connection request to the second electronic device according to its own state to establish a target communication connection, so as to optimize connection management and improve resource utilization. At the same time, through clear condition judgment and connection request mechanism, the controllability and reliability of the communication connection establishment process can be ensured.
[0166] The following provides an exemplary description of the communication method provided by the embodiments of the present application through specific embodiments.
[0167] In some embodiments of the present application, taking the first electronic device as a mobile phone and the second electronic device as a peer device as an example, as Figure 2 shown, the above communication method may include the following steps:
[0168] Step 10: The mobile phone establishes a Bluetooth connection with the peer device.
[0169] Exemplarily, the mobile phone sends a Page instruction to the peer device to initiate a Bluetooth connection request. The peer device responds to the Page instruction and successfully establishes an ACL link with the mobile phone. Then, based on the established ACL link, the mobile phone sends an L2CAP_CONNECTION_REQ instruction to request to connect a specific Bluetooth protocol with the peer device. The peer device replies with an L2CAP_CONNECTION_RSP instruction to confirm the connection of the corresponding Bluetooth protocol with the mobile phone, such as A2dp, HFP, HID, etc.
[0170] Step 11: The mobile phone determines whether to enter the low power consumption mode.
[0171] Exemplarily, the mobile phone monitors the service interaction with the peer device. When the mobile phone determines that there is no service interaction with the peer device for more than 15 seconds, it notifies the peer device to enter the low-power mode to reduce power consumption.
[0172] Step 12: After waiting for 15 seconds, the mobile phone determines whether to enter the low-power mode.
[0173] Exemplarily, when the mobile phone does not meet the conditions for entering the low-power mode, it sends an HCI_Exit_Sniff_Mod command. Through the Bluetooth chip, the mobile phone notifies the peer device to enter the active mode. The mobile phone waits for 15 - 30 seconds to re-determine whether it meets the conditions for entering the low-power mode.
[0174] Step 13: The mobile phone enters the low-power mode.
[0175] Exemplarily, the mobile phone sends an HCI_Sniff_Mode command and notifies the peer device to enter the sniff mode through the Bluetooth chip. After the peer device responds, both sides use the HCI_Mode_Change command to notify their respective Bluetooth chips that they are currently in the low-power mode state.
[0176] Step 14: The mobile phone determines whether it is in the idle state.
[0177] Exemplarily, the mobile phone monitors whether its service is coupled with Bluetooth. Specifically, when the mobile phone's service is not coupled with Bluetooth, such as when there is no music playing or no call, the mobile phone considers itself to be in the idle state after 3 minutes.
[0178] Step 15: The mobile phone sends a control command.
[0179] Exemplarily, after the mobile phone enters the idle state, it sends an L2cap_echo_req sniff command to the peer device, instructing the peer device to reduce the data transmission frequency or not to send data. After the peer device replies with an L2cap_echo_res command, this function takes effect officially.
[0180] Step 16: The mobile phone disconnects non-basic protocols.
[0181] Exemplarily, after the mobile phone enters the idle state, it sets a 10-minute timer. When the timer times out and the mobile phone is still in the idle state, the mobile phone sends an L2CAP_DISCONNECTION_REQ command, instructing to retain only the basic ACL link and disconnect other connected Bluetooth protocols. The peer device replies with an L2CAP_DISCONNECTION_RSP command to confirm the disconnection of the protocol.
[0182] Step 17: The mobile phone reconnects the disconnected protocol.
[0183] Exemplarily, when the mobile phone does not meet the idle state condition, remove the timer set in step 16. And send an L2CAP_CONNECTION_REQ instruction to the peer device to request connection of all disconnected Bluetooth protocols, and the connected protocols include but are not limited to A2dp, HFP, HID, etc.
[0184] Step 18: The mobile phone resumes the data sending frequency.
[0185] Exemplarily, when the mobile phone does not meet the idle state condition, send an L2cap_echo_req resume instruction to the peer device to indicate resuming the data sending frequency of the peer device. After receiving the instruction, the peer device replies with an L2cap_echo_res instruction and resets its own state to resume to the normal sending state.
[0186] Exemplarily, the mobile phone sets a timer to wait for 3 minutes to monitor whether the idle judgment condition is met again so as to enter the idle mode again.
[0187] In the embodiments of the present application, by simple instructions, the frequency of exiting the low-power mode and waking up the application interface when the mobile phone and the peer device are connected is reduced, so as to further reduce power consumption and give full play to the advantages of Bluetooth low power consumption.
[0188] In some embodiments of the present application, taking the first electronic device as a mobile phone and the second electronic device as a peer device as an example, as Figure 3 shown, the above communication method may include the following steps:
[0189] Step 20: The mobile phone determines whether it is in the low-power mode.
[0190] Exemplarily, both the mobile phone and the peer device perform a check operation to determine whether they are currently in the low-power mode.
[0191] Step 21: The mobile phone exits the low-power mode.
[0192] Exemplarily, the mobile phone sends an HCI_Exit_Sniff_Mode instruction to the peer device, and the peer device responds and exits the low-power mode, and then switches to the active mode.
[0193] Step 22: Determine whether the mobile phone is in the idle state.
[0194] Exemplarily, the mobile phone performs a judgment operation to determine whether it is currently in the idle state.
[0195] Step 23: The mobile phone sends an instruction.
[0196] Exemplarily, the mobile phone sends an L2cap_echo_req resume instruction to the peer device to resume the data sending frequency of the peer device. The peer device responds and performs the operation of resuming the data sending frequency to ensure normal communication.
[0197] Step 24: The mobile phone reconnects to the disconnected Bluetooth protocol.
[0198] Exemplarily, the mobile phone removes the set timer and sends an L2CAP_CONNECTION_REQ instruction to the peer device to request to connect to the disconnected Bluetooth protocol, including but not limited to A2dp, HFP, HID, etc.
[0199] In the embodiments of the present application, after the mobile phone or the peer device exits the low-power mode, through simple instructions, the data sending frequency of the peer device to the mobile phone is quickly resumed, and the disconnected connection is quickly established, thereby ensuring the data transmission efficiency.
[0200] Figure 4 It is a schematic flowchart of the communication method provided by the embodiments of the present application. As Figure 4 shown, the communication method may include the following steps 301 and step 302:
[0201] Step 301: When the second electronic device is in the low-power mode, the second electronic device obtains the second data transmission requirement.
[0202] Step 302: The second electronic device performs at least one of the following according to the second data transmission requirement:
[0203] Switch from the low-power mode to the active mode;
[0204] Reduce the frequency of sending data to the first electronic device or stop sending data to the first electronic device.
[0205] In some embodiments of the present application, the above second data transmission requirement includes at least one of the following:
[0206] The type of data;
[0207] The priority of the data;
[0208] The amount of data.
[0209] It should be noted that for the explanation of the second data transmission requirement, reference can be made to the explanation of the first data transmission requirement in the above embodiments, which will not be elaborated here.
[0210] It should be noted that the specific solutions for the second electronic device to perform at least one of the following operations according to the second data transmission requirement are similar to those on the first electronic device side. For the steps 301 and 302 and their related content and corresponding beneficial effects, reference can be made to the relevant descriptions in the above steps 201 and 202. To avoid repetition, they will not be elaborated here.
[0211] In some embodiments of the present application, the communication method may further include the following step 303:
[0212] Step 303: When the second electronic device is in the low-power mode, the second electronic device receives the first information.
[0213] Wherein, the above first information includes at least one of the following:
[0214] The first instruction, which instructs to reduce the frequency of sending data to the first electronic device or instructs not to send data to the first electronic device;
[0215] The connection disconnection request, which is used to request to disconnect the target communication connection between the first electronic device and the second electronic device.
[0216] It should be noted that the explanation of the first information can refer to the relevant descriptions in the embodiments on the first electronic device side above, and will not be elaborated here.
[0217] In some embodiments of the present application, after receiving the first instruction, the second electronic device decides whether to reduce the data sending frequency or not send data, for example, not send data that is not urgent and not important.
[0218] In some embodiments of the present application, the second electronic device may send a first response to the first electronic device, indicating agreement to reduce the frequency of sending data to the first electronic device or not send data to the first electronic device. Exemplarily, the first response may be L2cap_echo_res.
[0219] Exemplarily, the second electronic device receives the first instruction sent from the first electronic device and decides whether to reduce the frequency of sending data to the first electronic device or not send data to the first electronic device. In this way, since the second electronic device can reduce the data frequency or not send data to the first electronic device, its own power consumption can be reduced. The first electronic device does not need to frequently receive data from the second electronic device or not receive data from the second electronic device, so it does not need to frequently exit the low-power mode and switch to the active working mode for data transmission, thereby reducing power consumption.
[0220] In some embodiments of the present application, after the second electronic device receives the first instruction, the second electronic device determines whether to reduce the data transmission frequency or not transmit data, for example, not transmit data that is not urgent and not important.
[0221] In some embodiments of the present application, after the second electronic device receives a connection disconnection request, the second electronic device determines whether to disconnect the target communication connection.
[0222] In some embodiments of the present application, the second electronic device replies to the first electronic device with a connection disconnection response, and the connection disconnection response is used to confirm the disconnection of the target communication connection;
[0223] Wherein, the above-mentioned target communication connection is a communication connection established through the Logical Link Control and Adaptation Protocol (L2CAP) protocol; the target communication connection includes at least one of the following: a communication protocol for media playback, a communication connection for calls, and a communication connection for transmitting control flow data.
[0224] Exemplarily, for a Bluetooth communication scenario, taking the first electronic device as a smart phone and the second electronic device as a Bluetooth headset as an example, after the Bluetooth headset receives the L2CAP_DISCONNECTION_REQ instruction from the smart phone, the Bluetooth headset replies with L2CAP_DISCONNECTION_RSP, agreeing to only retain the basic ACL link and disconnect other protocols.
[0225] The communication method provided by the embodiments of the present application, when the second electronic device is in the low-power mode, the second electronic device performs a transmission control operation according to the second data transmission requirement. Through this method, the second electronic device can adjust the frequency of sending data to the first electronic device according to the second data transmission requirement, or not send data to the first electronic device, or disconnect the communication connection with the first electronic device, so as to flexibly control data transmission and mode switching according to the actual data transmission requirement, thereby reducing unnecessary mode switching and interface wake-up, and further reducing the power consumption of the electronic device.
[0226] In some embodiments of the present application, the process in which the second electronic device switches from the low-power mode to the active mode in step 302 above may include the following step 302a:
[0227] Wherein, the above-mentioned first transmission frequency is related to the period of the low-power mode.
[0228] Step 302a: When the first data transmission requirement meets the third condition, the second electronic device switches from the low-power mode to the active mode and sends data in the active mode.
[0229] In some embodiments of the present application, the third condition includes at least one of the following:
[0230] The type of the data is core business data, and the core business data includes at least one of the following: control instructions, emergency notification data, and health monitoring data;
[0231] The priority of the data is greater than or equal to the third threshold;
[0232] The data volume of the data is greater than or equal to the fourth threshold.
[0233] It should be noted that for the explanation of the third condition, reference can be made to the relevant description of the first condition above, and details will not be elaborated here.
[0234] In some embodiments of the present application, when the second electronic device determines that the type of the data to be transmitted is auxiliary service data, such as device status data, environmental context data, monitoring data, etc., it maintains the low-power mode, and in the low-power mode, it transmits data or does not transmit data according to the first transmission frequency; or, if it determines that the data type is critical service data, the second electronic device switches from the low-power mode to the active mode, and in the active mode, the second electronic device transmits data at a higher frequency to ensure the timely transmission of the data.
[0235] Exemplarily, taking the first electronic device as a smart phone and the second electronic device as a smart bracelet as an example, for the scenario of data synchronization of the smart bracelet, after the user pairs and connects the smart phone with the smart bracelet, when the smart bracelet receives the first instruction from the smart phone and needs to synchronize auxiliary service data such as weather or location information to the smart bracelet, it does not exit the low-power mode and synchronizes data to the smart bracelet at a cycle in the low-power mode.
[0236] Exemplarily, for the scenario of playing music through a Bluetooth headset, after the user pairs and connects the smart phone with the Bluetooth headset, when the smart bracelet receives the first instruction from the smart phone and needs to send an emergency warning message to the smart phone, it exits the low-power mode and immediately sends the emergency warning message to the smart phone in the active mode.
[0237] In some embodiments of the present application, when the second electronic device determines that the priority of the data to be transmitted is less than the third threshold, it maintains the low-power mode, and in the low-power mode, it transmits data or does not transmit data according to the first transmission frequency; or, if it determines that the priority of the data is greater than or equal to the third threshold, the second electronic device switches from the low-power mode to the active mode, and in the active mode, the second electronic device transmits data at a higher frequency to ensure the timely transmission of the data.
[0238] Exemplarily, taking the first electronic device as a smartphone and the second electronic device as a Bluetooth headset as an example, for the Bluetooth call scenario, after the Bluetooth headset receives the first instruction from the smartphone, if the priority of the voice data to be transmitted is 6, the Bluetooth headset determines that the priority of the voice data to be transmitted is greater than the third threshold, and switches from the low-power mode to the active mode and immediately sends data to the smartphone.
[0239] Exemplarily, for the Bluetooth call scenario, if the priority of the device wearing status data to be transmitted by the Bluetooth headset is 4, the Bluetooth headset determines that the priority of the voice data to be transmitted is less than the third threshold, maintains the low-power mode, and in the low-power mode, sends the device wearing status data to the smartphone according to the period of the low-power mode. For example, the device wearing status data is sent when 500 ms is reached.
[0240] In this way, by determining whether the first data transmission requirement is met, the second electronic device can more accurately select the working mode according to the first data transmission requirement, thereby improving the balance effect between power consumption and performance. For example, for auxiliary service data with a lower priority, it is sent once every 500 ms or 1000 ms. By reducing the sending frequency of non-urgent data, the power consumption is effectively reduced; while for data with a higher priority or a larger data volume, it can quickly switch to the active mode to ensure the timely transmission of data.
[0241] In some embodiments of the present application, when the second electronic device determines that the data volume of the data to be transmitted is less than the fourth threshold, it maintains the low-power mode, and in the low-power mode, sends data or does not send data according to the first sending frequency; or, if it is determined that the data volume of the data is greater than or equal to the fourth threshold, the first electronic device switches from the low-power mode to the active mode, and in the active mode, the second electronic device sends data at a higher frequency to ensure the timely transmission of data.
[0242] Exemplarily, taking the first electronic device as a smartphone and the second electronic device as a Bluetooth headset as an example, for the Bluetooth music playback scenario, when the Bluetooth headset determines that the data to be transmitted is non-urgent data and the data volume is 90 bytes, such as battery power data, it can maintain the low-power mode, and in the low-power mode, send the data to the smartphone according to the period of the low-power mode or not send the data.
[0243] In this way, by determining whether the first data transmission requirement is met, the second electronic device can more accurately select the operating mode according to the first data transmission requirement, thereby improving the balance between power consumption and performance. For example, for auxiliary service data that is not urgent and has a small data volume, it is sent once every 500 ms or 1000 ms. By reducing the transmission frequency of non-urgent data, the power consumption is effectively reduced; while for data with a higher priority or a larger data volume, it can quickly switch to the active mode to ensure the timely transmission of data.
[0244] In the embodiments of the present application, the first electronic device can intelligently select to maintain the low-power mode or switch to the active mode according to the first information and the first data transmission requirement, which not only ensures the low-power transmission of auxiliary service data but also ensures the timely transmission of critical service data, thereby effectively balancing power consumption and performance.
[0245] The following uses specific embodiments to exemplarily illustrate the communication method provided by the embodiments of the present application.
[0246] In some embodiments of the present application, taking the first electronic device as a mobile phone and the second electronic device as a peer device as an example, as Figure 5 shown, the above communication method may include the following steps:
[0247] Step 31: The peer device determines whether it has entered the low-power mode.
[0248] Exemplarily, when the peer device needs to send data, it determines whether it has entered the low-power mode currently.
[0249] Step 32: The peer device determines whether the data to be sent currently is urgent and important.
[0250] Exemplarily, urgent and important information mainly includes: the user's active actions, such as actively pressing a button to play music, and information that the user needs to know immediately, such as a low battery warning.
[0251] Step 33: The peer device determines whether it has received a control instruction.
[0252] Step 34: The peer device controls the transmission frequency or does not send data.
[0253] Exemplarily, if the mobile phone has sent the L2cap_echo_req sniff instruction to reduce the transmission frequency, the peer device needs to control the transmission frequency according to the situation, or directly does not send some non-urgent and non-important data.
[0254] Exemplarily, the data that needs to control the transmission frequency includes: battery information, location information, etc., and these data can be updated once every 30 minutes or longer.
[0255] Step 35: Exit the low power consumption mode.
[0256] Exemplarily, when the data to be sent meets the conditions of being urgent and important, the peer device immediately sends an HCI_Exit_Sniff_Mode instruction to request exiting the low power consumption mode.
[0257] Step 36: The peer device sends data.
[0258] Exemplarily, the peer device can send data to the mobile phone after exiting the low power consumption mode.
[0259] In the embodiment of the present application, the peer device can reduce the data interaction frequency with the mobile phone or not transmit data that is not urgent and not important according to the first data transmission requirement and the instruction of the mobile phone. For example, for unimportant information such as battery power, wearing status, location, etc., it can be sent as little as possible or not sent at all, so as to reduce the data sending frequency and achieve the purpose of reducing power consumption.
[0260] The execution subject of the communication method provided in the embodiment of the present application can be a communication device, and this communication device can be an electronic device, or a functional module or functional entity in the electronic device. The following takes the communication device executing the communication method as an example to illustrate the communication method provided in the embodiment of the present application.
[0261] Each of the above method embodiments, or various possible implementation manners in each method embodiment, can be executed alone, or, on the premise of no contradiction, can also be executed in combination with each other, which can be specifically determined according to actual usage requirements, and the embodiment of the present application does not limit this.
[0262] The execution subject of the communication method provided in the embodiment of the present application can be a communication device. In the embodiment of the present application, the communication method executed by the communication device is taken as an example to illustrate the communication device provided in the embodiment of the present application.
[0263] Figure 6 For the structural schematic diagram of the communication device provided in the embodiment of the present application, as Figure 6 shown, the communication device 500 may include: an acquisition module 501 and a processing module 502, where: the acquisition module 501 is used to acquire the first data transmission requirement when the first electronic device is in the low power consumption mode; the processing module 502 is used to execute at least one of the following according to the first data transmission requirement: switch from the low power consumption mode to the active mode; send a first instruction to the second electronic device, and the first instruction instructs to reduce the frequency of sending data to the first electronic device or not send data to the first electronic device; send a connection disconnection request to the second electronic device, and the connection disconnection request is used to request to disconnect the target communication connection between the first electronic device and the second electronic device.
[0264] In some embodiments of the present application, the above-mentioned first data transmission requirement includes at least one of the following:
[0265] The type of data;
[0266] The priority of the data;
[0267] The amount of data;
[0268] The service transmission status parameter of the first electronic device.
[0269] In some embodiments of the present application, the above-mentioned processing module is specifically configured to: when the first data transmission requirement meets the first condition, control the first electronic device to switch from the low-power mode to the active mode, and send data in the active mode.
[0270] In some embodiments of the present application, the above-mentioned first condition includes at least one of the following: the type of data is core service data, and the core service data includes at least one of the following: control instructions, alarm data; the priority of the data is greater than or equal to the first threshold; the amount of data is greater than or equal to the second threshold.
[0271] In some embodiments of the present application, the above-mentioned processing module is specifically configured to: when the first electronic device is in the idle state, send a first instruction to the second electronic device.
[0272] In some embodiments of the present application, the processing module is specifically configured to: when the first electronic device is in the idle state, the first electronic device sends a connection disconnection request to the second electronic device.
[0273] In some embodiments of the present application, the above-mentioned processing module is specifically configured to: when the first electronic device is in the idle state, the first electronic device starts a timer to start timing; after the timer times out, if the first electronic device continues to be in the idle state, a connection disconnection request is sent to the second electronic device; wherein, the target communication connection is a communication connection established through the Logical Link Control and Adaptation Protocol (L2CAP) protocol; the target communication connection includes at least one of the following: a communication connection for media playback; a communication connection for calls; a communication connection for transmitting control flow data.
[0274] In some embodiments of the present application, the above-mentioned device further includes: a sending module; the sending module is configured to, after the first electronic device sends a first instruction to the second electronic device, when the second condition is met, send a second instruction to the second electronic device, and the second instruction is used to indicate to resume the frequency of sending data to the first electronic device; wherein, the second condition includes at least one of the following: the first electronic device has data to be sent; the first electronic device exits the low-power mode; the first electronic device is not in the idle state.
[0275] In some embodiments of the present application, the above device further includes: a sending module; the sending module is configured to, after the first electronic device sends a connection disconnection request to the second electronic device, and when a second condition is satisfied, send a connection request to the second electronic device, where the connection request is used to request to establish a target communication connection; wherein, the second condition includes at least one of the following: the first electronic device has data to be sent; the first electronic device exits the low power consumption mode; the first electronic device is not in an idle state.
[0276] For the communication device provided in the embodiments of the present application, when the first electronic device is in the low power consumption mode, the communication device obtains a first data transmission requirement, and according to the first data transmission requirement, performs at least one of the following: switches from the low power consumption mode to the active mode; reduces the frequency of sending data to the second electronic device or does not send data to the second electronic device; sends a first instruction to the second electronic device, where the first instruction instructs to reduce the frequency of sending data to the first electronic device or instructs not to send data to the first electronic device; determines whether to send a connection disconnection request to the second electronic device, where the connection disconnection request is used to request to disconnect the target communication connection. By this method, the first electronic device can obtain the first data transmission requirement and decide whether to switch the working mode, whether to send a control instruction to adjust the data sending frequency or disconnect the communication connection according to the first data transmission requirement, so as to realize flexible control of data transmission and mode switching according to the actual data transmission requirement, thereby reducing unnecessary mode switching and interface wake-up, and further reducing the power consumption of the electronic device.
[0277] Figure 7 It is a schematic structural diagram of the communication device provided in the embodiments of the present application, as Figure 7 shown, the communication device 600 includes: an acquisition module 601 and a processing module 602, where: the acquisition module 601 is configured to, when the second electronic device is in the low power consumption mode, obtain a second data transmission requirement; the processing module 602 is configured to, according to the second data transmission requirement, perform at least one of the following: switch from the low power consumption mode to the active mode; reduce the frequency of sending data to the first electronic device or do not send data to the first electronic device.
[0278] In some embodiments of the present application, the above first data transmission requirement includes at least one of the following:
[0279] The type of data;
[0280] The priority of the data;
[0281] The data volume of the data.
[0282] In some embodiments of the present application, the above communication device may further include a receiving module 601, which is configured to receive first information when the second electronic device is in the low-power mode; wherein, the above first information includes at least one of the following: a first instruction, which instructs to reduce the frequency of sending data to the first electronic device or instructs not to send data to the first electronic device; a connection disconnection request, which is used to request to disconnect the target communication connection.
[0283] In some embodiments of the present application, the above processing module is specifically configured to: switch from the low-power mode to the active mode when the above second data transmission requirement meets the third condition, and send data in this active mode.
[0284] In some embodiments of the present application, the above third condition includes at least one of the following:
[0285] The type of data is core service data, and the core service data includes at least one of the following: a control instruction, an emergency notification data, a health monitoring data;
[0286] The priority of the data is greater than or equal to a third threshold;
[0287] The data volume of the data is greater than or equal to a fourth threshold.
[0288] The communication device provided by the embodiments of the present application, when the second electronic device is in the low-power mode, the communication device determines the data sending frequency according to the second data transmission requirement, or does not send data, or disconnects the communication connection, realizing that it can flexibly control data transmission and mode switching according to the actual data transmission requirement, thereby reducing unnecessary mode switching and interface wake-up, and further reducing the power consumption of the electronic device.
[0289] The communication device in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than terminals. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a handheld computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. It can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc. The embodiments of the present application do not make specific limitations.
[0290] The communication device in the embodiments of the present application can be a device with an operating system. The operating system can be the Android operating system, the iOS operating system, or other possible operating systems. The embodiments of the present application do not make specific limitations.
[0291] The communication device provided in the embodiments of the present application can implement each process implemented by the method embodiments of the communication method. To avoid repetition, it will not be elaborated here.
[0292] Optionally, as Figure 8 shown, the embodiments of the present application further provide an electronic device 700, including a processor 701 and a memory 702. A program or instruction that can run on the processor 701 is stored on the memory 702. When the program or instruction is executed by the processor 701, it implements each step of the above communication method embodiments and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0293] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0294] Figure 9 It is a schematic diagram of the hardware structure of an electronic device for implementing the embodiments of the present application.
[0295] The electronic device 100 includes, but is not limited to: a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and other components.
[0296] Those skilled in the art can understand that the electronic device 100 may further include a power source (such as a battery) for supplying power to each component. The power source can be logically connected to the processor 110 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system. Figure 9 The structure of the electronic device shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0297] In some embodiments of the present application, the processor 110 is configured to obtain a first data transmission requirement when the first electronic device is in a low-power mode; the processor 110 is further configured to perform a transmission control operation according to the first data transmission requirement; wherein, the transmission control operation includes at least one of the following: determining whether to switch from the low-power mode to the active mode; determining whether to send a first instruction to the second electronic device, the first instruction indicating to reduce the frequency of sending data to the first electronic device or indicating not to send data to the first electronic device; determining whether to send a connection disconnection request to the second electronic device, the connection disconnection request being used to request disconnection of the target communication connection between the first electronic device and the second electronic device.
[0298] In some embodiments of the present application, the above first data transmission requirement includes at least one of the following:
[0299] The type of data;
[0300] The priority of the data;
[0301] The data volume of the data;
[0302] The service transmission status parameter of the first electronic device.
[0303] In some embodiments of the present application, the above processor 110 is specifically configured to: when the first data transmission requirement meets a first condition, control the first electronic device to switch from the low-power mode to the active mode and send data in the active mode.
[0304] In some embodiments of the present application, the above first condition includes at least one of the following: the type of data is core service data, and the core service data includes at least one of the following: control instructions, alarm data; the priority of the data is greater than or equal to a first threshold; the data volume of the data is greater than or equal to a second threshold.
[0305] In some embodiments of the present application, the above-mentioned processor 110 is specifically configured to: when the first electronic device is in an idle state, send a first instruction to the second electronic device.
[0306] In some embodiments of the present application, the processor 110 is specifically configured to: when the first electronic device is in an idle state, the first electronic device sends a connection disconnection request to the second electronic device.
[0307] In some embodiments of the present application, the processor 110 is specifically configured to: when the first electronic device is in an idle state, start a timer to start timing; after the timer times out, if the first electronic device remains in an idle state, the first electronic device sends a connection disconnection request to the second electronic device; wherein, the target communication connection is a communication connection established through the Logical Link Control and Adaptation Protocol (L2CAP); the target communication connection includes at least one of the following: a communication connection for media playback; a communication connection for calls; a communication connection for transmitting control flow data.
[0308] In some embodiments of the present application, the radio frequency unit 101 is configured to, after the first electronic device sends a first instruction to the second electronic device, and when the second condition is met, send a second instruction to the second electronic device, where the second instruction is used to indicate resuming the frequency of sending data to the first electronic device; wherein, the second condition includes at least one of the following: the first electronic device has data to be sent; the first electronic device exits the low power consumption mode; the first electronic device is not in an idle state.
[0309] In some embodiments of the present application, the radio frequency unit 101 is further configured to, after sending a connection disconnection request to the second electronic device, and when the second condition is met, send a connection request to the second electronic device, where the connection request is used to request the establishment of a target communication connection; wherein, the second condition includes at least one of the following: the first electronic device has data to be sent; the first electronic device exits the low power consumption mode; the first electronic device is not in an idle state.
[0310] In the electronic device provided by the embodiment of the present application, when the first electronic device is in the low-power mode, the communication device obtains the first data transmission requirement, and according to the first data transmission requirement, performs at least one of the following: switches from the low-power mode to the active mode; reduces the frequency of sending data to the second electronic device or does not send data to the second electronic device; sends a first instruction to the second electronic device, where the first instruction instructs to reduce the frequency of sending data to the first electronic device or instructs not to send data to the first electronic device; determines whether to send a connection disconnection request to the second electronic device, and the connection disconnection request is used to request to disconnect the target communication connection. Through this method, the first electronic device can obtain the first data transmission requirement and decide whether to switch the working mode, whether to send a control instruction to adjust the data sending frequency or disconnect the communication connection according to the first data transmission requirement, so as to flexibly control data transmission and mode switching according to the actual data transmission requirement, thereby reducing unnecessary mode switching and interface wake-up, and further reducing the power consumption of the electronic device.
[0311] In some embodiments of the present application, the radio frequency unit 101 is used to obtain the second data transmission requirement when the second electronic device is in the low-power mode; the processor 110 is further used to perform at least one of the following according to the second data transmission requirement: switches from the low-power mode to the active mode; reduces the frequency of sending data to the first electronic device or does not send data to the first electronic device..
[0312] In some embodiments of the present application, the above first data transmission requirement includes at least one of the following:
[0313] The type of data;
[0314] The priority of the data;
[0315] The data volume of the data.
[0316] In some embodiments of the present application, the above radio frequency unit 101 is used to receive the first information when the second electronic device is in the low-power mode; wherein, the above first information includes at least one of the following: a first instruction, where the first instruction instructs to reduce the frequency of sending data to the first electronic device or instructs not to send data to the first electronic device; a connection disconnection request, and the connection disconnection request is used to request to disconnect the target communication connection.
[0317] In some embodiments of the present application, the processor 110 is specifically used to: when the above second data transmission requirement meets the third condition, switch from the low-power mode to the active mode and send data in this active mode.
[0318] In some embodiments of the present application, the above third condition includes at least one of the following:
[0319] The type of the data is core business data, and the core business data includes at least one of the following: control instructions, emergency notification data, and health monitoring data;
[0320] The priority of the data is greater than or equal to the third threshold;
[0321] The data volume of the data is greater than or equal to the fourth threshold.
[0322] In the electronic device provided by the embodiment of the present application, when the second electronic device is in the low power consumption mode, the communication device receives the first information, determines the data transmission frequency according to the second data transmission requirement, or does not transmit data, or disconnects the communication connection, realizing flexible control of data transmission and mode switching according to the actual data transmission requirement, thereby reducing unnecessary mode switching and interface wake-up, and further reducing the power consumption of the electronic device.
[0323] It should be understood that in the embodiment of the present application, the input unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042. The graphics processor 1041 processes the image data of static pictures or videos obtained by an image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also called a touch screen. The touch panel 1071 may include two parts: a touch detection device and a touch controller. The other input devices 1072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.
[0324] The memory 109 can be used to store software programs and various data. The memory 109 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area may store an operating system, application programs or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 109 may include a volatile memory or a non-volatile memory, or the memory 109 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct rambus random access memory (DRRAM). The memory 109 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memories.
[0325] The processor 110 may include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor. Among them, the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above modem processor may not be integrated into the processor 110 either.
[0326] The embodiments of the present application also provide a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, it implements each process of the above communication method embodiments and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0327] Among them, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.
[0328] Another embodiment of the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the communication method embodiment described above, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0329] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0330] The embodiments of the present application provide a computer program product. The program product is stored in a storage medium and is executed by at least one processor to implement each process of the communication method embodiment described above, and can achieve the same technical effects. To avoid repetition, it will not be elaborated here.
[0331] It should be noted that in this article, the term "including", "comprising", or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article, or device. Without more limitations, an element defined by the statement "including one..." does not exclude the existence of other identical elements in the process, method, article, or device including that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed. It may also include performing functions in a substantially simultaneous manner or in the reverse order according to the functions involved. For example, the methods described may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, the features described with reference to certain examples may be combined in other examples.
[0332] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to enable a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0333] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific implementation manners. The above specific implementation manners are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
Claims
1. A communication method, characterized in that: The method comprises: When the first electronic device is in a low power consumption mode, the first electronic device acquires a first data transmission requirement; The first electronic device performs at least one of the following according to the first data transmission requirement: Switching from the low power mode to an active mode; reducing the frequency of sending data to the second electronic device or not sending data to the second electronic device; Sending a first instruction to a second electronic device, wherein the first instruction instructs the second electronic device to reduce a frequency of sending data to the first electronic device or not to send data to the first electronic device; A connection disconnection request is sent to the second electronic device, where the connection disconnection request is used to request to disconnect a target communication connection between the first electronic device and the second electronic device.
2. The method according to claim 1, characterized in that The first data transmission requirement includes at least one of the following: The type of data; Prioritization of data; The amount of data; The service transmission status parameter of the first electronic device.
3. The method according to claim 1 or 2, characterized in that: The first electronic device switches from the low power consumption mode to the active mode according to the first data transmission requirement, including: When the first data transmission requirement satisfies a first condition, the first electronic device switches from the low power consumption mode to an active mode, and sends data in the active mode; The first condition includes at least one of the following: The type of the data is core business data, and the core business data includes at least one of the following: control instructions, alarm data; The priority of the data is greater than or equal to a first threshold; The amount of the data is greater than or equal to a second threshold.
4. The method according to claim 1 or 2, characterized in that: The first electronic device sending a first instruction to the second electronic device according to the first data transmission requirement includes: When the first electronic device is in an idle state, the first electronic device sends the first instruction to the second electronic device.
5. The method according to claim 1 or 2, characterized in that: The first electronic device sending a disconnection request to the second electronic device according to the first data transmission requirement includes: When the first electronic device is in an idle state, the first electronic device starts a timer to start timing; After the timer times out, if the first electronic device continues to be in the idle state, the first electronic device sends the disconnection request to the second electronic device; The target communication connection includes at least one of the following: a communication connection for media playback; a communication connection for calls; and a communication connection for transmitting control stream data.
6. The method according to claim 4, characterized in that After the first electronic device sends the first instruction to the second electronic device, the method further includes: When the second condition is met, the first electronic device sends a second instruction to the second electronic device, where the second instruction is used to instruct the second electronic device to resume the frequency of sending data to the first electronic device; The second condition includes at least one of the following: The first electronic device has data to be sent; The first electronic device exits the low power consumption mode; The first electronic device is not in the idle state.
7. The method according to claim 5, characterized in that After the first electronic device sends a disconnection request to the second electronic device according to the first data transmission requirement, the method further includes: When the second condition is met, the first electronic device sends a connection request to the second electronic device, where the connection request is used to request to establish the target communication connection; The second condition includes at least one of the following: The first electronic device has data to be sent; The first electronic device exits the low power consumption mode; The first electronic device is not in the idle state.
8. A communication method, characterized in that: The method comprises: When the second electronic device is in a low power consumption mode, the second electronic device acquires a second data transmission demand; The second electronic device performs at least one of the following according to the second data transmission requirement: Switching from the low power mode to an active mode; The frequency of transmitting data to the first electronic device is reduced or no data is transmitted to the first electronic device.
9. The method according to claim 8, characterized in that The second data transmission requirement includes at least one of the following: The type of data; Prioritization of data; The amount of data.
10. The method according to claim 8, characterized in that The method further comprises: When the second electronic device is in a low power consumption mode, the second electronic device receives first information; The first information includes at least one of the following: a first instruction, wherein the first instruction instructs the second electronic device to reduce the frequency of sending data to the first electronic device or not to send data to the first electronic device; A connection disconnection request, where the connection disconnection request is used to request to disconnect a target communication connection between the first electronic device and the second electronic device.
11. The method according to claim 8 or 9, characterized in that: The second electronic device switches from the low power consumption mode to the active mode according to the second data transmission requirement, including: When the second data transmission requirement satisfies a third condition, the second electronic device switches from the low power consumption mode to an active mode and sends data in the active mode; The third condition includes at least one of the following: The type of data is core business data, and the core business data includes at least one of the following: control instructions, emergency notification data, and health monitoring data; The priority of the data is greater than or equal to a third threshold; The amount of the data is greater than or equal to a fourth threshold.
12. A communication device, characterized in that: The device comprises: an acquisition module and a processing module, wherein: The acquisition module is used to acquire the first data transmission requirement when the first electronic device is in a low power consumption mode; The processing module is configured to perform at least one of the following according to the first data transmission requirement: Controlling the first electronic device to switch from the low power consumption mode to an active mode; reducing the frequency of sending data to the second electronic device or not sending data to the second electronic device; Sending a first instruction to a second electronic device, wherein the first instruction instructs the second electronic device to reduce a frequency of sending data to the first electronic device or not to send data to the first electronic device; A connection disconnection request is sent to the second electronic device, where the connection disconnection request is used to request to disconnect a target communication connection between the first electronic device and the second electronic device.
13. The device according to claim 12, characterized in that The processing module is specifically used for: When the first data transmission requirement satisfies a first condition, the first electronic device switches from the low power consumption mode to an active mode, and sends data in the active mode; The first condition includes at least one of the following: The type of the data is core business data, and the core business data includes at least one of the following: control instructions, alarm data; The priority of the data is greater than or equal to a first threshold; The amount of the data is greater than or equal to a second threshold.
14. The device according to claim 12, characterized in that The processing module is specifically used for: When the first electronic device is in an idle state, starting a timer to start timing; After the timer times out, if the first electronic device continues to be in the idle state, sending the disconnection request to the second electronic device; The target communication connection includes at least one of the following: a communication connection for media playback; a communication connection for calls; and a communication connection for transmitting control stream data.
15. A communication device, characterized in that: The device comprises: an acquisition module and a processing module, wherein: The acquisition module is used to acquire the second data transmission requirement when the second electronic device is in a low power consumption mode; The processing module is configured to perform at least one of the following according to the second data transmission requirement: Controlling the second electronic device to switch from the low power consumption mode to the active mode; The frequency of transmitting data to the first electronic device is reduced or no data is transmitted to the first electronic device.
16. The device according to claim 15, characterized in that The device further comprises: a receiving module; The receiving module receives the first information when the second electronic device is in a low power consumption mode; The first information includes at least one of the following: a first instruction, wherein the first instruction instructs the second electronic device to reduce the frequency of sending data to the first electronic device or not to send data to the first electronic device; A connection disconnection request, where the connection disconnection request is used to request to disconnect a target communication connection between the first electronic device and the second electronic device.
17. The device according to claim 15, characterized in that The processing module is specifically used for: When the second data transmission requirement satisfies a third condition, the second electronic device switches from the low power consumption mode to an active mode and sends data in the active mode; The third condition includes at least one of the following: The type of data is core business data, and the core business data includes at least one of the following: control instructions, emergency notification data, and health monitoring data; The priority of the data is greater than or equal to a third threshold; The amount of the data is greater than or equal to a fourth threshold.
18. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the communication method as described in any one of claims 1 to 7 are implemented, or the steps of the communication method as described in any one of claims 8 to 11 are implemented.
19. A readable storage medium, characterized in that: The readable storage medium stores a program or an instruction, and when the program or the instruction is executed by the processor, the steps of the communication method according to any one of claims 1 to 7 are implemented, or the steps of the communication method according to any one of claims 8 to 11 are implemented.