Earphone box control method and computer readable storage medium

By dynamically adjusting the communication cycle time according to the status of the headphone box, the problem of high power consumption and short battery life in the anti-loss function of TWS headphone box is solved, achieving longer battery life and higher safety.

CN119729424APending Publication Date: 2025-03-28GEER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311264760.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When the existing TWS headset box realizes anti-loss function, it needs to maintain high power consumption, resulting in a shorter battery life.

Method used

By obtaining the current state of the headphone box (moving state or stationary state), dynamically adjusting the communication cycle time with the terminal device to reduce the power consumption of the headphone box.

Benefits of technology

It effectively reduces the power consumption required for the headphone box to maintain the anti-loss function, extends the battery life of the headphone box, and improves the safety of the headphone box.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729424A_ABST
    Figure CN119729424A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of earphones, in particular to an earphone box control method and a computer readable storage medium, and the method comprises the steps: obtaining a current earphone box state of an earphone box at a current detection moment; the communication cycle duration of the earphone box is determined based on the current earphone box state, and the communication cycle duration when the current earphone box state is in a running state is smaller than or equal to the communication cycle duration when the current earphone box state is in a static state; and controlling the earphone box to communicate with terminal equipment according to the communication period duration. According to the invention, the power consumption required for maintaining the anti-lost function of the earphone box is reduced, so that the endurance time of the earphone box is prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of earphone technology, and in particular to an earphone box control method and a computer-readable storage medium. Background Art

[0002] With the development of entertainment needs, headphone devices have gradually become an indispensable part of people's lives. Among them, TWS (True Wireless Stereo, true wireless stereo Bluetooth headset) headphones are loved and widely used by people because of their portability and convenience. TWS headphones are usually equipped with a headphone box for storing and charging the headphones. At present, by setting a communication chip on the headphone box, the headphone box can realize the anti-lost function of the headphone box based on the communication chip and the terminal device in a timed communication manner. However, this method requires the headphone box to maintain a higher power consumption, which reduces the battery life of the headphone box. Summary of the invention

[0003] The main purpose of the present invention is to provide an earphone box control method and a computer-readable storage medium, aiming to reduce the power consumption required for the earphone box to maintain an anti-lost function, thereby extending the battery life of the earphone box.

[0004] To achieve the above object, the present invention provides an earphone box control method, the earphone box control method comprising the following steps:

[0005] Get the current status of the earphone box at the current detection moment;

[0006] Determining a communication cycle duration of the earphone box based on the current earphone box state, wherein the communication cycle duration when the current earphone box state is a moving state is less than or equal to the communication cycle duration when the current earphone box state is a stationary state;

[0007] The earphone box is controlled to communicate with the terminal device according to the communication cycle duration.

[0008] Optionally, the earphone box control method further includes:

[0009] Acquire the current communication mode of the earphone box at the current detection moment;

[0010] The step of determining the communication cycle duration of the earphone box based on the current earphone box state comprises:

[0011] Based on the current communication mode and the current earphone box state, the communication cycle duration of the earphone box is determined, wherein, under the same earphone box state, the communication cycle duration when the current communication mode is the connection communication mode is smaller than the communication cycle duration when the current communication mode is the broadcast communication mode.

[0012] Optionally, when the current communication mode is the broadcast communication mode, the step of determining the communication cycle duration of the earphone box based on the current communication mode and the current earphone box state includes:

[0013] Acquire the historical communication mode and historical headphone box status of the headphone box at the previous detection moment;

[0014] In a case where the historical communication mode is the broadcast communication mode, detecting whether the current earphone box state is the same as the historical earphone box state;

[0015] If the current earphone box state is the same as the historical earphone box state, the first cycle duration is used as the communication cycle duration when the current earphone box state is the moving state, and the second cycle duration is used as the communication cycle duration when the current earphone box state is the stationary state, wherein the first cycle duration is less than the second cycle duration;

[0016] If the current earphone box state is different from the historical earphone box state, the third cycle length is used as: the communication cycle length when the current earphone box state is the moving state, and the communication cycle length when the current earphone box state is the static state, wherein the third cycle length is less than or equal to the first cycle length.

[0017] Optionally, the step of obtaining a current communication mode of the earphone box at the current detection moment includes:

[0018] If the communication link between the earphone box and the connection terminal is in a normal communication state at the current detection moment, determining that the current communication mode is the connection communication mode, wherein the connection terminal is a terminal device that establishes a connection with the earphone box;

[0019] If the communication link is in an abnormal communication state, it is determined that the current communication mode is the broadcast communication mode.

[0020] Optionally, if the communication link is in an abnormal communication state, the step of determining that the current communication mode is the broadcast communication mode includes:

[0021] If the communication link is in a communication abnormality state, detecting whether the duration of the communication abnormality state is greater than a preset duration;

[0022] If the duration is greater than the preset duration, it is determined that the current communication mode is the broadcast communication mode.

[0023] Optionally, after the step of detecting whether the duration of the abnormal communication state is greater than a preset duration, the method further includes:

[0024] If the duration is less than or equal to the preset duration, the current communication mode is determined to be the connection communication mode.

[0025] Optionally, after the step of obtaining the current communication mode of the earphone box at the current detection moment, the method further includes:

[0026] If the current state of the earphone box is the moving state, and the current communication mode is the connecting communication mode, detecting whether the earphone box is in a ready-to-use state;

[0027] If the earphone box is in the standby state, the earphone device in the earphone box is awakened, so that the earphone device is connected to a pairing terminal after the earphone box is opened, wherein the pairing terminal is a terminal device paired with the earphone box.

[0028] Optionally, an acceleration sensor is provided on the earphone box, and the step of obtaining the current earphone box state of the earphone box at the current detection moment includes:

[0029] Acquire sensor data collected by the acceleration sensor in a current data collection period corresponding to a current detection moment, and determine a basic earphone box state corresponding to the current data collection period based on the sensor data;

[0030] The current earphone box state of the earphone box is determined based on the basic earphone box state.

[0031] Optionally, the step of determining the current earphone box state of the earphone box based on the basic earphone box state includes:

[0032] Acquire the periodic earphone box status corresponding to each of the preset number of data collection periods that are consecutive to the current data collection period;

[0033] If the basic earphone box state and each of the periodic earphone box states are the same, the basic earphone box state is used as the current earphone box state;

[0034] If the basic earphone box state and each of the periodic earphone box states are not the same, the historical earphone box state of the earphone box at the previous detection moment is used as the current earphone box state.

[0035] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer-readable storage medium, on which a headphone box control program is stored, and when the headphone box control program is executed by a processor, the steps of the headphone box control method as described above are implemented.

[0036] In the present invention, the current state of the earphone box at the current detection moment is obtained; the communication cycle duration of the earphone box is determined based on the current state of the earphone box, wherein the communication cycle duration when the current state of the earphone box is in motion is less than or equal to the communication cycle duration when the current state of the earphone box is in a stationary state; and the earphone box is controlled to communicate with the terminal device according to the communication cycle duration.

[0037] If the current state of the earphone box is in motion, it is determined that the risk of losing the earphone box is high, and a shorter communication cycle duration is set at this time; if the current state of the earphone box is in a stationary state, it is determined that the earphone box is stationary, and the risk of losing the earphone box is low at this time, and a longer communication cycle duration is set. Compared with setting a fixed communication cycle duration for the earphone box, the present invention can reduce the communication frequency between the earphone box and the terminal device, thereby reducing the power consumption required for the earphone device to maintain the anti-loss function, thereby increasing the battery life of the earphone box. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A schematic diagram of the structure of the hardware operating environment involved in the embodiment of the present invention;

[0039] Figure 2 This is a flow chart of a first embodiment of a method for controlling an earphone box according to the present invention;

[0040] Figure 3 It is a flowchart of a second embodiment of the earphone box control method of the present invention;

[0041] Figure 4 It is a flowchart of a third embodiment of the earphone box control method of the present invention;

[0042] Figure 5 It is a flowchart of a fourth embodiment of the earphone box control method of the present invention;

[0043] Figure 6 Schematic diagram of functional modules of a preferred embodiment of the earphone box control device of the present invention.

[0044] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0045] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0046] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.

[0047] It should be noted that the earphone box in the embodiment of the present invention can be a charging box for TWS earphones, or a device that establishes a communication connection with the robot, such as a personal computer, a smart phone and other devices, and no specific limitation is made here.

[0048] like Figure 1 As shown, the earphone box may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.

[0049] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation on the earphone box, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0050] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an earphone box control program. The operating system is a program that manages and controls the hardware and software resources of the device and supports the operation of the earphone box control program and other software or programs. Figure 1 In the device shown, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing a communication connection with the server; and the processor 1001 can be used to call the earphone box control program stored in the memory 1005 and perform the following operations:

[0051] Get the current status of the earphone box at the current detection moment;

[0052] Determining a communication cycle duration of the earphone box based on the current earphone box state, wherein the communication cycle duration when the current earphone box state is a moving state is less than or equal to the communication cycle duration when the current earphone box state is a stationary state;

[0053] The earphone box is controlled to communicate with the terminal device according to the communication cycle duration.

[0054] Further, the processor 1001 may also be used to call the earphone box control program stored in the memory 1005, and perform the following operations:

[0055] Acquire the current communication mode of the earphone box at the current detection moment;

[0056] The step of determining the communication cycle duration of the earphone box based on the current earphone box state comprises:

[0057] Based on the current communication mode and the current earphone box state, the communication cycle duration of the earphone box is determined, wherein, under the same earphone box state, the communication cycle duration when the current communication mode is the connection communication mode is smaller than the communication cycle duration when the current communication mode is the broadcast communication mode.

[0058] Further, when the current communication mode is the broadcast communication mode, the step of determining the communication cycle duration of the earphone box based on the current communication mode and the current earphone box state includes:

[0059] Acquire the historical communication mode and historical headphone box status of the headphone box at the previous detection moment;

[0060] In a case where the historical communication mode is the broadcast communication mode, detecting whether the current earphone box state is the same as the historical earphone box state;

[0061] If the current earphone box state is the same as the historical earphone box state, the first cycle duration is used as the communication cycle duration when the current earphone box state is the moving state, and the second cycle duration is used as the communication cycle duration when the current earphone box state is the stationary state, wherein the first cycle duration is less than the second cycle duration;

[0062] If the current earphone box state is different from the historical earphone box state, the third cycle length is used as: the communication cycle length when the current earphone box state is the moving state, and the communication cycle length when the current earphone box state is the static state, wherein the third cycle length is less than or equal to the first cycle length.

[0063] Furthermore, the step of obtaining the current communication mode of the earphone box at the current detection moment includes:

[0064] If the communication link between the earphone box and the connection terminal is in a normal communication state at the current detection moment, determining that the current communication mode is the connection communication mode, wherein the connection terminal is a terminal device that establishes a connection with the earphone box;

[0065] If the communication link is in an abnormal communication state, it is determined that the current communication mode is the broadcast communication mode.

[0066] Further, if the communication link is in an abnormal communication state, the step of determining that the current communication mode is the broadcast communication mode includes:

[0067] If the communication link is in a communication abnormality state, detecting whether the duration of the communication abnormality state is greater than a preset duration;

[0068] If the duration is greater than the preset duration, it is determined that the current communication mode is the broadcast communication mode.

[0069] Further, after the step of detecting whether the duration of the abnormal communication state is greater than a preset duration, the processor 1001 may be used to call the earphone box control program stored in the memory 1005, and perform the following operations:

[0070] If the duration is less than or equal to the preset duration, the current communication mode is determined to be the connection communication mode.

[0071] Further, after the step of obtaining the current communication mode of the earphone box at the current detection moment, the processor 1001 may be used to call the earphone box control program stored in the memory 1005, and perform the following operations:

[0072] If the current state of the earphone box is the moving state, and the current communication mode is the connecting communication mode, detecting whether the earphone box is in a ready-to-use state;

[0073] If the earphone box is in the standby state, the earphone device in the earphone box is awakened, so that the earphone device is connected to a pairing terminal after the earphone box is opened, wherein the pairing terminal is a terminal device paired with the earphone box.

[0074] Furthermore, an acceleration sensor is provided on the earphone box, and the step of obtaining the current earphone box state at the current detection moment includes:

[0075] Acquire sensor data collected by the acceleration sensor in a current data collection period corresponding to a current detection moment, and determine a basic earphone box state corresponding to the current data collection period based on the sensor data;

[0076] The current earphone box state of the earphone box is determined based on the basic earphone box state.

[0077] Further, the step of determining the current earphone box state of the earphone box based on the basic earphone box state includes:

[0078] Acquire the periodic earphone box status corresponding to each of the preset number of data collection periods that are consecutive to the current data collection period;

[0079] If the basic earphone box state and each of the periodic earphone box states are the same, the basic earphone box state is used as the current earphone box state;

[0080] If the basic earphone box state and each of the periodic earphone box states are not the same, the historical earphone box state of the earphone box at the previous detection moment is used as the current earphone box state.

[0081] Based on the above structure, various embodiments of the earphone box control method are proposed.

[0082] Reference Figure 2 , Figure 2 1 is a flow chart of a first embodiment of a method for controlling an earphone box according to the present invention.

[0083] The embodiment of the present invention provides an embodiment of the earphone box control method. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than here. In this embodiment, the executor of the earphone box control method may be an earphone box, specifically a charging box for TWS earphones. In this embodiment, the earphone box control method includes:

[0084] Step S10, obtaining the current state of the earphone box at the current detection moment;

[0085] The earphone box of the TWS earphone has a built-in communication chip that is used to provide anti-lost and lost retrieval functions for the earphone box. For example, it can be a BLE (Bluetooth Low Energy) chip. When the earphone box is connected to the terminal device, the earphone box and the terminal communicate regularly. The terminal device receives information indicating that the earphone box is around the user. If the terminal device does not receive information from the earphone box for a long time, the earphone box may have moved away from the user and there is a risk of loss. If the communication between the earphone box and the terminal device is abnormal, the earphone box switches to regular broadcast communication. After other terminals within the communication range of the earphone box receive the information, they upload the earphone box information and current location to the server to facilitate retrieval by the owner.

[0086] However, the scheduled communication between the earphone box and the terminal device is too frequent in many cases. For example, in most cases the earphone box is placed on an office desk or coffee table and has no place to move. Similarly, after the earphone box is left behind and lost, it is often stationary. At this time, too frequent communication causes the earphone box to consume higher power to maintain the anti-loss function, reducing the battery life of the earphone box.

[0087] This embodiment proposes a method for adjusting the communication cycle of the headphone box based on the motion state of the headphone box, so as to reduce the power consumption required for the headphone box to maintain the anti-lost function, thereby extending the battery life of the headphone box. Specifically, the state that characterizes whether the headphone box is in motion is called the headphone box state, and the headphone box state can specifically include a motion state and a static state. In the communication process between the headphone box and the terminal device, the headphone box state of the headphone box can be obtained, and the communication cycle duration of the headphone box can be adjusted based on the headphone box state. In a specific implementation, the headphone box state detection can be performed when a detection instruction issued by the user in a touch, voice, etc. is received; or a state detection cycle can be pre-set, and the headphone box state is detected according to the state detection cycle, and the specific details are not limited here. In this embodiment, the moment of obtaining the headphone box state is called the detection moment, and the headphone box state at the current detection moment is called the current headphone box state.

[0088] Since the state of the earphone box indicates whether the earphone box is in motion, and since motion is a process state, when obtaining the state of the earphone box, it is necessary to determine the state of the earphone box at the detection moment based on the motion of the earphone box in a period of time before the detection moment (hereinafter referred to as the data acquisition cycle for distinction), and the data acquisition cycle corresponding to the current detection moment is referred to as the current data acquisition cycle. There may be multiple data acquisition cycles or one data acquisition cycle between every two detection moments, which can be determined according to the triggering method of obtaining the state of the earphone box, or according to the method of obtaining the state of the earphone box, and there is no limitation here.

[0089] The earphone box will produce changes in acceleration during the movement. Therefore, in one feasible implementation, the way to obtain the current state of the earphone box may be: an acceleration sensor may be set on the earphone box, and according to the data collected by the acceleration sensor during the current data collection period, it is determined whether the earphone box moves during the data collection period, thereby determining the current state of the earphone box; when the earphone box is in motion, objects in the external environment where the earphone box is located will also move relative to the earphone box. Therefore, in another feasible implementation, the way to obtain the current state of the earphone box may be: an image sensor is set on the earphone box, and according to the data collected by the image sensor during the current data collection period, it is determined whether objects in the external environment where the earphone box is located move relative to the earphone box during the data collection period, thereby determining the current state of the earphone box. The current state of the earphone box may also be obtained in other specific ways, which are not limited here.

[0090] Step S20, determining the communication cycle duration of the earphone box based on the current earphone box state, wherein the communication cycle duration when the current earphone box state is a moving state is less than or equal to the communication cycle duration when the current earphone box state is a stationary state;

[0091] In this embodiment, after the current earphone box state is obtained, the communication cycle duration of the earphone box is determined based on the current earphone box state. If the current earphone box state is in motion, it is determined that the risk of losing the earphone box is high, and a shorter communication cycle duration can be set at this time; if the current earphone box state is in a stationary state, it is determined that the earphone box is stationary, and the risk of losing the earphone box is low at this time, and a longer communication cycle duration can be set. Therefore, in this embodiment, the communication cycle duration when the current earphone box state is in motion is set to be less than or equal to the communication cycle duration when the current earphone box state is in a stationary state.

[0092] In one feasible implementation, preset cycle durations corresponding to different earphone box states may be pre-set, and the preset cycle duration corresponding to the current earphone box state may be determined from various preset cycle durations as the communication cycle duration; in another feasible implementation, the communication cycle duration may be determined based on the current earphone box state, the duration of the current earphone box state, etc. For example, in one feasible implementation, a mapping relationship between the current earphone box state and the duration of the current earphone box state and the cycle duration may be set, and the communication cycle duration may be obtained based on the mapping relationship, the current earphone box state, and the duration of the current earphone box state. For example, in another feasible implementation, a neural network model may be trained with the cycle duration as a training label and the earphone box state and the duration of the earphone box state as input data, and the communication cycle duration may be obtained based on the neural network model, the current earphone box state, and the duration of the current earphone box state. The specific setting may be based on actual needs and is not limited here.

[0093] Step S30, controlling the earphone box to communicate with the terminal device according to the communication cycle duration.

[0094] In this embodiment, after the communication cycle duration is determined, the earphone box is controlled to communicate with the terminal device according to the communication cycle duration.

[0095] In this embodiment, the terminal device can be a connection terminal that establishes a connection with the headset box; it can also be an environmental terminal within the communication range of the headset box. It can be understood that there may be terminal devices that have been paired with the headset box and terminal devices that have not been paired with the headset box in the environmental terminal, and no limitation is made here. When the terminal device is a connection terminal, the communication mode between the headset box and the connection terminal can be a connection communication mode; when the terminal device is an environmental terminal, the communication mode between the headset box and the environmental terminal can be a broadcast communication mode.

[0096] In the specific application process of this embodiment, the time interval between the current detection moment and the detection moment before the current detection moment may be the same as the duration of the communication cycle of the headset box before the current detection moment (hereinafter referred to as the historical cycle duration for distinction), or may be different from the historical cycle duration. Therefore, the current detection moment may be at the end of a communication cycle, or may be at a certain moment in a communication cycle. Therefore, in this embodiment, if the current detection moment is at the end of a communication cycle, the communication cycle duration can be used as the cycle duration of the headset box and the terminal device at the moment of obtaining the communication cycle duration, and the headset box can be controlled to communicate with the terminal device according to the communication cycle duration; if the current detection moment is at a certain moment in a communication cycle, the moment of adjusting the communication cycle duration to the communication cycle duration can be set according to actual needs.

[0097] Exemplarily, when the current detection moment is at a certain moment in a communication cycle, in a feasible implementation manner, at the moment when the communication cycle ends, the communication cycle duration can be immediately used as the cycle duration for the communication between the earphone box and the terminal device, and the earphone box can be controlled to communicate with the terminal device according to the communication cycle duration. In this implementation manner, the frequency of adjusting the communication cycle is low, and the power consumption required for the earphone box to maintain the anti-loss function is low, which can extend the battery life of the earphone box. In another feasible implementation manner, the communication cycle duration can also be used as the cycle duration for the communication between the earphone box and the terminal device at the moment of obtaining the communication cycle duration, and the earphone box can be controlled to communicate with the terminal device according to the communication cycle duration. In this implementation manner, the adjustment of the communication cycle has strong timeliness. If the current state of the earphone box is in motion, the risk of losing the earphone box due to untimely communication can be avoided, thereby improving the safety of the earphone box.

[0098] In this embodiment, the current state of the earphone box at the current detection moment is obtained; the communication cycle duration of the earphone box is determined based on the current state of the earphone box, wherein the communication cycle duration when the current state of the earphone box is in motion is less than or equal to the communication cycle duration when the current state of the earphone box is in a stationary state; and the earphone box is controlled to communicate with the terminal device according to the communication cycle duration.

[0099] In this embodiment, if the current state of the earphone box is in motion, it is determined that the risk of losing the earphone box is high, and a shorter communication cycle duration is set at this time; if the current state of the earphone box is in a stationary state, it is determined that the earphone box is stationary, and the risk of losing the earphone box is low at this time, and a longer communication cycle duration is set. Compared with setting a fixed communication cycle duration for the earphone box, this embodiment can reduce the communication frequency between the earphone box and the terminal device, thereby reducing the power consumption required for the earphone device to maintain the anti-loss function, thereby increasing the battery life of the earphone box.

[0100] Further, based on the above first embodiment, a second embodiment of the earphone box control method of the present invention is proposed. In this embodiment, referring to Figure 3 , the earphone box control method also includes:

[0101] Step S40, obtaining the current communication mode of the earphone box at the current detection moment;

[0102] In this embodiment, the communication mode of the earphone box at the current detection moment is obtained, which is hereinafter referred to as the current communication mode for distinction. The communication mode of the earphone box includes a connection communication mode and a broadcast communication mode. When the earphone box is connected to the terminal device, the communication mode between the earphone box and the terminal device is the connection communication mode; when the earphone box is not connected to the terminal device, the communication mode between the earphone box and the terminal device is the broadcast communication mode. Since the earphone box is connected to the terminal device in the connection communication mode, the risk of loss of the earphone box is relatively low at this time; in contrast, the risk of loss of the earphone box is relatively high in the broadcast communication mode. Therefore, in order to ensure the timeliness of the anti-loss function, different cycle durations are set for the communication cycle based on different communication modes in this embodiment. Specifically, under the same earphone box state, the cycle duration corresponding to the connection communication mode is shorter than the cycle duration corresponding to the broadcast communication mode.

[0103] In one feasible implementation, the current communication mode may be determined based on the communication mode of the communication link between the headset box and the connection terminal at the current detection moment, for example: if the communication link between the headset box and the connection terminal is in a normal communication state, the current communication mode is determined to be a connection communication mode; if the communication link is in an abnormal communication state, the current communication mode is determined to be a broadcast communication mode. In another feasible implementation, the current communication mode may be determined based on the communication mode of the communication link within a period of time before the current detection moment, for example: if the duration of the abnormal communication state is greater than a preset duration from the moment when the communication link is determined to be in an abnormal communication state, the current communication mode is determined to be a broadcast communication mode; if the duration is less than or equal to the preset duration, the current communication mode is determined to be a connection communication mode. The specific settings can be made according to actual needs and are not limited here.

[0104] In this embodiment, step S20 includes:

[0105] Step S201, based on the current communication mode and the current earphone box state, determine the communication cycle duration of the earphone box, wherein, under the same earphone box state, the communication cycle duration when the current communication mode is the connection communication mode is less than the communication cycle duration when the current communication mode is the broadcast communication mode.

[0106] In this embodiment, the communication cycle duration of the headphone box is determined based on the current communication mode and the current headphone box state. Specifically, under the same headphone box state, the communication cycle duration when the current communication mode is the connection communication mode is shorter than the communication cycle duration when the current communication mode is the broadcast communication mode.

[0107] In one feasible implementation, a mapping relationship between different earphone box states and different communication modes and cycle durations may be pre-set, and the communication cycle duration may be obtained based on the mapping relationship, the current earphone box state, and the current communication mode. In another feasible implementation, a neural network model may be obtained by training with the cycle duration as a training label and the earphone box state and the communication mode as input data, and the communication cycle duration may be obtained based on the neural network model, the current earphone box state, and the current communication mode. Other feasible methods may also be used, which are not specifically limited here.

[0108] Exemplarily, in a feasible implementation, the process of determining the communication cycle duration of the earphone box may be: if the current communication mode is a broadcast communication mode, the first cycle duration is used as the communication cycle duration when the current earphone box state is in motion, and the second cycle duration is used as the communication cycle duration when the current earphone box state is in a stationary state, wherein the first cycle duration is less than the second cycle duration; if the current communication mode is a connection communication mode, the fourth cycle duration is used as the communication cycle duration when the current earphone box state is in motion, and the fifth cycle duration is used as the communication cycle duration when the current earphone box state is in a stationary state, wherein the fourth cycle duration is less than the fifth cycle duration. Compared with the method of training through a neural network model, this implementation can reduce the amount of calculation, reduce the power consumption of the earphone box, and thus extend the battery life of the earphone box.

[0109] Furthermore, in a feasible implementation manner, after step S40, the following further comprises:

[0110] Step S50, if the current state of the earphone box is the moving state, and the current communication mode is the connected communication mode, detecting whether the earphone box is in a ready-to-use state;

[0111] After the TWS earphones are fully charged in the earphone box, they are turned off and the earphone box enters a low-power state. When the user opens the cover of the earphone box, the earphone box exits the low-power state and wakes up the earphones. The earphones turn on, initialize the Bluetooth protocol stack, and the TWS earphones connect back to the phone. The TWS earphones initialize various sensors and detect wearing actions for user use.

[0112] However, it takes a certain amount of time to initialize the Bluetooth protocol stack and sensors. If the user opens the cover and quickly takes out the earphones and puts them on, the earphones may not have completed initialization, resulting in failure to recognize the earphones as being worn and play sound in time, causing the user to be unable to use the TWS earphones in time, reducing the user experience. Especially for incoming calls or conversations, if the TWS earphones cannot be provided to users in time, users may be unable to answer calls, reducing the user experience and even causing users to suffer economic losses due to not receiving calls.

[0113] Therefore, in this embodiment, an optimized earphone wake-up function is proposed for the earphone box, which wakes up the earphone before the upper cover of the earphone box is opened, so as to reduce the time consumption of earphone connection and improve user experience. Specifically, if the current earphone box state is the moving state and the current communication mode is the connecting communication mode, it is detected whether the earphone box is in the ready-to-use state.

[0114] Since the acceleration in a certain direction increases significantly when the earphone box is picked up, in one feasible implementation, the earphone box is determined to be in a standby state when it is detected that the acceleration on a certain axis of the acceleration sensor exceeds the acceleration threshold; in another feasible implementation, the earphone box is determined to be in a standby state when it is detected that the difference between the acceleration on a certain axis of the acceleration sensor and the acceleration on other axes exceeds the difference threshold; since the force used by the user to open the upper cover of the earphone box is usually greater than the force used by the user to hold the earphone box, in another feasible implementation, a pressure sensor may be provided at the upper cover of the earphone box, and the earphone box is determined to be in a standby state when it is detected that the value of the pressure sensor is greater than the pressure threshold. Detection may also be performed by other feasible detection methods, which are not limited here.

[0115] Step S60: if the earphone box is in the standby state, wake up the earphone device in the earphone box so that the earphone device connects to a pairing terminal after the earphone box is opened, wherein the pairing terminal is a terminal device paired with the earphone box.

[0116] If the earphone box is in a standby state, the earphone device in the earphone box is awakened, so that the earphone device is connected to the pairing terminal after the earphone box is opened, wherein the pairing terminal is a terminal device paired with the earphone box.

[0117] Exemplarily, in a feasible implementation, the pairing terminal can be a user's mobile phone. In this implementation, an acceleration sensor is provided on the earphone box. When the earphone box is connected to the mobile phone, that is, the current communication mode is the connection communication mode, and it is determined that the current earphone box state is static, if the acceleration sensor detects that the acceleration value of a specified axis is greater than the acceleration threshold, the acceleration sensor reports an event, and the main control chip of the earphone box wakes up the earphone after receiving the event. At this time, the earphone is turned on and the Bluetooth protocol stack and various sensors are initialized. The earphone detects that the cover is opened and reconnects to the mobile phone, and plays sound after detecting that the user is wearing it.

[0118] In this embodiment, the current communication mode of the earphone box at the current detection moment is obtained; based on the current communication mode and the current earphone box state, the communication cycle duration of the earphone box is determined, wherein, under the same earphone box state, the communication cycle duration when the current communication mode is the connection communication mode is less than the communication cycle duration when the current communication mode is the broadcast communication mode.

[0119] In the connection communication mode, the earphone box is connected to the terminal device, and the risk of losing the earphone box is low. In contrast, in the broadcast communication mode, the risk of losing the earphone box is high. In this embodiment, by setting a shorter communication cycle for the broadcast communication mode in the same earphone box state, the timeliness of the anti-lost function is guaranteed, thereby improving the safety of the earphone box.

[0120] Further, based on the above-mentioned first embodiment and / or second embodiment, a third embodiment of the earphone box control method of the present invention is proposed. In this embodiment, referring to Figure 4 , step S201 includes:

[0121] Step S2011, obtaining the historical communication mode and historical headphone box status of the headphone box at the previous detection moment;

[0122] When the current communication mode of the earphone box is the broadcast communication mode, the earphone box is not connected to the terminal device. If the motion state of the earphone box changes, it may be caused by the operation of the earphone box by passers-by. Therefore, when the current communication mode is the broadcast communication mode, compared with the situation where the motion state remains unchanged, the risk of losing the earphone is higher when the motion state changes. Therefore, in order to improve the timeliness of the anti-loss function of the earphone box and balance the power consumption of the anti-loss function, this embodiment sets different communication cycle durations for the situation where the current communication mode is the broadcast communication mode and the motion state changes, and for the situation where the current communication mode is the broadcast communication mode and the motion state remains unchanged.

[0123] Specifically, the communication mode and the headphone box state at the previous detection moment are obtained. The communication mode at the previous detection moment is referred to as the historical communication mode, and the headphone box state at the previous detection moment is referred to as the historical headphone box state for distinction.

[0124] Step S2012, when the historical communication mode is the broadcast communication mode, detecting whether the current earphone box state is the same as the historical earphone box state;

[0125] In this embodiment, when the historical communication mode is the broadcast communication mode, it is detected whether the current earphone box state is the same as the historical earphone box state.

[0126] Step S2013, if the current earphone box state is the same as the historical earphone box state, taking the first cycle duration as the communication cycle duration when the current earphone box state is the moving state, and taking the second cycle duration as the communication cycle duration when the current earphone box state is the stationary state, wherein the first cycle duration is less than the second cycle duration;

[0127] If the current earphone box status is the same as the historical earphone box status, it is determined that the earphone box has not been moved when the current communication mode is the broadcast communication mode. At this time, the first cycle length is used as the communication cycle length when the current earphone box status is in motion, and the second cycle length that is less than the second cycle length is used as the communication cycle length when the current earphone box status is in a stationary state. Then the earphone box is controlled to perform broadcast communication with the terminal device.

[0128] Step S2014, if the current earphone box state is different from the historical earphone box state, the third cycle length is used as: the communication cycle length when the current earphone box state is the moving state, and the communication cycle length when the current earphone box state is the static state, wherein the third cycle length is less than or equal to the first cycle length.

[0129] In this embodiment, if the current earphone box state is different from the historical earphone box state, it is determined that the earphone box has been moved when the current communication mode is the broadcast communication mode. At this time, it is determined that the risk of losing the earphone box is extremely high, and the third cycle length which is less than or equal to the first cycle length is taken as: the communication cycle length when the current earphone box state is in motion, and the communication cycle length when the current earphone box state is in a stationary state. Then, the earphone box is controlled to broadcast communication with the terminal device according to the communication cycle length until the earphone box communicates successfully with the terminal device, and then the earphone box state of the earphone box is obtained.

[0130] Further, in a feasible implementation manner, step S40 includes:

[0131] Step S401, if the communication link between the earphone box and the connection terminal is in a normal communication state at the current detection moment, determining that the current communication mode is the connection communication mode, wherein the connection terminal is a terminal device that establishes a connection with the earphone box;

[0132] In this implementation, the current communication mode of the headphone box is determined based on the communication mode of the communication link between the headphone box and the connection terminal at the current detection moment, so as to reduce the amount of calculation for determining the current communication mode, reduce the power consumption of the headphone box, and thus increase the battery life of the headphone box.

[0133] Specifically, in this embodiment, the terminal device that establishes a connection with the earphone box is called a connection terminal. If the communication link between the earphone box and the connection terminal is in a normal communication state at the current detection moment, the current communication mode is determined to be the connection communication mode.

[0134] Step S402: If the communication link is in an abnormal communication state, determine that the current communication mode is the broadcast communication mode.

[0135] In this implementation manner, if the communication link is in a communication abnormality state, it is determined that the current communication mode is a broadcast communication mode.

[0136] Further, in a feasible implementation manner, step S402 includes:

[0137] Step S4021, if the communication link is in a communication abnormality state, detecting whether the duration of the communication abnormality state is greater than a preset duration;

[0138] If the communication link is in an abnormal communication state, it may be caused by a temporary disconnection between the earphone box and the connection terminal. In order to avoid misdetection of the current communication mode due to this situation and improve the accuracy of the communication cycle duration determined based on the current communication mode, in this embodiment, the current communication mode is determined based on the duration of the abnormal communication state.

[0139] Specifically, the present embodiment pre-sets a duration threshold, and if the communication link is in a communication abnormality state, it is detected whether the duration of the communication abnormality state is greater than the preset duration.

[0140] Step S4022: If the duration is greater than the preset duration, determining that the current communication mode is the broadcast communication mode.

[0141] In this embodiment, if the duration is greater than the preset duration, it is determined that the abnormal communication mode of the communication link between the earphone box and the connection terminal has continued for a period of time, and it can be determined that the communication abnormality is not caused by a temporary disconnection between the earphone box and the connection terminal. At this time, it is determined that the current communication mode is a broadcast communication mode.

[0142] Furthermore, in a feasible implementation manner, after step S4021, the method further includes:

[0143] Step S4023: If the duration is less than or equal to the preset duration, determining that the current communication mode is the connection communication mode.

[0144] In this implementation, if the duration is less than or equal to the preset duration, it can be determined that the communication abnormality is caused by the temporary disconnection between the earphone box and the connection terminal. At this time, the current communication mode is determined to be the connection communication mode.

[0145] In the present embodiment, when the current communication mode of the earphone box is the broadcast communication mode, the earphone box is not connected to the terminal device. If the motion state of the earphone box changes, it may be caused by the operation of the earphone box by passers-by. Therefore, when the current communication mode is the broadcast communication mode, compared with the case where the motion state remains unchanged, the risk of losing the earphone is higher when the motion state changes. This embodiment sets different communication cycle durations for the case where the current communication mode is the broadcast communication mode and the motion state changes, and for the case where the current communication mode is the broadcast communication mode and the motion state remains unchanged, thereby achieving a balance between the timeliness of the anti-loss function of the earphone box and the power consumption of the anti-loss function.

[0146] Further, based on the above-mentioned first, second and / or third embodiments, a fourth embodiment of the earphone box control method of the present invention is proposed, referring to Figure 5 In this embodiment, an acceleration sensor is provided on the earphone box, and step S10 includes:

[0147] Step S101, acquiring sensor data collected by the acceleration sensor in a current data collection period corresponding to a current detection moment, and determining a basic earphone box state corresponding to the current data collection period based on the sensor data;

[0148] In this embodiment, an acceleration sensor is provided on the earphone box, and the earphone box state of the earphone box is obtained based on the acceleration sensor. Specifically, in this embodiment, the sensor data collected by the acceleration sensor in the current data collection period corresponding to the current detection moment is obtained, and the earphone box state corresponding to the current data collection period is determined based on the sensor data, which is hereinafter referred to as the basic earphone box state for distinction. The specific process of determining the earphone box state corresponding to the current data collection period based on the sensor data can refer to the conventional method, and is not limited here.

[0149] Step S102: determining the current earphone box state of the earphone box based on the basic earphone box state.

[0150] The current earphone box state of the earphone box is determined based on the basic earphone box state. In one feasible implementation, the basic earphone box state may be used as the current earphone box state to reduce the amount of calculation of the earphone box and reduce the power consumption of the earphone box; in another feasible implementation, the current earphone box state may be determined based on the basic earphone box state and the periodic earphone box state of the earphone box in multiple data collection cycles to improve the accuracy of the current earphone box state, thereby improving the accuracy of the communication cycle duration, so as to make the power consumption control of the earphone box more accurate.

[0151] Further, in a feasible implementation manner, step S102 includes:

[0152] Step S1021, obtaining the periodic earphone box status corresponding to each of a preset number of data collection periods that are consecutive to the current data collection period;

[0153] In this implementation, the current earphone box state is determined based on the basic earphone box state and the periodic earphone box state of the earphone box in multiple data collection cycles to improve the accuracy of the current earphone box state, thereby improving the accuracy of the communication cycle duration, thereby making the power consumption control of the earphone box more accurate.

[0154] Specifically, the periodic earphone box states corresponding to a preset number of data collection cycles that are consecutive to the current data collection cycle are obtained.

[0155] Step S1022: if the basic earphone box state and each of the periodic earphone box states are the same, taking the basic earphone box state as the current earphone box state;

[0156] If the basic earphone box state and each of the periodic earphone box states are the same, it is determined that the earphone box is in the same state in multiple data collection cycles, and at this time, the basic earphone box state is used as the current earphone box state.

[0157] Step S1023: If the basic earphone box state and each of the periodic earphone box states are not the same, the historical earphone box state of the earphone box at the previous detection moment is used as the current earphone box state.

[0158] If the basic earphone box state and each of the periodic earphone box states are not the same, the historical earphone box state of the earphone box at the previous detection moment is used as the current earphone box state.

[0159] Furthermore, since an acceleration sensor is provided on the earphone box, a pedometer function is proposed for the earphone box in a feasible implementation. When the user goes out, the TWS device or a single earphone box is often in the pocket of clothes and can swing with the user's movement. Therefore, this implementation implements pedometer for the earphone box based on this feature to improve the accuracy of pedometer.

[0160] In this embodiment, after obtaining the current communication mode of the earphone box at the current detection moment, if it is determined that the current state of the earphone box is that the earphone box is in motion, and the current communication mode is a connected communication mode, the sensor steps are determined based on the sensor data, and the actual steps of the user are determined based on the sensor steps.

[0161] Exemplarily, in a feasible implementation, the connection terminal can be the user's mobile phone. When the earphone box is connected to the mobile phone, that is, the current communication mode is the connection communication mode, and the current earphone box state is in motion, the main control chip of the earphone box periodically reads the acceleration sensor data, and obtains the number of steps and confidence after processing. The specific processing process can refer to the conventional algorithm processing, which will not be repeated here. The earphone box reports the sensor step count and confidence when communicating with the mobile phone. Furthermore, in a feasible implementation, the mobile phone can also determine the number of steps with the highest confidence from the steps of each device as the actual number of steps of the user based on the number of steps and confidence of each device fed back by the mobile phone, watch / bracelet and earphone box.

[0162] Furthermore, in a feasible implementation, the terminal device may be a mobile phone. When the earphone box is connected to the mobile phone, that is, when the current communication mode is the connection communication mode, the default communication cycle duration between the earphone box and the mobile phone is the communication interval time A. The earphone box main control chip periodically reads the data collected by the acceleration sensor according to the communication interval time A, and determines the current earphone box state based on the acceleration sensor data (that is, obtains the sensor data collected by the acceleration sensor in the current data collection cycle corresponding to the current detection moment, and determines the basic earphone box state corresponding to the current data collection cycle based on the sensor data; determines the current earphone box state of the earphone box based on the basic earphone box state).

[0163] If the current earphone box state is in motion, the communication interval time A is maintained as the communication cycle time (that is, the fourth cycle time); if it is in a stationary state, the communication cycle time is set to the communication interval time B, wherein the communication interval time B (that is, the fifth cycle time) is greater than the communication interval time A (that is, if the current communication mode is the connection communication mode, the fourth cycle time is used as the communication cycle time when the current earphone box state is in the motion state, and the fifth cycle time is used as the communication cycle time when the current earphone box state is in the stationary state, wherein the fourth cycle time is less than the fifth cycle time).

[0164] If the earphone box fails to communicate with the mobile phone within a certain period of time, it starts regular broadcasting, sets the broadcast interval to broadcast interval A, and starts to read the acceleration sensor data regularly, and determines the current status of the earphone box based on the acceleration sensor data.

[0165] If the current state of the earphone box is in motion, the broadcast interval A (i.e., the first cycle length) is maintained as the communication cycle length; if it is in a stationary state, the communication cycle length is set to the broadcast interval B (i.e., the second cycle length); if the state of the earphone box changes, that is, from a stationary state to a moving state or from a moving state to a stationary state, the broadcast interval A (i.e., the third cycle length) is set, and the detection of the motion state is stopped until the communication with a certain terminal device is successful, and then the detection of the motion state is started (i.e., the historical communication mode and the historical earphone box state of the earphone box at the previous detection time are obtained; when the historical communication mode is the broadcast communication mode, the current earphone box state and the historical communication mode are detected. The historical earphone box state is the same as the current earphone box state; if the current earphone box state is the same as the historical earphone box state, the first cycle length is used as the communication cycle length when the current earphone box state is the moving state, and the second cycle length is used as the communication cycle length when the current earphone box state is the static state, wherein the first cycle length is less than the second cycle length; if the current earphone box state is different from the historical earphone box state, the third cycle length is used as: the communication cycle length when the current earphone box state is the moving state, and, the communication cycle length when the current earphone box state is the static state, wherein the third cycle length is less than or equal to the first cycle length).

[0166] In this embodiment, the sensor data collected by the acceleration sensor in the current data collection period corresponding to the current detection moment is obtained, and the basic earphone box state corresponding to the current data collection period is determined based on the sensor data; and the current earphone box state of the earphone box is determined based on the basic earphone box state. Compared with detecting the current earphone box state through an image sensor, the data processing amount in this embodiment is smaller, which can reduce the amount of calculation of the earphone box, reduce the power consumption of the earphone box, and extend the battery life of the earphone box.

[0167] In addition, an embodiment of the present invention further provides an earphone box control device, referring to Figure 6 , the earphone box control device comprises:

[0168] An acquisition module 10 is used to acquire the current state of the earphone box at the current detection moment;

[0169] A determination module 20 is used to determine the communication cycle duration of the earphone box based on the current earphone box state, wherein the communication cycle duration when the current earphone box state is a moving state is less than or equal to the communication cycle duration when the current earphone box state is a stationary state;

[0170] The communication module 30 is used to control the earphone box to communicate with the terminal device according to the communication cycle duration.

[0171] Furthermore, the acquisition module 10 is also used for:

[0172] Acquire the current communication mode of the earphone box at the current detection moment;

[0173] The determining module 20 is further used for:

[0174] Based on the current communication mode and the current earphone box state, the communication cycle duration of the earphone box is determined, wherein, under the same earphone box state, the communication cycle duration when the current communication mode is the connection communication mode is smaller than the communication cycle duration when the current communication mode is the broadcast communication mode.

[0175] Further, when the current communication mode is the broadcast communication mode, the determining module 20 is further configured to:

[0176] Acquire the historical communication mode and historical headphone box status of the headphone box at the previous detection moment;

[0177] In a case where the historical communication mode is the broadcast communication mode, detecting whether the current earphone box state is the same as the historical earphone box state;

[0178] If the current earphone box state is the same as the historical earphone box state, the first cycle duration is used as the communication cycle duration when the current earphone box state is the moving state, and the second cycle duration is used as the communication cycle duration when the current earphone box state is the stationary state, wherein the first cycle duration is less than the second cycle duration;

[0179] If the current earphone box state is different from the historical earphone box state, the third cycle length is used as: the communication cycle length when the current earphone box state is the moving state, and the communication cycle length when the current earphone box state is the static state, wherein the third cycle length is less than or equal to the first cycle length.

[0180] Furthermore, the acquisition module 10 is also used for:

[0181] If the communication link between the earphone box and the connection terminal is in a normal communication state at the current detection moment, determining that the current communication mode is the connection communication mode, wherein the connection terminal is a terminal device that establishes a connection with the earphone box;

[0182] If the communication link is in an abnormal communication state, it is determined that the current communication mode is the broadcast communication mode.

[0183] Furthermore, the acquisition module 10 is also used for:

[0184] If the communication link is in a communication abnormality state, detecting whether the duration of the communication abnormality state is greater than a preset duration;

[0185] If the duration is greater than the preset duration, it is determined that the current communication mode is the broadcast communication mode.

[0186] Furthermore, the acquisition module 10 is also used for:

[0187] If the duration is less than or equal to the preset duration, the current communication mode is determined to be the connection communication mode.

[0188] Furthermore, the earphone box control device also includes a wake-up module, which is used to:

[0189] If the current state of the earphone box is the moving state, and the current communication mode is the connecting communication mode, detecting whether the earphone box is in a ready-to-use state;

[0190] If the earphone box is in the standby state, the earphone device in the earphone box is awakened, so that the earphone device is connected to a pairing terminal after the earphone box is opened, wherein the pairing terminal is a terminal device paired with the earphone box.

[0191] Furthermore, an acceleration sensor is provided on the earphone box, and the acquisition module 10 is further used for:

[0192] Acquire sensor data collected by the acceleration sensor in a current data collection period corresponding to a current detection moment, and determine a basic earphone box state corresponding to the current data collection period based on the sensor data;

[0193] The current earphone box state of the earphone box is determined based on the basic earphone box state.

[0194] Furthermore, the acquisition module 10 is also used for:

[0195] Acquire the periodic earphone box status corresponding to each of the preset number of data collection periods that are consecutive to the current data collection period;

[0196] If the basic earphone box state and each of the periodic earphone box states are the same, the basic earphone box state is used as the current earphone box state;

[0197] If the basic earphone box state and each of the periodic earphone box states are not the same, the historical earphone box state of the earphone box at the previous detection moment is used as the current earphone box state.

[0198] The various embodiments of the earphone box control device of the present invention can refer to the various embodiments of the earphone box control method of the present invention, and will not be described in detail here.

[0199] In addition, an embodiment of the present invention further provides a computer-readable storage medium, on which an earphone box control program is stored. When the earphone box control program is executed by a processor, the steps of the earphone box control method described below are implemented.

[0200] The various embodiments of the earphone box and the computer-readable storage medium of the present invention may refer to the various embodiments of the earphone box control method of the present invention, and will not be described in detail here.

[0201] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0202] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0203] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0204] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for controlling an earphone box, characterized in that: The earphone box control method comprises the following steps: Get the current status of the earphone box at the current detection moment; Determining a communication cycle duration of the earphone box based on the current earphone box state, wherein the communication cycle duration when the current earphone box state is a moving state is less than or equal to the communication cycle duration when the current earphone box state is a stationary state; The earphone box is controlled to communicate with the terminal device according to the communication cycle duration.

2. The earphone box control method according to claim 1, characterized in that: The earphone box control method further includes: Acquire the current communication mode of the earphone box at the current detection moment; The step of determining the communication cycle duration of the earphone box based on the current earphone box state comprises: Based on the current communication mode and the current earphone box state, the communication cycle duration of the earphone box is determined, wherein, under the same earphone box state, the communication cycle duration when the current communication mode is the connection communication mode is smaller than the communication cycle duration when the current communication mode is the broadcast communication mode.

3. The earphone box control method according to claim 2, characterized in that: When the current communication mode is the broadcast communication mode, the step of determining the communication cycle duration of the earphone box based on the current communication mode and the current earphone box state includes: Acquire the historical communication mode and historical headphone box status of the headphone box at the previous detection moment; In a case where the historical communication mode is the broadcast communication mode, detecting whether the current earphone box state is the same as the historical earphone box state; If the current earphone box state is the same as the historical earphone box state, the first cycle duration is used as the communication cycle duration when the current earphone box state is the moving state, and the second cycle duration is used as the communication cycle duration when the current earphone box state is the stationary state, wherein the first cycle duration is less than the second cycle duration; If the current earphone box state is different from the historical earphone box state, the third cycle length is used as: the communication cycle length when the current earphone box state is the moving state, and the communication cycle length when the current earphone box state is the static state, wherein the third cycle length is less than or equal to the first cycle length.

4. The earphone box control method according to claim 2, characterized in that: The step of obtaining the current communication mode of the earphone box at the current detection moment includes: If the communication link between the earphone box and the connection terminal is in a normal communication state at the current detection moment, determining that the current communication mode is the connection communication mode, wherein the connection terminal is a terminal device that establishes a connection with the earphone box; If the communication link is in an abnormal communication state, it is determined that the current communication mode is the broadcast communication mode.

5. The earphone box control method according to claim 4, characterized in that: The step of determining that the current communication mode is the broadcast communication mode if the communication link is in an abnormal communication state comprises: If the communication link is in a communication abnormality state, detecting whether the duration of the communication abnormality state is greater than a preset duration; If the duration is greater than the preset duration, it is determined that the current communication mode is the broadcast communication mode.

6. The earphone box control method according to claim 5, characterized in that: After the step of detecting whether the duration of the abnormal communication state is greater than a preset duration, the method further includes: If the duration is less than or equal to the preset duration, the current communication mode is determined to be the connection communication mode.

7. The earphone box control method according to claim 2, characterized in that: After the step of obtaining the current communication mode of the earphone box at the current detection moment, the method further includes: If the current state of the earphone box is the moving state, and the current communication mode is the connecting communication mode, detecting whether the earphone box is in a ready-to-use state; If the earphone box is in the standby state, the earphone device in the earphone box is awakened, so that the earphone device is connected to a pairing terminal after the earphone box is opened, wherein the pairing terminal is a terminal device paired with the earphone box.

8. The earphone box control method according to any one of claims 1 to 7, characterized in that: The earphone box is provided with an acceleration sensor, and the step of obtaining the current earphone box state at the current detection moment includes: Acquire sensor data collected by the acceleration sensor in a current data collection period corresponding to a current detection moment, and determine a basic earphone box state corresponding to the current data collection period based on the sensor data; The current earphone box state of the earphone box is determined based on the basic earphone box state.

9. The earphone box control method according to claim 8, characterized in that: The step of determining the current earphone box state of the earphone box based on the basic earphone box state comprises: Acquire the periodic earphone box status corresponding to each of the preset number of data collection periods that are consecutive to the current data collection period; If the basic earphone box state and each of the periodic earphone box states are the same, the basic earphone box state is used as the current earphone box state; If the basic earphone box state and each of the periodic earphone box states are not the same, the historical earphone box state of the earphone box at the previous detection moment is used as the current earphone box state.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an earphone box control program, and when the earphone box control program is executed by the processor, the steps of the earphone box control method according to any one of claims 1 to 9 are implemented.