Communication method and device
By negotiating with the user terminal to determine the sleep cycle, disconnecting and entering the sleep state, the problem of high power consumption of Wi-Fi devices when there is no data transmission is solved, and the battery life is improved.
Patent Information
- Application Number
- CN202411389070.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-31
- Publication Date
- 2024-12-17
AI Technical Summary
Existing Wi-Fi devices cannot enter the sleep state when there is no data transmission by the user terminal, resulting in high power consumption and short battery life, and lack of low-power protocols for AP devices.
By negotiating with the user terminal, the sleep cycle is determined based on the data transmission record, the connection is disconnected and the sleep state is reduced, and the battery life is improved.
Without affecting user usage, the power consumption of communication equipment is effectively reduced and the battery life of the product is extended, such as the power consumption of the entire machine is reduced by 100+mA.
Smart Images

Figure CN119155778A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a communication method and device. Background Art
[0002] Wi-Fi devices are generally used to convert 3G, 4G, 5G or LTE networks to Wi-Fi, providing Wi-Fi hotspot functions for electronic devices such as mobile phones, watches or computers. Figure 1A The figure shows an application scenario diagram of a portable Wi-Fi device (such as a portable AP device). Compared with a fixed AP router, the portable AP device is generally battery-powered, and its product life is one of the important factors affecting the user experience.
[0003] At present, the 802.11 protocol (universal standard protocol for wireless LAN) only defines low-power-consumption related protocols for user terminals, such as PSM (Power Save Mode), but does not have low-power-consumption related protocols for AP devices. Figure 1B As shown, in the existing communication method, during the use of the accompanying AP device, there is a common scenario, that is, the user terminal such as a mobile phone or other electronic device is connected to the accompanying AP device, but the user does not use the terminal, only maintains the Wi-Fi connection, and does not transmit data. At this time, since the accompanying AP device needs to receive data packets that may come from the user terminal at any time, the accompanying AP device needs to maintain a connection with the user terminal at all times and is always in a Wi-Fi working state. It cannot sleep, which results in high power consumption and reduces the product life. Summary of the invention
[0004] The present application provides a communication method and device, which, when a user terminal (such as an electronic device) has no data transmission, negotiates with a communication device such as an AP device to disconnect and enter a sleep state, which is beneficial to reducing power consumption and improving product battery life without affecting user use.
[0005] In a first aspect, the present application provides a communication method, which is applied to a communication device, wherein the communication device establishes a connection with one or more electronic devices, and the communication device includes a data transmission record of each of the electronic devices, and the method includes:
[0006] receiving first information sent by one or more electronic devices, wherein the first information is used to request to enter a dormant state;
[0007] Determining a sleep cycle according to the data transmission record of each of the electronic devices;
[0008] Sending second information to each of the electronic devices, wherein the second information includes the sleep cycle;
[0009] The connection with each of the electronic devices is disconnected, and a sleep state is entered based on the sleep cycle.
[0010] In one possible implementation manner, the electronic device includes an idle time length, and the first information is determined based on a comparison result between the idle time length and a preset time length.
[0011] In one possible implementation, the data transmission record includes the heartbeat packet sending time and the heartbeat cycle of the electronic device, and before receiving the first information sent by one or more of the electronic devices, the method further includes:
[0012] Based on the heartbeat packet sending time and the heartbeat cycle of each electronic device, determine third information, wherein the third information is used to request to unify the heartbeat packet sending time and the heartbeat cycle of each electronic device;
[0013] The third information is sent to each of the electronic devices.
[0014] In one possible implementation, the sleep period is equal to the heartbeat period.
[0015] In one possible implementation manner, the electronic device includes a static state and an idle state, and the first information is determined based on the static state and the idle state of the electronic device.
[0016] In one possible implementation manner, the data transmission record includes an idle time duration of the electronic device, and the sleep cycle is determined based on the idle time duration of each of the electronic devices.
[0017] In one possible implementation, determining the sleep period according to the data transmission record of each electronic device includes:
[0018] comparing the idle time of each of the electronic devices;
[0019] A sleep cycle is determined based on the minimum value or the lowest common divisor of the idle time lengths.
[0020] In one possible implementation manner, before sending the second information to each of the electronic devices, the method further includes:
[0021] Acquire the quantity of the first information and the total number of connections between the communication device and the electronic device;
[0022] The number of the first information is compared with the total number of connections, and based on the comparison result, it is determined whether to execute the sending of the second information to each of the electronic devices.
[0023] In one possible implementation, the second information further includes a sleep request, where the sleep request is used to request each of the second devices to enter a network sleep state.
[0024] In one possible implementation manner, after disconnecting from each of the electronic devices and entering a sleep state based on the sleep cycle, the method further includes:
[0025] After the sleep cycle, a connection request sent by one or more of the electronic devices is received, and a connection is established with the one or more electronic devices based on the connection request.
[0026] In a second aspect, the present application provides a communication method, which is applied to an electronic device, wherein the electronic device establishes a connection with a communication device, and the method includes:
[0027] Sending first information to the communication device, where the first information is used to request to enter a dormant state;
[0028] receiving second information sent by the communication device, wherein the second information includes a sleep period;
[0029] The connection with the communication device is disconnected, and a network sleep state is entered based on the sleep cycle.
[0030] In one possible implementation manner, before sending the first information to the communication device, the method further includes:
[0031] Detecting the idle time of the electronic device;
[0032] The idle time length is compared with a preset time length, and based on the comparison result, it is determined whether to execute the sending of the first information to the communication device.
[0033] In one possible implementation manner, the communication device includes third information, and before sending the first information to the communication device, the method further includes:
[0034] Receiving third information sent by the communication device, wherein the third information includes a heartbeat packet sending time and a heartbeat cycle;
[0035] Determining whether the electronic device is in an idle state within a historical heartbeat cycle;
[0036] If the electronic device is in an idle state, the sending time of the first information is determined based on the sending time of the heartbeat packet.
[0037] In one possible implementation, the sleep period is equal to the heartbeat period.
[0038] In one possible implementation manner, before sending the first information to the communication device, the method further includes:
[0039] Acquiring fourth information, where the fourth information is used to indicate that the electronic device is stationary and has no data transmission;
[0040] Based on the fourth information, it is determined whether to execute the sending of the first information to the communication device.
[0041] In one possible implementation manner, after disconnecting from the communication device and entering a sleep state based on the sleep cycle, the method further includes:
[0042] After the sleep cycle, a connection request is sent to the communication device, where the connection request is used to request to establish a connection with the communication device.
[0043] In a third aspect, the present application provides a communication device, wherein the communication device establishes a connection with one or more electronic devices, wherein the communication device includes a data transmission record of each of the electronic devices, and the device includes:
[0044] A first information receiving module, used for receiving first information sent by one or more electronic devices, wherein the first information is used for requesting to enter a dormant state;
[0045] A sleep cycle determination module, used to determine the sleep cycle according to the data transmission record of each electronic device;
[0046] A second information sending module, configured to send second information to each of the electronic devices, wherein the second information includes the sleep cycle;
[0047] The sleep module is used to disconnect from each of the electronic devices and enter a sleep state based on the sleep cycle.
[0048] In a fourth aspect, the present application provides a terminal, wherein the terminal establishes a connection with a communication device, and the terminal includes:
[0049] A first information sending module, used for sending first information to the communication device, where the first information is used for requesting to enter a dormant state;
[0050] A second information receiving module, configured to receive second information sent by the communication device, wherein the second information includes a sleep cycle;
[0051] The sleep module is used to disconnect from the communication device and enter a network sleep state based on the sleep cycle.
[0052] In a fifth aspect, the present application provides a communication device, the communication device comprising:
[0053] One or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the communication device, cause the communication device to perform the method as described in the first aspect.
[0054] In a sixth aspect, the present application provides an electronic device, the electronic device comprising:
[0055] One or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the electronic device, cause the electronic device to execute the method as described in the second aspect.
[0056] In a seventh aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the method described in the first aspect or the second aspect.
[0057] In an eighth aspect, the present application provides a computer program, which, when executed by a computer, is used to execute the method described in the first aspect or the second aspect.
[0058] In one possible design, the program in the eighth aspect may be stored in whole or in part on a storage medium packaged together with the processor, or may be stored in whole or in part on a memory not packaged together with the processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1A This is an application scenario diagram of Wi-Fi devices;
[0060] Figure 1B A method schematic diagram of a communication method in the prior art;
[0061] Figure 2 A schematic diagram of a method of applying the communication method of the present application to a communication device according to an embodiment;
[0062] Figure 3 A flow chart of an embodiment of the communication method of the present application;
[0063] Figure 4 A schematic diagram of a method of applying the communication method of the present application to an electronic device according to an embodiment;
[0064] Figure 5 This is a schematic diagram of the structure of an embodiment of the communication device of the present application;
[0065] Figure 6This is a schematic diagram of the structure of an embodiment of the terminal of the present application;
[0066] Fig. 7A This is a schematic diagram of the structure of an embodiment of the communication device of the present application;
[0067] Figure 7B A hardware schematic diagram of an embodiment of the communication device of the present application;
[0068] Figure 7C A software schematic diagram of an embodiment of the communication device of the present application;
[0069] Figure 8 This is a schematic diagram of the structure of an embodiment of the electronic device of the present application. DETAILED DESCRIPTION
[0070] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0071] At present, the 802.11 protocol (universal standard protocol for wireless LAN) only defines low-power-consumption related protocols for user terminals, such as PSM (Power Save Mode), but does not have low-power-consumption related protocols for AP devices. Figure 1B As shown, in the existing communication method, during the use of the accompanying AP device, there is a common scenario, that is, the user terminal such as a mobile phone or other electronic device is connected to the accompanying AP device, but the user does not use the terminal, only maintains the Wi-Fi connection, and does not transmit data. At this time, since the accompanying AP device needs to receive data packets that may come from the user terminal at any time, the accompanying AP device needs to maintain a connection with the user terminal at all times and is always in a Wi-Fi working state. It cannot sleep, which results in high power consumption and reduces the product life.
[0072] To this end, the present application proposes a communication method and device, which negotiates with the AP device to disconnect and enter a sleep state when the user terminal (such as an electronic device) has no data to transmit. This is beneficial to reducing power consumption and improving product battery life without affecting user use.
[0073] Figure 2 A method diagram of an embodiment of the communication method of the present application is shown in FIG. Figure 2 As shown, the communication method is applied to a communication device, and the communication device establishes a connection with one or more electronic devices. The above communication method may include:
[0074] S101. Receive first information sent by one or more electronic devices, where the first information is used to request to enter a sleep state.
[0075] In this embodiment, the communication device may include a Wi-Fi device (such as an accompanying AP device, etc.) or other devices that provide Wi-Fi hotspot functions, etc. The electronic device may include a user terminal such as a mobile phone, a watch, a smart bracelet, a computer, etc. The communication device may be connected to one or more electronic devices via Wi-Fi. The communication device may broadcast a beacon frame to the outside, receive a data packet sent from an electronic device, and then send the data packet to the downstream electronic device.
[0076] Preferably, in step S101, each electronic device may determine whether to send the first information to the communication device. For example, when the electronic device is not used by the user, the electronic device may send the first information to the communication device to request to enter a dormant state. In other words, the first information may be used to indicate that the electronic device is not in use or has no data transmission, so as to negotiate a disconnection with the communication device (such as an AP device).
[0077] S102: Determine a sleep cycle according to the data transmission record of each electronic device.
[0078] That is, in step S102, the communication device may include a data transmission record of each electronic device, and the data transmission record may include the idle time of each electronic device, the heartbeat cycle or the heartbeat packet sending time, etc. The idle time may indicate that the electronic device has no data transmission time or is not in use.
[0079] Preferably, the step S102 may include:
[0080] comparing the idle time of each of the electronic devices;
[0081] A sleep cycle is determined based on the minimum value or the lowest common divisor of the idle time lengths.
[0082] That is, without affecting usage, the idle time of each electronic device (such as the shortest idle time) is compared, and then the minimum value or the minimum common value is determined from the idle time of each electronic device to obtain the sleep cycle.
[0083] As another example, the electronic device may include a first device, a second device and a third device, wherein the idle time of the first device is T1, the idle time of the second device is T2, and the idle time of the third device is T3. In step S102, T1, T2 and T3 can be compared to obtain a minimum value or a minimum common value as the sleep cycle.
[0084] It is understandable that the communication device can record the idle time of each electronic device in real time to adjust the size of the sleep cycle in real time.
[0085] S103: Send second information to each of the electronic devices, where the second information includes the sleep cycle.
[0086] In this embodiment, when the communication device receives the first information sent by each electronic device, the communication device sends second information to each electronic device. Preferably, the second information can be used to indicate that each electronic device is disconnected from the communication device or does not perform data transmission during the sleep cycle.
[0087] In one possible implementation, the second information may also include a sleep request, and the sleep request is used to request each of the second devices to enter a network sleep state (such as shutting down the network, putting the network into a sleep state, or putting the second device into a sleep state such as a power saving mode or a sleep mode, etc.), so that each of the second devices is disconnected from the communication device and enters a network sleep state based on the sleep cycle.
[0088] That is to say, when the electronic device receives the second information, the electronic device disconnects from the communication device, stops transmitting data, and enters a network sleep state during the sleep cycle, thereby helping to reduce the power consumption of the electronic device and improve the battery life of the electronic device.
[0089] S104: disconnecting from each of the electronic devices, and entering a sleep state based on the sleep cycle.
[0090] That is to say, after sending the second information, the communication device disconnects from each electronic device (such as turning off the WLAN network or putting the network into a sleep state, etc.), and enters a sleep state (such as a power saving mode or a sleep mode, etc.) during the sleep cycle, thereby helping to reduce the power consumption of the communication device and increase the battery life of the communication device. For example, the power consumption of the entire device can be reduced by 100+mA.
[0091] In this embodiment, the sleep state can be defined as the communication device entering a low power consumption mode, a power saving mode or a sleep mode, etc. For example, in the sleep state, the communication device shuts down some or all applications or services, such as routing services, wireless services or Wi-Fi services, etc., which are not limited here.
[0092] In one possible implementation, after step S104, the method further includes:
[0093] S105: After the sleep cycle, receiving a connection request sent by each of the electronic devices, and establishing a connection with each of the electronic devices based on the connection request.
[0094] Specifically, the communication device turns on the network after the sleep cycle, exits the sleep state, waits to receive a connection request sent by the electronic device, and after receiving the connection request, establishes a connection with the electronic device to achieve data transmission.
[0095] Correspondingly, the electronic device turns on the network after the sleep period, exits the network sleep state, sends a connection request to the communication device, establishes a connection with the communication device, and realizes data transmission.
[0096] In one possible implementation, in step S101, the electronic device may include an idle duration, the idle duration is used to characterize the duration of time when the electronic device has no data transmission, and the first information is determined based on a comparison result between the idle duration and a preset time. Specifically, if the idle duration is greater than the preset time, the electronic device sends the first information to the communication device, otherwise the first information is not sent.
[0097] More specifically, the electronic device can detect the time when there is no data transmission, thereby obtaining the idle time. That is, when the electronic device detects that there is no data transmission within a period of time (i.e., the idle time), it is considered that the electronic device is not being used by the user, and the electronic device sends the first information to the communication device to request to enter a sleep state.
[0098] Optionally, the electronic device determines whether it is in an idle state within a historical heartbeat cycle (the idle state indicates that the electronic device has no data transmission). If the electronic device is in an idle state, the electronic device sends the first information to the communication device at the time when the heartbeat packet is sent. Specifically, the electronic device generally sends a heartbeat packet to the communication device periodically (i.e., a heartbeat cycle). If there is no data transmission within a heartbeat cycle, it is considered that the electronic device is not used by the user. The electronic device sends the first information to the communication device at the next heartbeat packet sending time to request to enter a dormant state.
[0099] Furthermore, the data transmission record may include the heartbeat packet sending time and heartbeat cycle of the electronic device. Before step S101, the method further includes:
[0100] S201, determining third information based on the heartbeat packet sending time and heartbeat cycle of each electronic device, wherein the third information is used to request to unify the heartbeat packet sending time and heartbeat cycle of each electronic device;
[0101] S202: Send the third information to each of the electronic devices.
[0102] Further, the communication device may record the heartbeat packet sending time and heartbeat cycle of each electronic device, and unify the heartbeat packet sending time and heartbeat cycle of each electronic device. The third information may include the unified heartbeat packet sending time and the unified heartbeat cycle, and the third information may be used to request to unify the heartbeat packet sending time and heartbeat cycle of each electronic device, so that each electronic device sends a heartbeat packet to the communication device at the same time (i.e., the unified heartbeat packet sending time) and the same heartbeat cycle (i.e., the unified heartbeat cycle).
[0103] In step S102, the sleep cycle is equal to the heartbeat cycle of the electronic device. That is, when the heartbeat packet sending time and the heartbeat cycle of all electronic devices are unified, the communication device can determine that the sleep cycle is equal to the heartbeat cycle, which is conducive to extending the sleep time without affecting user use, further reducing power consumption, and improving product life.
[0104] In one possible implementation, the electronic device may include fourth information, the fourth information is used to indicate that the electronic device is stationary and has no data transmission, and the first information is determined based on the fourth information. Furthermore, the fourth information may include a stationary state and an idle state of the electronic device, and the first information is determined based on the stationary state and the idle state of the electronic device. The stationary state is used to indicate whether the electronic device is stationary, and the idle state is used to indicate whether the electronic device has no data transmission, and when the electronic device is stationary and has no data transmission, the electronic device sends the first information to the communication device.
[0105] Furthermore, the electronic device may include a sensor for detecting whether the electronic device is stationary to obtain a stationary state. The sensor may include an acceleration sensor and a gravity sensor, etc., which can detect the acceleration and gravity of the electronic device. For example, when a user uses the electronic device to play games, etc., the acceleration or gravity of the electronic device may change. If the acceleration and gravity of the electronic device do not exceed a preset range or preset value, it can be determined that the electronic device is stationary.
[0106] Furthermore, when the electronic device is in a stationary state, the electronic device further detects whether there is no data transmission at the current moment. If there is no data transmission, the electronic device sends the first information to the communication device to request to enter a sleep state.
[0107] In one possible implementation, before step S103, the method further includes:
[0108] S301, obtaining the quantity of the first information and the total number of connections between the communication device and the electronic device;
[0109] S302: Compare the quantity of the first information with the total number of connections, and determine whether to execute the sending of the second information to each of the electronic devices based on the comparison result.
[0110] like Figure 3 As shown, the communication device establishes connections with the first device and the second device respectively, and the total number of connections is 2. When the communication device receives the first information sent by the first device and the second device (that is, the number of first information is 2), the communication device sends the second information to the first device and the second device respectively, the communication device turns off the network, and enters the sleep state during the sleep cycle. The first device and the second device both turn off the network and enter the network sleep state during the sleep cycle.
[0111] Specifically, when the communication device receives the first information sent by all electronic devices within a preset time period (for example, the time period between when the communication device receives the first information sent by the first electronic device and the first information sent by the last electronic device is less than the preset time period), the communication device sends second information to each electronic device.
[0112] After the communication device sends the second information to the electronic device, the communication device turns off the network (WLAN), disconnects from each electronic device, and then enters the sleep state during the sleep cycle. Correspondingly, after receiving the second information, each electronic device turns off the network, disconnects from the communication device, and then also enters the network sleep state during the sleep cycle.
[0113] After the dormant period, the communication device turns on the network, exits the dormant state, and waits to receive a connection request sent by each electronic device. The electronic device turns on the network, exits the network dormant state, and sends a connection request to the communication device. When the communication device receives the connection request sent by the electronic device, the communication device establishes a connection with the electronic device to achieve data transmission.
[0114] Then, the communication device may determine again whether the first information sent by all electronic devices is received. If the first information sent by all electronic devices is received, the communication device enters the sleep state of the next sleep cycle.
[0115] It is to be understood that some or all of the steps or operations in the above embodiments are merely examples, and the present application embodiments may also perform other operations or variations of various operations. In addition, the various steps may be performed in different orders presented in the above embodiments, and it is possible that not all of the operations in the above embodiments need to be performed.
[0116] like Figure 4 As shown, the present application also provides a communication method, which is applied to an electronic device, wherein the electronic device establishes a connection with a communication device, and the method may include:
[0117] S401. Send first information to the communication device, where the first information is used to request to enter a dormant state.
[0118] S402: Receive second information sent by the communication device, where the second information includes a sleep cycle.
[0119] S403: Disconnecting from the communication device and entering a network dormant state based on the dormant cycle.
[0120] In this embodiment, step S401 in the communication method applied to the electronic device corresponds to step S101 in the communication method applied to the communication device described above. The specific functions or principles can refer to step S101, which will not be described in detail here. Step S402 in the communication method applied to the electronic device corresponds to step S103 in the communication method applied to the communication device described above. The specific functions or principles can refer to step S103, which will not be described in detail here. Step S403 in the communication method applied to the electronic device corresponds to step S104 in the communication method applied to the communication device described above. The specific functions or principles can refer to step S104, which will not be described in detail here.
[0121] In one possible implementation, after step S403, the method further includes:
[0122] S404: After the sleep period, send a connection request to the communication device to establish a connection with the communication device.
[0123] Step S404 in the communication method applied to the electronic device corresponds to step S105 in the above-mentioned communication method applied to the communication device. The specific functions or principles may refer to the above-mentioned step S105, which will not be described in detail here.
[0124] In one possible implementation, before step S401, the method further includes:
[0125] S501, detecting the idle time of the electronic device;
[0126] S502: Compare the idle time with a preset time, and determine whether to execute the sending of the first information to the communication device based on the comparison result.
[0127] Specifically, the electronic device can detect the duration of no data transmission to obtain the idle duration. That is, when the electronic device has no data transmission for a period of time (i.e., the idle duration), it is considered that the electronic device is not used by the user, and the electronic device sends the first information to the communication device to request to enter a sleep state.
[0128] In one possible implementation manner, the communication device includes third information, and before step S401, the method further includes:
[0129] S601, receiving third information sent by the communication device, wherein the third information includes a heartbeat packet sending time and a heartbeat cycle;
[0130] S602, determining whether the electronic device is in an idle state within a historical heartbeat cycle;
[0131] S603: If the electronic device is in an idle state, determine a sending time of the first information based on a sending time of the heartbeat packet.
[0132] In step S602, the original heartbeat packet sending time and heartbeat cycle of the electronic device can be changed to the heartbeat packet sending time and heartbeat cycle in the third information, so that the heartbeat cycles of multiple electronic devices are unified.
[0133] Specifically, the electronic device determines whether it is in an idle state within a historical heartbeat cycle (the idle state indicates that the electronic device has no data transmission). If the electronic device is in an idle state, the electronic device sends the first information to the communication device at the time when the heartbeat packet is sent.
[0134] In one possible implementation, the sleep period is equal to the heartbeat period.
[0135] In one possible implementation, before step S401, the method further includes:
[0136] S701, acquiring fourth information, where the fourth information is used to indicate that the electronic device is stationary and has no data transmission;
[0137] S702: Determine whether to execute the sending of the first information to the communication device based on the fourth information.
[0138] Furthermore, the fourth information may include a stationary state and an idle state of the electronic device, and the first information is determined based on the stationary state and the idle state of the electronic device. The stationary state is used to indicate whether the electronic device is stationary, and the idle state is used to indicate whether the electronic device has no data transmission. When the electronic device is stationary and has no data transmission, the electronic device sends the first information to the communication device.
[0139] Furthermore, the electronic device may include a sensor for detecting whether the electronic device is stationary. The sensor may include an acceleration sensor and a gravity sensor, etc., which can detect the acceleration and gravity of the electronic device. For example, when a user uses the electronic device to play games, etc., the acceleration or gravity of the electronic device may change. If the acceleration and gravity of the electronic device do not exceed a preset range or preset value, it can be determined that the electronic device is stationary.
[0140] Furthermore, when the electronic device is in a stationary state, the electronic device further detects whether there is no data transmission at the current moment. If there is no data transmission, the electronic device sends the first information to the communication device to request to enter a sleep state.
[0141] It is to be understood that some or all of the steps or operations in the above embodiments are merely examples, and the present application embodiments may also perform other operations or variations of various operations. In addition, the various steps may be performed in different orders presented in the above embodiments, and it is possible that not all of the operations in the above embodiments need to be performed.
[0142] like Figure 5 As shown, the present application provides a communication device 100, the communication device 100 establishes a connection with one or more electronic devices, the communication device 100 includes a data transmission record of each of the electronic devices, and the device 100 includes:
[0143] A first information receiving module 101 is used to receive first information sent by one or more electronic devices, where the first information is used to request to enter a dormant state;
[0144] A sleep cycle determination module 102, configured to determine a sleep cycle according to the data transmission record of each electronic device;
[0145] A second information sending module 103, configured to send second information to each of the electronic devices, wherein the second information includes the sleep cycle;
[0146] The sleep module 104 is used to disconnect from each of the electronic devices and enter a sleep state based on the sleep cycle.
[0147] In one possible implementation manner, the electronic device includes an idle time length, and the first information is determined based on a comparison result between the idle time length and a preset time length.
[0148] In one possible implementation, the data transmission record includes the heartbeat packet sending time and the heartbeat cycle of the electronic device, and the device 100 further includes:
[0149] Based on the heartbeat packet sending time and the heartbeat cycle of each electronic device, determine third information, wherein the third information is used to request to unify the heartbeat packet sending time and the heartbeat cycle of each electronic device;
[0150] The third information is sent to each of the electronic devices.
[0151] In one possible implementation, the sleep period is equal to the heartbeat period.
[0152] In one possible implementation manner, the electronic device includes a static state and an idle state, and the first information is determined based on the static state and the idle state of the electronic device.
[0153] In one possible implementation manner, the data transmission record includes an idle time duration of the electronic device, and the sleep cycle is determined based on the idle time duration of each of the electronic devices.
[0154] In one possible implementation, the sleep cycle determination module 102 includes:
[0155] comparing the idle time of each of the electronic devices;
[0156] A sleep cycle is determined based on the minimum value or the lowest common divisor of the idle time lengths.
[0157] In one possible implementation, the device further includes:
[0158] Acquire the quantity of the first information and the total number of connections between the communication device and the electronic device;
[0159] The number of the first information is compared with the total number of connections, and based on the comparison result, it is determined whether to execute the sending of the second information to each of the electronic devices.
[0160] In one possible implementation, the second information further includes a sleep request, where the sleep request is used to request each of the second devices to enter a network sleep state.
[0161] In one possible implementation, the device further includes:
[0162] After the sleep cycle, a connection request sent by one or more of the electronic devices is received, and a connection is established with the one or more electronic devices based on the connection request.
[0163] like Figure 6 As shown, the present application provides a terminal 200, the terminal 200 establishes a connection with a communication device, and the terminal 200 includes:
[0164] A first information sending module 201 is used to send first information to the communication device, where the first information is used to request to enter a dormant state;
[0165] A second information receiving module 202, configured to receive second information sent by the communication device, wherein the second information includes a sleep cycle;
[0166] The sleep module 203 is used to disconnect from the communication device and enter the network sleep state based on the sleep cycle.
[0167] In one possible implementation, the terminal 200 further includes:
[0168] A detection module 204 is used to detect the idle time of the electronic device without data transmission;
[0169] The judgment module 205 is used to compare the idle time with a preset time, and determine whether to execute the sending of the first information to the communication device based on the comparison result.
[0170] In one possible implementation manner, the communication device includes third information, and the apparatus 200 further includes:
[0171] Receiving third information sent by the communication device, wherein the third information includes a heartbeat packet sending time and a heartbeat cycle;
[0172] Determining whether the electronic device is in an idle state within a historical heartbeat cycle;
[0173] If the electronic device is in an idle state, the sending time of the first information is determined based on the sending time of the heartbeat packet.
[0174] In one possible implementation, the sleep period is equal to the heartbeat period.
[0175] In one possible implementation, the device further includes:
[0176] Acquiring fourth information, where the fourth information is used to indicate that the electronic device is stationary and has no data transmission;
[0177] Based on the fourth information, it is determined whether to execute the sending of the first information to the communication device.
[0178] In one possible implementation, the device further includes:
[0179] After the sleep cycle, a connection request is sent to the communication device, where the connection request is used to request to establish a connection with the communication device.
[0180] Figure 5The communication device 100 provided in the illustrated embodiment can be used to implement the present application Figure 2 The technical solution of the method embodiment shown, its implementation principle and technical effects can be further referred to the relevant description in the method embodiment. Figure 6 The terminal 200 provided in the illustrated embodiment can be used to execute the present application Figure 4 The technical solution of the method embodiment shown, its implementation principle and technical effects can be further referred to the relevant description in the method embodiment.
[0181] It should be understood that the above Figure 5 The communication device shown or Figure 6 The division of the modules in the terminal 200 shown is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the detection module can be a separately established processing element, or it can be integrated in a chip of an electronic device. The implementation of other modules is similar. In addition, all or part of these modules can be integrated together, or they can be implemented independently. In the implementation process, each step of the above method or the above modules can be completed by the hardware integrated logic circuit in the processor element or the instructions in the form of software.
[0182] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital singnal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0183] Fig. 7A This is a schematic diagram of the structure of an embodiment of the communication device 800 of the present application, as shown in FIG. Fig. 7A As shown, the communication device 800 establishes a connection with one or more electronic devices, and the communication device 800 includes a data transmission record of each of the electronic devices. The communication device 800 may include:
[0184] one or more processors; memory; and one or more computer programs;
[0185] The one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the device, the device performs the following steps:
[0186] receiving first information sent by one or more electronic devices, wherein the first information is used to request to enter a dormant state;
[0187] Determining a sleep cycle according to the data transmission record of each of the electronic devices;
[0188] Sending second information to each of the electronic devices, wherein the second information includes the sleep cycle;
[0189] The connection with each of the electronic devices is disconnected, and a sleep state is entered based on the sleep cycle.
[0190] In one possible implementation manner, the electronic device includes an idle time length, and the first information is determined based on a comparison result between the idle time length and a preset time length.
[0191] In one possible implementation, the data transmission record includes the heartbeat packet sending time and heartbeat cycle of the electronic device. When the above instruction is executed by the above device, the above device further executes:
[0192] Based on the heartbeat packet sending time and the heartbeat cycle of each electronic device, determine third information, wherein the third information is used to request to unify the heartbeat packet sending time and the heartbeat cycle of each electronic device;
[0193] The third information is sent to each of the electronic devices.
[0194] In one possible implementation, the sleep period is equal to the heartbeat period.
[0195] In one possible implementation manner, the electronic device includes a static state and an idle state, and the first information is determined based on the static state and the idle state of the electronic device.
[0196] In one possible implementation manner, the data transmission record includes an idle time duration of the electronic device, and the sleep cycle is determined based on the idle time duration of each of the electronic devices.
[0197] In one possible implementation, when the instruction is executed by the device, the device determines the sleep period according to the data transmission record of each electronic device, including:
[0198] comparing the idle time of each of the electronic devices;
[0199] A sleep cycle is determined based on the minimum value or the lowest common divisor of the idle time lengths.
[0200] In one possible implementation manner, when the above instruction is executed by the above device, the above device further executes:
[0201] Acquire the quantity of the first information and the total number of connections between the communication device and the electronic device;
[0202] The number of the first information is compared with the total number of connections, and based on the comparison result, it is determined whether to execute the sending of the second information to each of the electronic devices.
[0203] In one possible implementation, the second information further includes a sleep request, where the sleep request is used to request each of the second devices to enter a network sleep state.
[0204] In one possible implementation manner, when the above instruction is executed by the above device, the above device further executes:
[0205] After the sleep cycle, a connection request sent by one or more of the electronic devices is received, and a connection is established with the one or more electronic devices based on the connection request.
[0206] Fig. 7A The communication device 800 shown may be a circuit device built into the above electronic device. The device may be used to execute the present application Figure 2 The illustrated embodiments provide functions / steps in the method.
[0207] like Fig. 7A As shown, the communication device 800 includes a processor 810 and a memory 820. The processor 810 and the memory 820 can communicate with each other through an internal connection path to transmit control and / or data signals. The memory 820 is used to store computer programs, and the processor 810 is used to call and run the computer program from the memory 820.
[0208] It should be understood that Fig. 7A The communication device 800 shown can implement the present application Figure 2 The various processes of the method provided in the illustrated embodiment. The operations and / or functions of the various modules in the communication device 800 are respectively to implement the corresponding processes in the above method embodiments. For details, please refer to the present application Figure 2 To avoid repetition, the detailed description of the method embodiment is appropriately omitted here.
[0209] like Figure 7BThe hardware schematic diagram of the communication device 900 is shown. The processor 910 may include an application processor and a baseband communication processor. The application processor has functions such as processing instructions, executing operations, controlling time or processing data. The application program may include an integrated circuit that expands video functions and dedicated interfaces based on a low-power CPU. The application processor can cooperate with analog and hybrid ICs to form a system. For example, the application processor can integrate a video codec, an audio ADC / DAC, a power amplifier, an Ethernet interface, an HDMI interface, a Bluetooth module, a Wi-Fi module, a GPS module, an FM module, power management, etc. Furthermore, the application processor can be externally connected to DDR (dynamic random access memory) and FLASH (two-dimensional animation software). The baseband communication processor may have two functions, one is to run the control code of the physical layer of the communication protocol; the other is to control the upper layer software of the communication protocol, including the presentation layer or the man-machine interface (MMI), etc.
[0210] Furthermore, the communication device 900 may include buttons connected to the application processor, USB, LED, Wi-Fi chip, network port, FLASH, DDR, LCD, power management unit, battery connected to the power management unit, charging and discharging IC, etc., as well as RFIC, PA, LAN, SIM card and antenna connected to the baseband communication processor. The battery can provide the power required for the operation of the communication device 900.
[0211] like Figure 7C The software schematic diagram of the communication device 900 is shown. The communication device 900 may include a user interface layer, a configuration management layer, a service management layer and a driver layer, wherein the user interface layer may include WEBUI, APP, etc., the configuration management layer may include a parameter model, a message mechanism and a database, etc., the service management module may include a routing service, a Wi-Fi service and a low-power service, etc., and the driver layer may include a Wi-Fi driver, a USB driver and an LCD driver, etc.
[0212] Low power consumption services can execute this application Figure 2 The communication method provided in the illustrated embodiment, the low-power service may include state machine management, user management and decision control, etc., wherein the state machine management can be used to count the current state of each electronic device, such as counting the first information sent by the electronic device, etc., user management can be used for Wi-Fi access device information statistics and state management, etc., decision control can be used to control the communication device or all electronic devices to enter a sleep state, etc.
[0213] That is to say, user management can record the data transmission records of electronic devices currently connected to Wi-Fi or the number of electronic devices, and the state machine management can be used to receive the first information sent by each electronic device and count the number of first information received. The decision control can control whether the communication device or all electronic devices enter the sleep state according to the number of electronic devices and the number of first information. The specific steps or principles can refer to the present application. Figure 2 The communication method of the illustrated embodiment will not be described in detail here.
[0214] Figure 8 This is a schematic diagram of the structure of an embodiment of the electronic device of the present application. Figure 8 As shown, the electronic device establishes a connection with the communication device, and the electronic device may include: a display screen; one or more processors; a memory; multiple applications; and one or more computer programs.
[0215] Among them, the above-mentioned display screen may include a display screen of a vehicle-mounted computer (Mobile Data Center); the above-mentioned electronic device may be a mobile terminal (mobile phone), a smart screen, a drone, an intelligent connected vehicle (Intelligent Connected Vehicle; hereinafter referred to as: ICV), a smart / intelligent car or vehicle-mounted equipment and other devices.
[0216] The one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the device, the device performs the following steps:
[0217] Sending first information to the communication device, where the first information is used to request to enter a dormant state;
[0218] receiving second information sent by the communication device, wherein the second information includes a sleep period;
[0219] The connection with the communication device is disconnected, and a network sleep state is entered based on the sleep cycle.
[0220] In one possible implementation manner, when the above instruction is executed by the above device, the above device further executes:
[0221] Detecting the idle time of the electronic device without data transmission;
[0222] The idle time is compared with a preset time, and based on the comparison result, it is determined whether to execute the sending of the first information to the communication device.
[0223] In one possible implementation manner, the communication device includes third information, and when the instruction is executed by the device, the device executes:
[0224] Receiving third information sent by the communication device, wherein the third information includes a heartbeat packet sending time and a heartbeat cycle;
[0225] Determining whether the electronic device is in an idle state within a historical heartbeat cycle;
[0226] If the electronic device is in an idle state, the sending time of the first information is determined based on the sending time of the heartbeat packet.
[0227] In one possible implementation, the sleep period is equal to the heartbeat period.
[0228] In one possible implementation, when the above instruction is executed by the above device, the above device executes:
[0229] Acquiring fourth information, where the fourth information is used to indicate that the electronic device is stationary and has no data transmission;
[0230] Based on the fourth information, it is determined whether to execute the sending of the first information to the communication device.
[0231] In one possible implementation, when the above instruction is executed by the above device, the above device executes:
[0232] After the sleep cycle, a connection request is sent to the communication device, where the connection request is used to request to establish a connection with the communication device.
[0233] Figure 8 The electronic device shown can be a terminal device or a circuit device built into the terminal device. The device can be used to execute the present application Figure 4 The illustrated embodiments provide functions / steps in the method.
[0234] like Figure 8 As shown, the electronic device 900 includes a processor 910 and a transceiver 920. Optionally, the electronic device 900 may also include a memory 930. The processor 910, the transceiver 920 and the memory 930 may communicate with each other through an internal connection path to transmit control and / or data signals, and the memory 930 is used to store a computer program, and the processor 910 is used to call and run the computer program from the memory 930.
[0235] The above-mentioned memory 930 can be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or it can be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage medium or other magnetic storage device, or it can also be any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer.
[0236] Optionally, the electronic device 900 may further include an antenna 940 for transmitting the wireless signal output by the transceiver 920 .
[0237] The processor 910 and the memory 930 may be combined into a processing device, or more commonly, they are independent components, and the processor 910 is used to execute the program code stored in the memory 930 to implement the above functions. In specific implementation, the memory 930 may also be integrated into the processor 910, or may be independent of the processor 910.
[0238] In addition, in order to make the functions of the electronic device 900 more complete, the electronic device 900 may further include one or more of an input unit 960, a display unit 970, an audio circuit 980, a camera 990, and a sensor 901, and the audio circuit may further include a speaker 982, a microphone 984, etc. The display unit 970 may include a display screen.
[0239] Optionally, the electronic device 900 may further include a power supply 950 for providing power to various devices or circuits in the terminal device.
[0240] It should be understood that Figure 8 The electronic device 900 shown can implement the present application Figure 4 The various processes of the method provided in the illustrated embodiment. The operations and / or functions of the various modules in the electronic device 900 are respectively to implement the corresponding processes in the above method embodiments. For details, please refer to the present application Figure 4 To avoid repetition, the detailed description of the method embodiment is appropriately omitted here.
[0241] It should be understood that Figure 8The processor 910 in the electronic device 900 shown may be a system on chip SOC, which may include a central processing unit (CPU) and may further include other types of processors, such as a graphics processing unit (GPU).
[0242] In summary, the various processors or processing units within the processor 910 can work together to implement the previous method flow, and the corresponding software programs of the various processors or processing units can be stored in the memory 930.
[0243] The present application also provides an electronic device, the device comprising a storage medium and a central processing unit, the storage medium may be a non-volatile storage medium, the storage medium stores a computer executable program, the central processing unit is connected to the non-volatile storage medium, and executes the computer executable program to implement the present application Figure 2 or Figure 4 The method provided by the illustrated embodiment.
[0244] In the above embodiments, the processor involved may include, for example, a CPU, a DSP, a microcontroller or a digital signal processor, and may also include a GPU, an embedded neural network processor (Neural-network Process Units; hereinafter referred to as: NPU) and an image signal processor (Image Signal Processing; hereinafter referred to as: ISP). The processor may also include necessary hardware accelerators or logic processing hardware circuits, such as ASIC, or one or more integrated circuits for controlling the execution of the program of the technical solution of the present application. In addition, the processor may have the function of operating one or more software programs, and the software programs may be stored in a storage medium.
[0245] The present application also provides a computer-readable storage medium in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the present application. Figure 2 or Figure 4 The method provided by the illustrated embodiment.
[0246] The present application also provides a computer program product, which includes a computer program, which, when executed on a computer, enables the computer to execute the present application. Figure 2 or Figure 4 The method provided by the illustrated embodiment.
[0247] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0248] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0249] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0250] In several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), disk or optical disk, and other media that can store program codes.
[0251] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A communication method, applied to a communication device, wherein the communication device establishes a connection with one or more electronic devices, and the communication device includes a data transmission record of each of the electronic devices, characterized in that: The method comprises: receiving first information sent by one or more electronic devices, wherein the first information is used to request to enter a dormant state; Determining a sleep cycle according to the data transmission record of each electronic device; Sending second information to each of the electronic devices, wherein the second information includes the sleep cycle; The connection with each of the electronic devices is disconnected, and a sleep state is entered based on the sleep cycle.
2. The method according to claim 1, characterized in that The electronic device includes an idle duration, and the first information is determined based on a comparison result of the idle duration and a preset duration.
3. The method according to claim 1, characterized in that The data transmission record includes the heartbeat packet sending time and heartbeat cycle of the electronic device. Before receiving the first information sent by one or more electronic devices, the method further includes: Based on the heartbeat packet sending time and the heartbeat cycle of each electronic device, determine third information, wherein the third information is used to request to unify the heartbeat packet sending time and the heartbeat cycle of each electronic device; The third information is sent to each of the electronic devices.
4. The method according to claim 3, characterized in that The sleep cycle is equal to the heartbeat cycle.
5. The method according to claim 1, characterized in that: The electronic device includes a stationary state and an idle state, and the first information is determined based on the stationary state and the idle state of the electronic device.
6. The method according to claim 1, characterized in that The data transmission record includes the idle time length of the electronic devices, and the sleep cycle is determined based on the idle time length of each of the electronic devices.
7. The method according to claim 6, characterized in that Determining the sleep cycle according to the data transmission record of each electronic device includes: comparing the idle time of each of the electronic devices; A sleep cycle is determined based on the minimum value or the lowest common divisor of the idle time lengths.
8. The method according to claim 1, characterized in that Before sending the second information to each of the electronic devices, the method further includes: Acquire the quantity of the first information and the total number of connections between the communication device and the electronic device; The number of the first information is compared with the total number of connections, and based on the comparison result, it is determined whether to execute the sending of the second information to each of the electronic devices.
9. The method according to claim 1, characterized in that: The second information further includes a sleep request, where the sleep request is used to request each of the second devices to enter a network sleep state.
10. The method according to any one of claims 1 to 9, characterized in that: After disconnecting from each of the electronic devices and entering a sleep state based on the sleep cycle, the method further includes: After the sleep cycle, a connection request sent by one or more of the electronic devices is received, and a connection is established with the one or more electronic devices based on the connection request.
11. A communication method, applied to an electronic device, wherein the electronic device establishes a connection with a communication device, characterized in that: The method comprises: Sending first information to the communication device, where the first information is used to request to enter a dormant state; receiving second information sent by the communication device, wherein the second information includes a sleep period; The connection with the communication device is disconnected, and a network sleep state is entered based on the sleep cycle.
12. The method according to claim 11, characterized in that Before sending the first information to the communication device, the method further includes: Detecting the idle time of the electronic device; The idle time length is compared with a preset time length, and based on the comparison result, it is determined whether to execute the sending of the first information to the communication device.
13. The method according to claim 11, characterized in that The communication device includes third information, and before sending the first information to the communication device, the method further includes: Receiving third information sent by the communication device, wherein the third information includes a heartbeat packet sending time and a heartbeat cycle; Determining whether the electronic device is in an idle state within a historical heartbeat cycle; If the electronic device is in an idle state, the sending time of the first information is determined based on the sending time of the heartbeat packet.
14. The method according to claim 13, characterized in that The sleep cycle is equal to the heartbeat cycle.
15. The method according to claim 11, characterized in that Before sending the first information to the communication device, the method further includes: Acquiring fourth information, where the fourth information is used to indicate that the electronic device is stationary and has no data transmission; Based on the fourth information, it is determined whether to execute the sending of the first information to the communication device.
16. The method according to any one of claims 11 to 15, characterized in that After disconnecting from the communication device and entering a sleep state based on the sleep cycle, the method further includes: After the sleep cycle, a connection request is sent to the communication device, where the connection request is used to request to establish a connection with the communication device.
17. A communication device, wherein the communication device is connected to one or more electronic devices, and the communication device includes a data transmission record of each of the electronic devices, characterized in that: The communication device comprises: One or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the communication device, cause the communication device to perform the method according to any one of claims 1 to 10.
18. An electronic device, wherein the electronic device is connected to a communication device, characterized in that: The electronic device comprises: One or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the electronic device, cause the electronic device to perform a method as described in any one of claims 11 to 16.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 16.
