Earphone loss prevention method and device and related equipment
1. An anti-loss method for a headset, comprising:
acquiring the three-axis resultant acceleration of the earphone in real time;
calculating the wave peak value of the earphone according to the three-axis combined acceleration;
judging whether the earphone is in an impact state or not according to each wave peak value;
confirming that the earphone is lost when the earphone is in the impact state.
2. The method for preventing the loss of the earphone according to claim 1, wherein before calculating the peak value of the earphone according to the three-axis combined acceleration, the method further comprises:
judging whether the earphone is in a weightlessness state according to the three-axis combined acceleration, and when the earphone is in the weightlessness state, executing the step of calculating the wave peak value of the earphone according to the three-axis combined acceleration;
before the confirming that the earphone is lost, the method further comprises:
and judging whether the earphone is in a static state or not according to the three-axis combined acceleration after the impact of the earphone, and executing the step of confirming that the earphone is lost when the earphone is in the static state.
3. The method for preventing the loss of the earphone according to claim 2, wherein the determining whether the earphone is in the weightless state according to the three-axis combined acceleration comprises:
counting the duration of the three-axis combined acceleration smaller than a preset threshold;
and when the duration exceeds the preset duration, determining that the earphone is in the weightlessness state.
4. The method for preventing the loss of the earphone according to claim 2, wherein the determining whether the earphone is in the weightless state according to the three-axis combined acceleration comprises:
counting a first number of the three-axis combined acceleration smaller than a first threshold;
and when the first quantity exceeds a first preset quantity, determining that the earphone is in the weightless state.
5. The method for preventing the loss of the earphone according to claim 2, wherein the step of judging whether the earphone is in a static state according to the three-axis combined acceleration after the earphone is collided comprises the following steps:
counting a second number of the three-axis combined acceleration smaller than a second threshold value after the earphone is impacted;
when the second number exceeds a second preset number, determining that the earphone is in the static state.
6. The method for preventing the loss of the earphone according to any one of claims 2 to 5, wherein the determining whether the earphone is in the collision state according to each wave peak value comprises:
judging whether the maximum wave peak value in a first preset time length after the earphone is weightless exceeds a first wave peak threshold value or not;
if the maximum wave peak value exceeds the first wave peak threshold value, taking the moment corresponding to the maximum wave peak value as an impact moment, and calculating a first wave peak mean value in a second preset time before the impact moment, a second wave peak mean value in a third preset time after the impact moment and the number of wave peaks;
judging whether a first difference value between the maximum wave crest value and the first wave crest mean value exceeds a second wave crest threshold value, whether a second difference value between the maximum wave crest value and the second wave crest mean value exceeds a third wave crest threshold value, and whether the number of wave crests is lower than a preset number of wave crests;
and if so, determining that the earphone is in the impact state.
7. The method for preventing loss of the earphone according to claim 1, wherein after confirming that the earphone is lost, the method further comprises:
and outputting alarm prompt information to a user terminal connected with the earphone.
8. An anti-loss device for a headset, comprising:
the data acquisition module is used for acquiring the three-axis combined acceleration of the earphone in real time;
the wave peak value calculating module is used for calculating the wave peak value of the earphone according to the three-axis combined acceleration;
the impact state judging module is used for judging whether the earphone is in an impact state or not according to the wave peak values;
a loss confirmation module for confirming that the earphone is lost when the earphone is in the impact state.
9. An earphone, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the headset loss prevention method as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method for preventing loss of a headset according to any of the claims 1 to 7.
Background
With the wide application of smart phones, the development of wireless earphones is more rapid, and the characteristics of lightness and portability are favored by users, so that the users can avoid the trouble of connecting wires. Among them, TWS (True Wireless Stereo) headphones are recognized by more and more people due to their good Wireless Stereo experience. However, when the TWS headset is used by a user, the headset often falls off from the ears of the user, and if the user fails to notice that the headset falls off, the headset is easily lost, which brings a bad experience to the user.
Therefore, how to effectively avoid losing the earphones and improve the user experience is a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The method for preventing the loss of the earphone can effectively solve the problem that the earphone is easy to lose, and further improves user experience; another object of the present application is to provide an anti-loss device for a headset, a headset and a computer readable storage medium, all of which have the above advantages.
In a first aspect, the present application provides a method for preventing loss of an earphone, including:
acquiring the three-axis resultant acceleration of the earphone in real time;
calculating the wave peak value of the earphone according to the three-axis combined acceleration;
judging whether the earphone is in an impact state or not according to each wave peak value;
confirming that the earphone is lost when the earphone is in the impact state.
Preferably, before calculating the peak value of the headphone according to the three-axis combined acceleration, the method further includes:
judging whether the earphone is in a weightlessness state according to the three-axis combined acceleration, and when the earphone is in the weightlessness state, executing the step of calculating the wave peak value of the earphone according to the three-axis combined acceleration;
before the confirming that the earphone is lost, the method further comprises:
and judging whether the earphone is in a static state or not according to the three-axis combined acceleration after the impact of the earphone, and executing the step of confirming that the earphone is lost when the earphone is in the static state.
Preferably, the determining whether the earphone is in a weightlessness state according to the three-axis combined acceleration includes:
counting the duration of the three-axis combined acceleration smaller than a preset threshold;
and when the duration exceeds the preset duration, determining that the earphone is in the weightlessness state.
Preferably, the determining whether the earphone is in a weightlessness state according to the three-axis combined acceleration includes:
counting a first number of the three-axis combined acceleration smaller than a first threshold;
and when the first quantity exceeds a first preset quantity, determining that the earphone is in the weightless state.
Preferably, the determining whether the earphone is in a stationary state according to the three-axis combined acceleration after the impact of the earphone includes:
counting a second number of the three-axis combined acceleration smaller than a second threshold value after the earphone is impacted;
when the second number exceeds a second preset number, determining that the earphone is in the static state.
Preferably, the determining whether the earphone is in the impact state according to each of the peak values includes:
judging whether the maximum wave peak value in a first preset time length after the earphone is weightless exceeds a first wave peak threshold value or not;
if the maximum wave peak value exceeds the first wave peak threshold value, taking the moment corresponding to the maximum wave peak value as an impact moment, and calculating a first wave peak mean value in a second preset time before the impact moment, a second wave peak mean value in a third preset time after the impact moment and the number of wave peaks;
judging whether a first difference value between the maximum wave crest value and the first wave crest mean value exceeds a second wave crest threshold value, whether a second difference value between the maximum wave crest value and the second wave crest mean value exceeds a third wave crest threshold value, and whether the number of wave crests is lower than a preset number of wave crests;
and if so, determining that the earphone is in the impact state.
Preferably, after confirming that the earphone is lost, the method further includes:
and outputting alarm prompt information to a user terminal connected with the earphone.
In a second aspect, the present application further discloses an anti-loss device for an earphone, including:
the data acquisition module is used for acquiring the three-axis combined acceleration of the earphone in real time;
the wave peak value calculating module is used for calculating the wave peak value of the earphone according to the three-axis combined acceleration;
the impact state judging module is used for judging whether the earphone is in an impact state or not according to the wave peak values;
a loss confirmation module for confirming that the earphone is lost when the earphone is in the impact state.
In a third aspect, the present application also discloses a headset, comprising:
a memory for storing a computer program;
a processor for implementing the steps of any of the above-described anti-loss methods of headphones when executing the computer program.
In a fourth aspect, the present application also discloses a computer-readable storage medium having a computer program stored thereon, which, when being executed by a processor, implements the steps of any one of the above-mentioned methods for preventing loss of a headset.
The method for preventing the loss of the earphone comprises the steps of acquiring the three-axis resultant acceleration of the earphone in real time; calculating the wave peak value of the earphone according to the three-axis combined acceleration; judging whether the earphone is in an impact state or not according to each wave peak value; confirming that the earphone is lost when the earphone is in the impact state.
Therefore, according to the method for preventing the loss of the earphone, when the user does not sense that the earphone drops, the dropping process of the earphone inevitably generates the impact state, therefore, the wave peak value can be calculated according to the three-axis combined acceleration of the earphone, the motion state of the earphone is further identified and determined, and whether the impact state occurs through judging the change of the motion state of the earphone, so that the dropping identification of the earphone is realized, the problem that the earphone is lost due to the fact that the earphone is easy to drop is effectively solved, the user can conveniently find the dropped earphone in time, and the user experience is further improved.
The anti-loss device for the earphone, the earphone and the computer readable storage medium have the beneficial effects, and are not described again.
Drawings
In order to more clearly illustrate the technical solutions in the prior art and the embodiments of the present application, the drawings that are needed to be used in the description of the prior art and the embodiments of the present application will be briefly described below. Of course, the following description of the drawings related to the embodiments of the present application is only a part of the embodiments of the present application, and it will be obvious to those skilled in the art that other drawings can be obtained from the provided drawings without any creative effort, and the obtained other drawings also belong to the protection scope of the present application.
Fig. 1 is a schematic flowchart of an anti-loss method for an earphone provided in the present application;
fig. 2 is a schematic flow chart of another method for preventing loss of an earphone provided in the present application;
fig. 3 is a flowchart illustrating a motion state change determination of an earphone provided in the present application;
fig. 4 is a schematic flowchart of another method for preventing loss of an earphone provided in the present application;
fig. 5 is a schematic structural diagram of an anti-loss device for earphones provided by the present application;
fig. 6 is a schematic structural diagram of an earphone provided in the present application.
Detailed Description
The core of the application is to provide an earphone loss prevention method, which can effectively solve the problem that the earphone is easy to lose and further improve the user experience; another core of the present application is to provide an anti-loss device for a headset, a headset and a computer-readable storage medium, which also have the above-mentioned advantages.
In order to more clearly and completely describe the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
With the wide application of smart phones, the development of wireless earphones is more rapid, and the characteristics of lightness and portability are favored by users, so that the users can avoid the trouble of connecting wires. Among them, TWS (True Wireless Stereo) headphones are recognized by more and more people due to their good Wireless Stereo experience. However, when the TWS headset is used by a user, the headset often falls off from the ears of the user, and if the user fails to notice that the headset falls off, the headset is easily lost, which brings a bad experience to the user.
Therefore, in order to solve the technical problem, the application provides a method for preventing loss of an earphone, when a user does not sense that the earphone drops, and the impact state inevitably occurs in the dropping process, so that the wave peak value can be calculated according to the three-axis combined acceleration of the earphone, the motion state of the earphone is identified and determined, and the impact state is determined by judging whether the change of the motion state of the earphone occurs, so that the earphone dropping identification is realized, the problem that the earphone is lost due to the fact that the earphone easily drops is effectively solved, a user can conveniently find the dropped earphone in time, and the user experience is further improved.
Referring to fig. 1, fig. 1 is a schematic flow chart of an earphone loss prevention method provided in the present application, where the earphone loss prevention method may include:
s101: acquiring the three-axis resultant acceleration of the earphone in real time;
the step aims to realize the collection of the three-axis combined acceleration of the earphone, and the earphone can fall in any posture, so that the motion state of the earphone is analyzed by adopting the three-axis combined acceleration, and the accuracy of an analysis result is effectively ensured. The calculation formula of the three-axis resultant acceleration of the earphone is as follows:
wherein A is the three-axis resultant acceleration of the earphone, axAcceleration of the earphone in the x-axis of three axes, ayAcceleration of the earphone in the y-axis of three axes, azIs the z-axis acceleration of the headset in three axes.
It can be understood that, because the dropping of the earphone lasts for a certain time, the specific dropping process can be simply decomposed into three steps of weightlessness, impact and stillness, and therefore, in order to realize the analysis of the motion state change, the three-axis resultant acceleration acquisition can adopt a real-time acquisition method.
As a preferred embodiment, the acquiring, in real time, three-axis resultant acceleration of the earphone may include: and a triaxial accelerometer arranged in the earphone is used for acquiring triaxial resultant acceleration in real time.
The preferred embodiment provides a specific three-axis combined acceleration acquisition method, which is implemented based on a three-axis accelerometer, and the three-axis accelerometer is installed inside an earphone.
S102: calculating the wave peak value of the earphone according to the three-axis combined acceleration;
s103: judging whether the earphone is in an impact state or not according to each wave peak value;
under the condition that a user does not sense, the earphone is inevitably in an impact state (such as impacting the ground) after falling, so that whether the earphone falls or not can be determined by judging whether the earphone is in the impact state or not, and the step aims to realize judgment of the impact state. It can be understood that, because the earphone generates a large impact when the earphone collides, the corresponding three-axis resultant acceleration forms a peak with a large amplitude, and therefore, the impact state of the earphone can be determined according to the amplitude of the peak. In a specific implementation process, corresponding wave peak values can be calculated according to the three-axis combined acceleration, so that whether the earphone is in an impact state or not is determined according to the change state of each wave peak value after the earphone is weightless.
As a preferred embodiment, the determining whether the earphone is in the impact state according to the peak values may include: judging whether the maximum wave peak value in a first preset time length after the earphone is weightless exceeds a first wave peak threshold value or not; if the maximum wave peak value exceeds the first wave peak threshold value, taking the moment corresponding to the maximum wave peak value as the impact moment, and calculating the first wave peak average value in a second preset time length before the impact moment, the second wave peak average value in a third preset time length after the impact moment and the quantity of wave peaks; judging whether a first difference value between the maximum wave crest value and the first wave crest mean value exceeds a second wave crest threshold value, whether a second difference value between the maximum wave crest value and the second wave crest mean value exceeds a third wave crest threshold value, and whether the number of wave crests is lower than a preset number of wave crests; and if so, determining that the earphone is in the impact state.
The preferred embodiment provides a method for determining the impact state of an earphone. Specifically, the determination rule regarding the peak amplitude as described above may be preset, and includes selecting a maximum peak value, and determining whether each peak in a certain time period before and after the maximum peak value occurs satisfies a corresponding preset condition, such as the threshold comparison, the mean comparison, the quantity comparison, and the like, so as to determine the impact state. The comparison analysis is carried out on all wave crests before the maximum wave crest value appears, so that the impact point detection is realized, and the comparison analysis is carried out on all wave crests after the maximum wave crest value appears, so that the impact point confirmation is realized, and the accuracy of the judgment result of the motion state of the earphone is effectively ensured. In addition, the first peak-to-average value and the second peak-to-average value may be the same value.
S104: confirming that the earphone is lost when the earphone is in a bumped state.
This step is intended to confirm whether the headset is lost. Specifically, when judging that there is the striking state in the motion state of earphone, can judge that the earphone has taken place to drop, on this basis, still can further output and report an emergency and ask for help or increased vigilance prompt message to remind the current earphone of user to take place to drop, the user of being convenient for in time seeks the earphone that drops, avoids the earphone to lose, has improved user experience effectively.
As a preferred embodiment, after confirming that the earphone is lost, the method may further include: and outputting the alarm prompt information to a user terminal connected with the earphone.
The method for preventing loss of an earphone provided in the preferred embodiment may further implement an alarm function, that is, sending an alarm prompt message to a user terminal connected to the dropped earphone, where the connection is generally a wireless connection, such as a bluetooth connection. The specific type of the user terminal does not affect the implementation of the technical scheme, and for example, the user terminal may be a mobile phone, a tablet, or the like, so that when the user terminal receives the warning prompt information, the user terminal can be notified in time in the forms of vibration, ringing, and interface display.
Of course, the above alarm method is only one implementation manner provided in the preferred embodiment, and is not unique, and may also be other implementation methods, for example, a buzzer may be built in the earphone, when it is determined that the earphone drops, the alarm may be directly performed by the buzzer in the earphone, and the alarm function when the earphone drops may also be implemented, so as to avoid losing the earphone.
Therefore, according to the method for preventing the loss of the earphone, when the user does not sense that the earphone drops, the dropping process of the earphone inevitably generates the impact state, therefore, the wave peak value can be calculated according to the three-axis combined acceleration of the earphone, the motion state of the earphone is further identified and determined, and whether the impact state occurs through judging the change of the motion state of the earphone, so that the dropping identification of the earphone is realized, the problem that the earphone is lost due to the fact that the earphone is easy to drop is effectively solved, the user can conveniently find the dropped earphone in time, and the user experience is further improved.
It can be understood that the dropping process of the earphone can be simply divided into three steps of weightlessness, impact and stillness, that is, the motion state of the earphone in the dropping process can be divided into a weightlessness state, an impact state and a stillness state, therefore, when the motion state of the earphone changes, it can also be judged whether the motion state changes into the weightlessness state, the impact state and the stillness state in sequence, that is, whether the motion state changes into the weightlessness state, the impact state and the stillness state: the movement state changes from the weightlessness state to the impact state and then to the static state, thereby realizing the judgment of the dropping of the earphone. Therefore, when the change of the motion state of the earphone meets the change condition, the earphone can be judged to fall off, otherwise, the earphone is not fallen off.
Therefore, based on the foregoing embodiments, an embodiment of the present application provides another method for preventing loss of an earphone, please refer to fig. 2, and fig. 2 is a schematic flow chart of the another method for preventing loss of an earphone provided by the present application.
S201: acquiring the three-axis resultant acceleration of the earphone in real time;
s202: judging whether the earphone is in a weightless state or not according to the triaxial acceleration;
specifically, the first state of the earphone entering in the dropping process is a weightlessness state, so that whether the earphone is in the weightlessness state can be judged according to the three-axis combined acceleration, and it can be understood that when the earphone is static, the value of the three-axis combined acceleration is 1g of gravity acceleration, and then when the earphone is weightless, the three-axis combined acceleration is inevitably smaller than 1 g. Furthermore, when the earphone is in the weightless state, the earphone can enter a subsequent process to judge whether the earphone sequentially enters the impact state and the static state, and when the earphone is not in the weightless state, the three-axis resultant acceleration can be continuously acquired.
As a preferred embodiment, the determining whether the earphone is in the weightless state according to the three-axis resultant acceleration may include: counting the duration of the three-axis combined acceleration smaller than a preset threshold; and when the duration exceeds the preset duration, determining that the earphone is in a weightless state.
The preferred embodiment provides a method for judging the weightless state of the earphone. Specifically, a threshold (preset threshold) may be set for the three-axis combined acceleration in advance, and then the duration that the three-axis combined acceleration is smaller than the preset threshold is counted, and when the duration exceeds the preset duration, it may be determined that the earphone is in the weightless state.
When the earphone is static, the three-axis resultant acceleration value is generally 1g of gravity acceleration, and when the earphone is weightless, the three-axis resultant acceleration value is inevitably smaller than 1g, so that the preset threshold value can be 1 g. Of course, the value is only given as an example, and is not unique, and the value can be set by a technician according to the actual situation.
In addition, the specific value of the preset duration is similar to the preset threshold, and can be set by technical personnel based on actual conditions, which is not limited in the application. On this basis, it can be understood that specific values of various thresholds appearing below are not unique, and can be reasonably set by technical personnel according to corresponding actual requirements, and the detailed description is omitted herein.
As a preferred embodiment, the determining whether the earphone is in the weightless state according to the three-axis resultant acceleration may include: counting a first number of the three-axis combined acceleration smaller than a first threshold; and when the first quantity exceeds a first preset quantity, determining that the earphone is in a weightless state.
The present preferred embodiment provides another method for determining a weightless state of an earphone, which is different from the above method in which the duration of the three-axis combined acceleration smaller than the preset threshold is used as the determination criterion, and the determination method uses the number of the three-axis combined acceleration smaller than the preset threshold as the determination criterion. Specifically, the three-axis acceleration may be acquired once per second, and when the number (the first number) of the three-axis combined acceleration smaller than the first threshold exceeds a preset number (the first preset number), it may be determined that the earphone is in the weightless state. Of course, the values of the first threshold and the preset threshold may be the same value.
S203: when the earphone is in a weightless state, calculating each wave peak value after the earphone is weightless; wherein, the wave peak value is obtained by calculation according to the three-axis combined acceleration;
s204: judging whether the earphone is in an impact state or not according to each wave peak value;
s205: when the earphone is in an impact state, judging whether the earphone is in a static state or not according to the three-axis combined acceleration after the earphone is impacted;
specifically, the third motion state after the earphone falls off is a static state, and this step aims to realize the determination of the static state, which is similar to the above-mentioned determination process of the weightless state and can also be realized according to the three-axis resultant acceleration of the earphone.
As a preferred embodiment, the determining whether the earphone is in a stationary state according to the three-axis combined acceleration after the impact of the earphone may include: counting a second number of the three-axis resultant acceleration smaller than a second threshold value after the earphone is impacted; and when the second number exceeds a second preset number, determining that the earphone is in a static state.
The preferred embodiment provides a method for determining a resting state of an earphone, which is similar to the method for determining a weightless state described above, and after determining that a moving state of the earphone is an impact state, the method may count the number (second number) of three-axis combined accelerations smaller than a second threshold, and when the second number exceeds a second preset number, the method may determine that the moving state of the earphone is a resting state. Of course, this determination method is not exclusive, and similar to the determination method of the weightless state described above, the determination of the still state of the earphone may also be performed based on the duration of the three-axis resultant acceleration being smaller than the second threshold.
S206: when the headset is in a stationary state, it is confirmed that the headset is lost.
Regarding the specific implementation process of the above S201, S203, S204, and S206, reference may be made to the previous embodiment, and details of the embodiment of the present application are not described herein again.
Therefore, according to the method for preventing the loss of the earphone, the dropping process of the earphone can be divided into three parts of weightlessness, impact and stillness, so that the motion state of the earphone is determined according to the three-axis combined acceleration identification of the earphone, and whether the change of the motion state of the earphone meets the three states of weightlessness, impact and stillness in sequence is further judged, the dropping identification of the earphone is realized, the problem that the earphone is lost due to the fact that the earphone is easy to drop is effectively solved, a user can conveniently find the dropped earphone in time, and the user experience is further improved.
Based on the above explanation, the embodiment of the present application provides another method for preventing loss of an earphone.
Referring to fig. 3 and fig. 4, fig. 3 is a flowchart illustrating a motion state change determination process of an earphone provided by the present application, and fig. 4 is a flowchart illustrating another earphone loss prevention method provided by the present application, which is implemented as follows:
1. and (3) weight loss detection:
after the three-axis resultant acceleration is acquired, counting the number N0 of the resultant acceleration continuously smaller than a threshold Thr1, and if N0 is larger than Thr2, determining that the earphone is in a weightless state.
2. And (3) impact point detection:
after determining the headphone weight loss, calculate the peak value at time T1 after weight loss: [ p ]1,…,pk]And judging whether the wave peak value meets the following conditions: max (p)1,…,pk) Thr3, if so, the maximum peak value pmaxAs impact points, namely: p is a radical ofimpact=pmax。
3. And (3) confirming an impact point:
when the impact point p is detectedimpactThereafter, the impact point p is calculatedimpactPeak value at previous time T2: [ p ]1,…,pm]And calculating to obtain a first peak mean value mean (p)1,…,pm) (ii) a Calculating the point of impact pimpactWave peak value at time T3 thereafter: [ p ]1,…,pn]And calculating to obtain a second peak mean (p)1,…,pn) And the number n of wave crests, judging whether the following conditions are met:
pmax-mean(p1,…,pm)>Thr4;
pmax-mean(p1,…,pn)>Thr4;
n<Thr5;
if so, confirming pmaxIs the point of impact.
4. And (3) stable detection:
and counting the number N1 of the continuous acceleration smaller than the threshold Thr6 after the earphone is determined to be impacted, and if N1 is larger than Thr6, the earphone is considered to be in a static state.
5. Confirming the dropping state:
and confirming that the earphone is in a falling state, and triggering an alarm to inform the user.
Therefore, according to the method for preventing the loss of the earphone, when the user does not sense that the earphone drops, the dropping process of the earphone inevitably generates the impact state, therefore, the wave peak value can be calculated according to the three-axis combined acceleration of the earphone, the motion state of the earphone is further identified and determined, and whether the impact state occurs through judging the change of the motion state of the earphone, so that the dropping identification of the earphone is realized, the problem that the earphone is lost due to the fact that the earphone easily drops is effectively solved, the user can conveniently find the dropped earphone in time, and the user experience is further improved.
To solve the above technical problem, the present application further provides an anti-loss device for an earphone, please refer to fig. 5, where fig. 5 is a schematic structural diagram of the anti-loss device for an earphone provided by the present application, and the anti-loss device for an earphone may include:
the data acquisition module 1 is used for acquiring the three-axis resultant acceleration of the earphone in real time;
the wave peak value calculating module 2 is used for calculating the wave peak value of the earphone according to the three-axis combined acceleration;
the impact state judging module 3 is used for judging whether the earphone is in an impact state according to each wave peak value;
and the loss confirmation module 4 is used for confirming that the earphone is lost when the earphone is in the collision state.
It is thus clear that the earphone anti-loss device that this application embodiment provided, when the user does not have perception earphone and drops, the striking state can certainly appear in the process of dropping of earphone, therefore, can close the calculation that the acceleration carried out the crest value according to the triaxial of earphone, and then discern and confirm its motion state, whether striking state appears through the change of judging earphone motion state, thereby realize the earphone and drop discernment, the earphone that has solved effectively because the earphone easily drops and leads to loses the problem, be convenient for the user in time look for the earphone that drops, user experience has further been improved.
As a preferred embodiment, the earphone loss prevention apparatus may further include:
the weightlessness status judging module is used for judging whether the earphone is in the weightlessness status according to the three-axis combined acceleration before calculating the peak value of the earphone according to the three-axis combined acceleration, and executing the step of calculating the peak value of the earphone according to the three-axis combined acceleration when the earphone is in the weightlessness status;
and the static state judgment module is used for judging whether the earphone is in a static state or not according to the three-axis combined acceleration after the earphone is impacted before the earphone is confirmed to be lost, and executing the step of confirming that the earphone is lost when the earphone is in the static state.
As a preferred embodiment, the weightlessness status determination module may be specifically configured to count a duration of the three-axis combined acceleration being smaller than a preset threshold; and when the duration exceeds the preset duration, determining that the earphone is in a weightless state.
As a preferred embodiment, the weightlessness status determination module may be specifically configured to count a first number of the three-axis combined acceleration smaller than a first threshold; and when the first quantity exceeds a first preset quantity, determining that the earphone is in a weightless state.
As a preferred embodiment, the static state determination module may be specifically configured to count a second number of three-axis combined accelerations of the earphone after the impact is smaller than a second threshold; and when the second number exceeds a second preset number, determining that the earphone is in a static state.
As a preferred embodiment, the impact state determining module 3 may be specifically configured to determine whether a maximum peak value within a first preset time after the earphone loses weight exceeds a first peak threshold; if the maximum wave peak value exceeds the first wave peak threshold value, taking the moment corresponding to the maximum wave peak value as the impact moment, and calculating the first wave peak average value in a second preset time length before the impact moment, the second wave peak average value in a third preset time length after the impact moment and the quantity of wave peaks; judging whether a first difference value between the maximum wave crest value and the first wave crest mean value exceeds a second wave crest threshold value, whether a second difference value between the maximum wave crest value and the second wave crest mean value exceeds a third wave crest threshold value, and whether the number of wave crests is lower than a preset number of wave crests; and if so, determining that the earphone is in the impact state.
As a preferred embodiment, the anti-loss device for an earphone may further include an alarm prompt module, configured to output an alarm prompt message to a user terminal connected to the earphone after confirming that the earphone is lost.
For the introduction of the apparatus provided in the present application, please refer to the above method embodiments, which are not described herein again.
To solve the above technical problem, the present application further provides an earphone, please refer to fig. 6, where fig. 6 is a schematic structural diagram of the earphone provided in the present application, and the earphone may include:
a memory 10 for storing a computer program;
the processor 20, when executing the computer program, may implement the steps of any of the above-mentioned methods for preventing loss of a headset.
For the introduction of the device provided in the present application, please refer to the above method embodiment, which is not described herein again.
To solve the above problem, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the above methods for preventing loss of a headset can be implemented.
The computer-readable storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
For the introduction of the computer-readable storage medium provided in the present application, please refer to the above method embodiments, which are not described herein again.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The technical solutions provided by the present application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall into the protection scope of the present application.