CN113507680A - Type-C earphone identification method and device, electronic equipment and storage medium - Google Patents

Type-C earphone identification method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113507680A
CN113507680A CN202110672007.8A CN202110672007A CN113507680A CN 113507680 A CN113507680 A CN 113507680A CN 202110672007 A CN202110672007 A CN 202110672007A CN 113507680 A CN113507680 A CN 113507680A
Authority
CN
China
Prior art keywords
detection
detection time
time
earphone
data interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110672007.8A
Other languages
Chinese (zh)
Other versions
CN113507680B (en
Inventor
夏华平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wingtech Communication Co Ltd
Original Assignee
Wingtech Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wingtech Communication Co Ltd filed Critical Wingtech Communication Co Ltd
Priority to CN202110672007.8A priority Critical patent/CN113507680B/en
Publication of CN113507680A publication Critical patent/CN113507680A/en
Application granted granted Critical
Publication of CN113507680B publication Critical patent/CN113507680B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R29/00Monitoring arrangements; Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04RLOUDSPEAKERS, MICROPHONES, GRAMOPHONE PICK-UPS OR LIKE ACOUSTIC ELECTROMECHANICAL TRANSDUCERS; DEAF-AID SETS; PUBLIC ADDRESS SYSTEMS
    • H04R1/00Details of transducers, loudspeakers or microphones
    • H04R1/10Earpieces; Attachments therefor ; Earphones; Monophonic headphones
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Otolaryngology (AREA)
  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Acoustics & Sound (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)
  • Headphones And Earphones (AREA)

Abstract

The disclosure relates to a Type-C earphone identification method, a device, an electronic device and a storage medium, wherein the earphone identification method comprises the following steps: acquiring first contact time when a first detection pin is contacted with a data interface and second contact time when a second detection pin is contacted with the data interface; calculating a contact time difference between the first contact time and the second contact time; when the contact time difference is larger than a first preset threshold value, performing first impedance detection; when the first impedance is executed and a first preset moment is detected, acquiring first detection time when a first detection pin detects a data interface and second detection time when a second detection pin detects the data interface; and determining the identification result of the terminal equipment to the earphone according to the detection time difference between the first detection time and the second detection time, so as to solve the problem of slow probability identification of the earphone.

Description

Type-C earphone identification method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of earphone recognition technologies, and in particular, to a Type-C earphone recognition method and apparatus, an electronic device, and a storage medium.
Background
Type-C earphones have been widely used in mobile phones, but existing Type-C earphones are slow to identify to earphones after being inserted into a terminal device, for example, after being inserted into 1 minute. After the earphone is inserted into the terminal device, the terminal device recognizes the earphone after 1 minute, which may affect the experience of the user, and within the 1 minute, the user may think that the earphone or the terminal device has a functional problem.
The specific process of earphone identification in the prior art is as follows: after the earphone is inserted, if the detection time difference between the first detection pin and the second detection pin on the earphone exceeds 175ms, it is considered that the Type-C interface of the mobile phone may be in risk of being soaked, in order to protect the Type-C interface of the mobile phone, the terminal device is generally controlled to perform impedance detection, and the impedance detection time is generally 60S. However, the mobile phone is not soaked, the detection time difference between the first detection pin and the second detection pin exceeds 175ms, for example, when the angle of the Type-C earphone is too large, the detection time difference between the first detection pin and the second detection pin exceeds 175ms, and when the angle of the Type-C earphone is too large, the detection time difference between the first detection pin and the second detection pin exceeds 175ms, the terminal device is also controlled to perform impedance detection, so that the earphone identification process is long, and the earphone identification efficiency of the terminal device is influenced.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, the present disclosure provides a Type-C headset identification method, apparatus, electronic device, and storage medium, which improve the efficiency of headset identification by a terminal device.
In a first aspect, an embodiment of the present disclosure provides a Type-C headset identification method, where the method is applied to a terminal device having a data interface, and the method includes:
acquiring first contact time when a first detection pin is contacted with the data interface and second contact time when a second detection pin is contacted with the data interface;
calculating a contact time difference between the first contact time and the second contact time;
when the contact time difference is larger than a first preset threshold value, executing first impedance detection;
when the first impedance is executed and a first preset moment is detected, acquiring first detection time when the first detection pin detects the data interface and second detection time when the second detection pin detects the data interface;
and determining the identification result of the terminal equipment to the earphone according to the detection time difference between the first detection time and the second detection time.
Optionally, the determining, according to the detection time difference between the first detection time and the second detection time, the identification result of the terminal device for the earphone includes:
when the detection time difference between the first detection time and the second detection time is smaller than or equal to a second preset threshold value, determining that the identification result of the terminal equipment to the earphone is an earphone identification;
and when the detection time difference between the first detection time and the second detection time is larger than a second preset threshold value, determining that the identification result of the terminal equipment to the earphone is an unidentified earphone.
Optionally, after the difference between the first detection time and the second detection time is greater than a second preset threshold, the method further includes:
performing a second impedance detection;
when the second impedance is executed and a second preset moment is detected, acquiring third detection time when the first detection pin detects the data interface and fourth detection time when the second detection pin detects the data interface;
and determining the identification result of the terminal equipment to the earphone according to the detection time difference between the third detection time and the fourth detection time.
Optionally, the determining, according to the time difference between the third detection time and the fourth detection time, the identification result of the terminal device for the earphone includes:
when the detection time difference between the third detection time and the fourth detection time is smaller than or equal to a second preset threshold value, determining that the identification result of the terminal equipment to the earphone is an identification earphone;
and when the detection time difference between the third detection time and the fourth detection time is greater than a second preset threshold value, determining that the identification result of the terminal equipment to the earphone is an unidentified earphone.
Optionally, the time for performing the second impedance detection is longer than the time for performing the first impedance detection.
Optionally, when the first impedance is executed to detect a first preset time, acquiring a first detection time when the first probe pin detects the data interface and a second detection time when the second probe pin detects the data interface, including:
triggering the terminal equipment to cut off the first impedance detection when the first impedance detection is carried out at a first preset moment;
and acquiring first detection time when the first detection pin detects the data interface and second detection time when the second detection pin detects the data interface.
Optionally, when the second impedance is executed to detect a second preset time, acquiring a third detection time when the first probe pin detects the data interface and a fourth detection time when the second probe pin detects the data interface includes:
when the second impedance detection is carried out, triggering the terminal equipment to cut off the second impedance detection at a second preset moment;
and acquiring third detection time when the first detection pin detects the data interface and fourth detection time when the second detection pin detects the data interface.
In a second aspect, an embodiment of the present disclosure further provides a Type-C earphone recognition device, including:
the contact time acquisition module is used for acquiring first contact time when the first detection pin is contacted with the data interface and second contact time when the second detection pin is contacted with the data interface;
a contact time difference calculation module for calculating a contact time difference between the first contact time and the second contact time;
the detection time acquisition module is used for acquiring first detection time when the first detection pin detects the data interface and second detection time when the second detection pin detects the data interface when the first impedance detects a first preset moment;
and the earphone identification result determining module is used for determining the identification result of the terminal equipment to the earphone according to the detection time difference between the first detection time and the second detection time.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a Type-C headset identification method as in any one of the first aspects.
In a fourth aspect, the disclosed embodiments also provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the Type-C headset identification method according to any one of the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
according to the Type-C earphone identification method, the device, the electronic equipment and the storage medium provided by the embodiment of the disclosure, by detecting that the time difference between the first contact time when the first detection pin contacts the data interface and the second contact time when the second detection pin contacts the data interface is larger than the first preset threshold value, the terminal equipment is triggered to execute the first impedance detection, when the detection time of the first impedance detection is detected to be larger than the second preset threshold value, the first detection time when the first detection pin detects the data interface and the second detection time when the second detection pin detects the data interface are obtained, the identification result of the terminal equipment to the earphone is determined according to the time difference between the first detection time and the second detection time, and when the problem that the probability terminal equipment cannot identify the inserted Type-C earphone due to the fact that the angle of the Type-C earphone is obliquely inserted is too large is avoided, the terminal equipment is directly controlled to enter the immersion treatment, so that the recognition efficiency of the earphone is influenced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a Type-C headset identification method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of another Type-C headset identification method provided in the embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another Type-C headset identification method provided in the embodiment of the present disclosure;
fig. 4 is a schematic flowchart of another Type-C headset identification method provided in the embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a Type-C earphone recognition device provided in an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
Fig. 1 is a schematic flow chart of a Type-C headset identification method provided in an embodiment of the present disclosure. The embodiment is applicable to terminal equipment with a data interface, and the earphone is identified when the terminal equipment receives the earphone insertion. The method of the embodiment can be executed by a Type-C headset identification device, which can be implemented in a hardware and/or software manner and can be configured in an electronic device. The Type-C earphone identification method can be achieved according to any embodiment of the application.
In the prior art, when the angle of the Type-C earphone obliquely inserted is too large, the detection time difference between the first detection pin and the second detection pin exceeds 175ms, at this time, the terminal device determines that the Type-C interface is in a risk of being soaked in water according to the obtained time difference between the detection time of the first detection pin and the detection time of the second detection pin, and then enters impedance detection, and the impedance detection time is 60S.
As shown in fig. 1, the Type-C headset identification method includes:
s110, acquiring first contact time when the first detection pin is contacted with the data interface and second contact time when the second detection pin is contacted with the data interface.
Specifically, first detection pin can be the first face of Type-C earphone and data interface contact, and the second is surveyed the pin and can be the second face of Type-C earphone and data interface contact, and when inserting Type-C earphone into terminal equipment's data interface, if when the angle of Type-C earphone male slope was too big, there can be first detection pin to contact the time of data interface and the time difference that the second was surveyed the pin and is contacted data interface. Illustratively, if the Type-C headset is plugged into a data interface of the terminal device, a first contact time when the first detection pin contacts the data interface and a second contact time when the second detection pin contacts the data interface are obtained.
And S120, calculating the contact time difference between the first contact time and the second contact time.
And calculating a contact time difference between the first contact time and the second contact time according to the acquired first contact time when the first detection pin is in contact with the data interface and the acquired second contact time when the second detection pin is in contact with the data interface. Illustratively, when it is detected that the first contact time when the first probe pin contacts the data interface is t1, the second contact time when the second probe pin contacts the data interface is t2, and t1 and t2 are different, the contact time difference between the first contact time and the second contact time is | t1-t2 |.
And S130, when the contact time difference is larger than a first preset threshold value, executing first impedance detection.
Specifically, the relationship between the difference value between the first contact time t1 and the second contact time t2 and the first preset threshold is judged, so that the terminal device is triggered to execute the subsequent steps. If the difference between the first contact time t1 and the second contact time t2 is greater than the first preset threshold, there may be a reason that the data interface of the terminal device is soaked or a probabilistic terminal device cannot identify the inserted Type-C headset due to an excessively large angle of the Type-C headset oblique insertion. If direct control terminal equipment gets into the detection of soaking, and the time that detects that soaks is 60S, consequently in 60S time, the user can be continuous pulls out and inserts the earphone and carry out the inspection of earphone and terminal equipment, and in 60S time, even if not because the unable problem of discerning of earphone that terminal equipment ' S data interface soaks the appearance, also can't withdraw from the detection of soaking in time, consequently, when too big the condition that probabilistic terminal equipment can't discern the inserted Type-C earphone because of the angle that the user inserted Type-C earphone to one side, the time that detects that soaks can the discernment efficiency of terminal equipment to the earphone.
Therefore, according to the Type-C earphone recognition method provided by the embodiment of the present disclosure, the time difference between the first contact time when the first detection pin is detected to contact the data interface and the second contact time when the second detection pin is detected to contact the data interface is greater than the first preset threshold value, the terminal device is triggered to execute the first impedance detection, that is, the terminal device is not directly contacted to execute the submerging detection, and by reducing the time of the first impedance detection, if the problem that the earphone cannot be recognized is found not to occur because the data interface of the terminal device is submerged, the first impedance detection is timely exited, thereby avoiding the terminal device from entering the submerging detection and further influencing the recognition efficiency of the terminal device on the earphone.
S140, when the first impedance is executed and the first preset moment is detected, first detection time when the first detection pin detects the data interface and second detection time when the second detection pin detects the data interface are obtained.
Specifically, after the terminal device is triggered to execute the first impedance detection, when the first impedance detection is executed and a first preset time is detected, a first detection time when the first detection pin detects the data interface and a second detection time when the second detection pin detects the data interface are obtained, and at this time, the time for executing the first impedance detection is shorter than the time for detecting the flooding. For example, the time for executing the first impedance detection is 3S, when the first impedance detection is executed at a first preset time, that is, the 3 rd time, the loop for the first impedance detection is cut off, and the first detection time when the first probe pin detects the data interface and the second detection time when the second probe pin detects the data interface are obtained again, at this time, the first detection time corresponds to the time when the first probe pin contacts the data interface when the Type-C earphone is inserted into the data interface in the flat state, and the second detection time corresponds to the time when the second probe pin contacts the data interface when the Type-C earphone is inserted into the data interface in the flat state.
Furthermore, when the first impedance detection is performed at the first preset moment, the terminal device is triggered to switch off the first impedance detection, that is, after the detection time of the first impedance detection meets the time of 3S, the terminal device is triggered to switch off the first impedance detection.
S150, determining the identification result of the terminal equipment to the earphone according to the time difference between the first detection time and the second detection time.
After the first detection time and the second detection time are obtained, determining the identification result of the terminal equipment to the earphone according to the time difference between the first detection time and the second detection time. Specifically, when the time difference between the first detection time and the second detection time is smaller than or equal to a first preset threshold, determining that the identification result of the terminal device to the earphone is an identified earphone, and when the time difference between the first detection time and the second detection time is larger than the first preset threshold, determining that the identification result of the terminal device to the earphone is an unidentified earphone. That is, when the problem that the probabilistic terminal device cannot recognize the inserted Type-C earphone due to the fact that the angle of the Type-C earphone is inserted obliquely is too large, the terminal device is first controlled to enter the first impedance detection, after the first impedance detection is completed, the Type-C earphone is inserted into the data interface in the flat state, the first detection time and the second detection time when the Type-C earphone is inserted into the data interface in the flat state are obtained, and if the detection time difference between the first detection time and the second detection time is less than or equal to the second preset threshold, it can be determined that the problem that the probabilistic terminal device cannot recognize the inserted Type-C earphone occurs due to the fact that the angle of the Type-C earphone is inserted obliquely is too large in step S130, when the Type-C earphone is inserted into the data interface in a straight state, the terminal equipment identifies the earphone, and the earphone can be normally identified within 4 seconds. If the difference between the first detection time and the second detection time is greater than the second preset threshold, it may be determined that the fact that the difference between the first contact time when the first detection pin contacts the data interface and the second contact time when the second detection pin contacts the data interface is greater than the first preset threshold in step S130 is that the earphone cannot be identified due to the data interface of the terminal device being immersed in water, and therefore the terminal device does not identify the earphone.
The Type-C earphone identification method provided by the embodiment of the disclosure triggers the terminal device to execute the first impedance detection by detecting that the contact time difference between the first contact time when the first detection pin contacts the data interface and the second contact time when the second detection pin contacts the data interface is greater than the first preset threshold value, when the first impedance is executed to detect a first preset moment, acquiring first detection time when a first detection pin detects the data interface and second detection time when a second detection pin detects the data interface, according to the detection time difference between the first detection time and the second detection time, the identification result of the terminal device to the earphone is determined, and the problem that the probability terminal device cannot identify the inserted Type-C earphone due to the fact that the Type-C earphone is inserted obliquely at an overlarge angle is avoided, and the terminal device is directly controlled to enter soaking treatment so that the identification efficiency of the earphone is influenced.
Fig. 2 is a schematic flow chart of another Type-C earphone identification method provided in the embodiment of the present disclosure, where the embodiment is based on the foregoing embodiment, one implementation manner of S150 is as follows, and includes:
s151, determining a relationship between a detection time difference between the first detection time and the second detection time and a second preset threshold, if the detection time difference between the first detection time and the second detection time is less than or equal to the second preset threshold, executing step S152, and if the detection time difference between the first detection time and the second detection time is greater than the second preset threshold, executing step S153.
S152, determining that the identification result of the terminal equipment to the earphone is the identification earphone.
S153, determining that the identification result of the terminal device to the earphone is an unidentified earphone.
Specifically, as shown in fig. 2, after the first detection time and the second detection time are obtained, a relationship between a detection time difference between the first detection time and the second detection time and a second preset threshold is determined, when the detection time difference between the first detection time and the second detection time is less than or equal to the second preset threshold, it is determined that the identification result of the terminal device to the earphone is an identified earphone, and when the detection time difference between the first detection time and the second detection time is greater than the second preset threshold, it is determined that the identification result of the terminal device to the earphone is an unidentified earphone. That is, when the problem that the probabilistic terminal device cannot recognize the inserted Type-C earphone due to the fact that the angle of the Type-C earphone is inserted obliquely is too large, the terminal device is first controlled to enter the first impedance detection, after the first impedance detection is completed, the Type-C earphone is inserted into the data interface in the flat state, the first detection time and the second detection time when the Type-C earphone is inserted into the data interface in the flat state are obtained, and if the detection time difference between the first detection time and the second detection time is less than or equal to the second preset threshold, it can be determined that the problem that the probabilistic terminal device cannot recognize the inserted Type-C earphone occurs due to the fact that the angle of the Type-C earphone is inserted obliquely is too large in step S130, when the Type-C earphone is inserted into the data interface in a straight state, the terminal equipment identifies the earphone, and the earphone can be normally identified within 4 seconds. If the difference between the first detection time and the second detection time is greater than the first preset threshold, it may be determined that the fact that the difference between the first contact time when the first detection pin contacts the data interface and the second contact time when the second detection pin contacts the data interface is greater than the first preset threshold in step S130 is that the earphone cannot be identified due to the data interface of the terminal device being immersed in water, and therefore the terminal device does not identify the earphone.
The Type-C earphone identification method provided by the embodiment of the disclosure determines whether the terminal equipment identifies the state of the earphone or not by judging the relationship between the detection time difference between the first detection time and the second preset threshold, when the detection time difference between the first detection time and the second detection time is smaller than or equal to the second preset threshold, the terminal equipment identifies the earphone, when the detection time difference between the first detection time and the second detection time is larger than the second preset threshold, the terminal equipment does not identify the earphone, and when the probability terminal equipment cannot identify the inserted Type-C earphone due to the fact that the angle of the Type-C earphone is too large, the earphone is identified within 4S when the detection time difference between the first detection time and the second detection time is smaller than or equal to the second preset threshold.
Fig. 3 is a schematic flowchart of another Type-C earphone identification method provided in an embodiment of the present disclosure, where in the embodiment of fig. 2, when a detection time difference between the first detection time and the second detection time in step S151 is greater than a second preset threshold, step S151 further includes:
and S1511, executing second impedance detection.
Since the reason that the contact time difference between the first contact time and the second contact time is greater than the first preset threshold in step S130 may be that the data interface of the terminal device is immersed, or that the inserted Type-C earphone cannot be identified by the probabilistic terminal device due to an excessively large angle at which the user inserts the Type-C earphone obliquely. If the reason why the difference between the first contact time and the second contact time is greater than the first preset threshold is that the probability that the terminal device cannot recognize the inserted Type-C earphone due to the fact that the angle of the Type-C earphone is inserted by the user is too large, in step S150, the difference between the first detection time and the second detection time is necessarily less than or equal to the second preset threshold. And when the reason that the detection time difference between the first contact time and the second contact time is greater than the second preset threshold is that the terminal device cannot identify the inserted Type-C headset due to the fact that the data interface of the terminal device is immersed in water, in step S150, the detection time difference between the first detection time and the second detection time is certainly greater than the second preset threshold, and in order to avoid the influence of the data interface of the terminal device being immersed in water on the data line of the terminal device, in step S150, after the detection time difference between the first detection time and the second detection time is obtained to be greater than the second preset threshold, the terminal device is triggered to execute second impedance detection, and at this time, the immersion detection of the terminal device corresponding to the second impedance detection is performed.
S1512, when the second impedance is executed and the second preset time is detected, obtaining a third detection time when the first probe pin detects the data interface and a fourth detection time when the second probe pin detects the data interface.
Specifically, the second preset time corresponds to a third detection time when the first detection pin detects the data interface and a fourth detection time when the second detection pin detects the data interface after the second impedance is executed to detect the second preset time. The time at which the second impedance detection is performed corresponds to the time of the submergence detection, which is 60S, and thus, the time of the second impedance detection is 60S. And when the second impedance detection is performed at a second preset moment, namely after 60S second impedance detection is performed, acquiring third detection time when the first detection pin detects the data interface and fourth detection time when the second detection pin detects the data interface. After the data interface of the terminal equipment has the problem of water immersion, when the Type-C interface is inserted into the data interface, the water immersion problem of the data interface can influence the third detection time when the first detection pin detects the data interface and the fourth detection time when the second detection pin detects the data interface.
Optionally, when the second impedance detection is performed at the second preset time, the terminal device is triggered to cut off the second impedance detection.
And acquiring third detection time when the first detection pin detects the data interface and fourth detection time when the second detection pin detects the data interface.
And when the second impedance is executed to detect a second preset moment, triggering the terminal equipment to cut off the second impedance detection, namely closing the terminal equipment to carry out the second impedance detection, so that the terminal equipment enters a third detection time when the first detection pin detection data interface is obtained and a fourth detection time when the second detection pin detection data interface is obtained.
And S1513, determining the identification result of the terminal device to the earphone according to the detection time difference between the third detection time and the fourth detection time.
And after the third detection time and the fourth detection time are obtained, determining the identification result of the terminal equipment to the earphone according to the detection time difference between the third detection time and the fourth detection time. Specifically, when the detection time difference between the third detection time and the fourth detection time is smaller than or equal to a second preset threshold, it is determined that the identification result of the terminal device to the earphone is an identified earphone, and when the detection time difference between the third detection time and the fourth detection time is larger than the second preset threshold, it is determined that the identification result of the terminal device to the earphone is an unidentified earphone. That is, when the problem that the probabilistic terminal device cannot recognize the inserted Type-C earphone due to the fact that the angle of the Type-C earphone is inserted obliquely is too large, the terminal device is first controlled to enter the first impedance detection, after the first impedance detection is completed, the Type-C earphone is inserted into the data interface in the flat state, the first detection time and the second detection time when the Type-C earphone is inserted into the data interface in the flat state are obtained, and if the detection time difference between the first detection time and the second detection time is less than or equal to the second preset threshold, it can be determined that the problem that the probabilistic terminal device cannot recognize the inserted Type-C earphone occurs due to the fact that the angle of the Type-C earphone is inserted obliquely is too large in step S130, when the Type-C earphone is inserted into the data interface in a straight state, the terminal equipment identifies the earphone, and the earphone can be normally identified within 4 seconds. If the difference between the first detection time and the second detection time is greater than the first preset threshold, it may be determined that the fact that the difference between the first contact time when the first probe pin contacts the data interface and the second contact time when the second probe pin contacts the data interface in step S130 is greater than the first preset threshold is that the earphone cannot be identified due to the data interface of the terminal device being immersed in water, therefore, the terminal device is controlled to enter the second impedance detection, i.e. flooding detection, and after performing the second impedance detection for a second predetermined time, i.e. after the terminal device has completed the flooding detection, acquiring third detection time when the first detection pin detects the data interface and fourth detection time when the second detection pin detects the data interface, and determining the identification result of the terminal equipment to the earphone according to the detection time difference between the third detection time and the fourth detection time.
According to the Type-C earphone identification method provided by the embodiment of the disclosure, after the detection time difference between the first detection time and the second detection time is larger than the first preset threshold value, the terminal device is controlled to enter the second impedance detection, namely, the immersion detection, so that on one hand, the situation that the identification result of the earphone is influenced due to the fact that the data interface of the terminal device is immersed in water can be avoided, and on the other hand, the situation that the main control circuit of the terminal device is short-circuited due to the fact that the earphone and the main control circuit of the terminal device form a loop after the data interface of the terminal device is accessed in water is avoided. .
Fig. 4 is a schematic flowchart of another Type-C earphone identification method provided in an embodiment of the present disclosure, where the present embodiment is based on fig. 3 in the foregoing embodiment, where an implementation manner of S1513 is as follows, and includes:
s15131, determining a relationship between a detection time difference between the third detection time and the fourth detection time and a second preset threshold, if the detection time difference between the third detection time and the fourth detection time is less than or equal to the second preset threshold, executing step S152, and if the detection time difference between the third detection time and the fourth detection time is greater than the second preset threshold, executing step S153.
S152, determining that the identification result of the terminal equipment to the earphone is the identification earphone.
S153, determining that the identification result of the terminal device to the earphone is an unidentified earphone.
Specifically, determining the identification result of the terminal device to the earphone according to the detection time difference between the third detection time and the fourth detection time includes: when the detection time difference between the third detection time and the fourth detection time is smaller than or equal to a second preset threshold, determining that the identification result of the terminal device to the earphone is an identified earphone, and if the detection time difference between the third detection time and the fourth detection time is larger than the second preset threshold, determining that the identification result of the terminal device to the earphone is an unidentified earphone, namely after the second impedance detection is performed on the terminal device, if the acquired time difference between the third detection time and the fourth detection time is smaller than or equal to the second preset threshold, namely, the data interface of the terminal device does not have the problem of water immersion at the moment, identifying the earphone, and if the acquired time difference between the third detection time and the fourth detection time is larger than the second preset threshold, namely, the data interface of the terminal device does not have the problem of water immersion at the moment, and the terminal device is not triggered to identify the earphone.
The Type-C earphone identification method provided by the embodiment of the disclosure triggers second impedance detection, namely immersion detection, when the detection time difference between the first detection time and the second detection time is greater than a second preset threshold, obtains a third detection time and a fourth detection time after the immersion detection, determines the identification result of the terminal device on the earphone according to the relation between the detection time difference between the third detection time and the fourth detection time and the second preset threshold, and avoids the influence on the earphone identification result due to the immersion of the data interface of the terminal device.
It should be noted that, in the foregoing embodiment, in the process of determining the identification result of the terminal device for the earphone, in the process of determining that the identification result of the terminal device for the earphone is the identification result of the earphone, the connection between the terminal device and the earphone is implemented by triggering an interrupt loop, that is, interrupting a detection loop when the earphone is inserted into the data interface. And in the process of determining that the identification result of the terminal equipment to the earphone is that the earphone is not identified, triggering no interruption loop, namely, not interrupting the detection loop when the earphone is inserted into the data interface, wherein the terminal equipment and the earphone cannot be connected at the moment.
Fig. 5 is a schematic structural diagram of a Type-C earphone recognition device provided in an embodiment of the present disclosure, and as shown in fig. 5, the Type-C earphone recognition device includes:
a contact time obtaining module 510, configured to obtain a first contact time when the first probe pin contacts the data interface and a second contact time when the second probe pin contacts the data interface;
a contact time difference calculation module 520 for calculating a contact time difference between the first contact time and the second contact time;
a detection time obtaining module 530, configured to obtain a first detection time when the first probe pin detects the data interface and a second detection time when the second probe pin detects the data interface when the first impedance is executed to detect the first preset time;
and the earphone identification result determining module 540 is configured to determine an identification result of the terminal device for the earphone according to a detection time difference between the first detection time and the second detection time.
In the Type-C earphone recognition apparatus provided by the embodiment of the disclosure, the contact time acquiring module acquires a first contact time when the first probe pin contacts the data interface and a second contact time when the second probe pin contacts the data interface, the contact time difference calculating module calculates a contact time difference between the first contact time and the second contact time, the detection time acquiring module acquires a first detection time when the first probe pin detects the data interface and a second detection time when the second probe pin detects the data interface when the first impedance detection is performed at a first preset time, the earphone recognition result determining module determines the recognition result of the terminal device for the earphone according to the detection time difference between the first detection time and the second detection time, and avoids the problem that the probabilistic terminal device cannot recognize the inserted Type-C earphone due to an excessively large angle of oblique insertion of the Type-C earphone, the terminal equipment is directly controlled to enter the immersion treatment, so that the recognition efficiency of the earphone is influenced.
The Type-C earphone recognition device provided by the embodiment of the invention can execute the Type-C earphone recognition method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure, as shown in fig. 6, the electronic device includes a processor 610, a memory 620, an input device 630, and an output device 640; the number of the processors 610 in the electronic device may be one or more, and one processor 610 is taken as an example in fig. 6; the processor 610, the memory 620, the input device 630, and the output device 640 in the electronic apparatus may be connected by a bus or other means, and fig. 6 illustrates an example of connection by a bus.
The memory 620, which is a computer-readable storage medium, may be used to store software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the Type-C headset identification method in the embodiments of the present invention. The processor 610 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the memory 620, that is, implements the Type-C headset identification method provided by the embodiment of the present invention.
The memory 620 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 620 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 620 can further include memory located remotely from the processor 610, which can be connected to an electronic device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 630 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device, and may include a keyboard, a mouse, and the like. The output device 640 may include a display device such as a display screen.
The embodiment of the disclosure also provides a storage medium containing computer executable instructions, and the computer executable instructions are used for realizing the Type-C earphone identification method provided by the embodiment of the invention when being executed by a computer processor.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in the Type-C headset identification method provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the identification apparatus, the included units and modules are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A Type-C earphone identification method is applied to a terminal device with a data interface, and comprises the following steps:
acquiring first contact time when a first detection pin is contacted with the data interface and second contact time when a second detection pin is contacted with the data interface;
calculating a contact time difference between the first contact time and the second contact time;
when the contact time difference is larger than a first preset threshold value, executing first impedance detection;
when the first impedance is executed and a first preset moment is detected, acquiring first detection time when the first detection pin detects the data interface and second detection time when the second detection pin detects the data interface;
and determining the identification result of the terminal equipment to the earphone according to the detection time difference between the first detection time and the second detection time.
2. The method according to claim 1, wherein the determining the identification result of the headset by the terminal device according to the detection time difference between the first detection time and the second detection time comprises:
when the detection time difference between the first detection time and the second detection time is smaller than or equal to a second preset threshold value, determining that the identification result of the terminal equipment to the earphone is an earphone identification;
and when the detection time difference between the first detection time and the second detection time is larger than a second preset threshold value, determining that the identification result of the terminal equipment to the earphone is an unidentified earphone.
3. The method according to claim 2, wherein after the difference between the first detection time and the second detection time is greater than a second preset threshold, further comprising:
performing a second impedance detection;
when the second impedance is executed and a second preset moment is detected, acquiring third detection time when the first detection pin detects the data interface and fourth detection time when the second detection pin detects the data interface;
and determining the identification result of the terminal equipment to the earphone according to the detection time difference between the third detection time and the fourth detection time.
4. The method according to claim 3, wherein the determining the identification result of the headset by the terminal device according to the time difference between the third detection time and the fourth detection time comprises:
when the detection time difference between the third detection time and the fourth detection time is smaller than or equal to a second preset threshold value, determining that the identification result of the terminal equipment to the earphone is an identification earphone;
and when the detection time difference between the third detection time and the fourth detection time is greater than a second preset threshold value, determining that the identification result of the terminal equipment to the earphone is an unidentified earphone.
5. The method of claim 3, wherein the second impedance test is performed for a time greater than the time for performing the first impedance test.
6. The method of claim 1, wherein obtaining a first detection time when the first probe pin detects the data interface and a second detection time when the second probe pin detects the data interface when the first impedance is detected by the first preset time comprises:
triggering the terminal equipment to cut off the first impedance detection when the first impedance detection is carried out at a first preset moment;
and acquiring first detection time when the first detection pin detects the data interface and second detection time when the second detection pin detects the data interface.
7. The method according to claim 3, wherein the obtaining a third detection time when the first probe pin detects the data interface and a fourth detection time when the second probe pin detects the data interface when the second impedance is detected comprises:
when the second impedance detection is carried out, triggering the terminal equipment to cut off the second impedance detection at a second preset moment;
and acquiring third detection time when the first detection pin detects the data interface and fourth detection time when the second detection pin detects the data interface.
8. The utility model provides a Type-C earphone recognition device which characterized in that includes:
the contact time acquisition module is used for acquiring first contact time when the first detection pin is contacted with the data interface and second contact time when the second detection pin is contacted with the data interface;
a contact time difference calculation module for calculating a contact time difference between the first contact time and the second contact time;
the detection time acquisition module is used for acquiring first detection time when the first detection pin detects the data interface and second detection time when the second detection pin detects the data interface when the first impedance is executed and a first preset moment is detected;
and the earphone identification result determining module is used for determining the identification result of the terminal equipment to the earphone according to the detection time difference between the first detection time and the second detection time.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the Type-C headset identification method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the Type-C headset identification method according to any one of claims 1 to 7.
CN202110672007.8A 2021-06-17 2021-06-17 Type-C earphone identification method and device, electronic equipment and storage medium Active CN113507680B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110672007.8A CN113507680B (en) 2021-06-17 2021-06-17 Type-C earphone identification method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110672007.8A CN113507680B (en) 2021-06-17 2021-06-17 Type-C earphone identification method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113507680A true CN113507680A (en) 2021-10-15
CN113507680B CN113507680B (en) 2023-05-16

Family

ID=78010062

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110672007.8A Active CN113507680B (en) 2021-06-17 2021-06-17 Type-C earphone identification method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113507680B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010177773A (en) * 2009-01-27 2010-08-12 Kyocera Corp Electronic device, and earphone detection method
US20120051562A1 (en) * 2010-08-26 2012-03-01 Samsung Electronics Co. Ltd. Method and apparatus for recognizing accessory of portable terminal
CN105353858A (en) * 2015-10-29 2016-02-24 广东未来之星网络科技股份有限公司 Repeatable-triggered forced shutdown anti-addiction intelligent power control method
US20160286297A1 (en) * 2014-08-28 2016-09-29 Huizhou Tcl Mobile Communication Co., Ltd Earphone and mobile terminal for ecg detection
CN107295140A (en) * 2017-06-27 2017-10-24 努比亚技术有限公司 A kind of detection method of earphone, device and terminal
CN108063994A (en) * 2017-12-21 2018-05-22 Tcl移动通信科技(宁波)有限公司 Mobile terminal and headset detection control method, storage medium and earphone
US20180329675A1 (en) * 2017-05-10 2018-11-15 Samsung Electronics Co., Ltd. Electronic device and method for controlling audio output according to the type of earphone
CN110320240A (en) * 2018-03-28 2019-10-11 三星电子株式会社 Water detection circuit and electronic device including it
CN111200767A (en) * 2018-11-20 2020-05-26 成都鼎桥通信技术有限公司 Earphone detection method, earphone detection device, terminal and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010177773A (en) * 2009-01-27 2010-08-12 Kyocera Corp Electronic device, and earphone detection method
US20120051562A1 (en) * 2010-08-26 2012-03-01 Samsung Electronics Co. Ltd. Method and apparatus for recognizing accessory of portable terminal
US20160286297A1 (en) * 2014-08-28 2016-09-29 Huizhou Tcl Mobile Communication Co., Ltd Earphone and mobile terminal for ecg detection
CN105353858A (en) * 2015-10-29 2016-02-24 广东未来之星网络科技股份有限公司 Repeatable-triggered forced shutdown anti-addiction intelligent power control method
US20180329675A1 (en) * 2017-05-10 2018-11-15 Samsung Electronics Co., Ltd. Electronic device and method for controlling audio output according to the type of earphone
CN107295140A (en) * 2017-06-27 2017-10-24 努比亚技术有限公司 A kind of detection method of earphone, device and terminal
CN108063994A (en) * 2017-12-21 2018-05-22 Tcl移动通信科技(宁波)有限公司 Mobile terminal and headset detection control method, storage medium and earphone
CN110320240A (en) * 2018-03-28 2019-10-11 三星电子株式会社 Water detection circuit and electronic device including it
CN111200767A (en) * 2018-11-20 2020-05-26 成都鼎桥通信技术有限公司 Earphone detection method, earphone detection device, terminal and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LEO LIU: "支持多按键线控耳机的音频插孔检测方案", 《世界电子元器件》 *

Also Published As

Publication number Publication date
CN113507680B (en) 2023-05-16

Similar Documents

Publication Publication Date Title
CN106507445B (en) Wireless fidelity Wi-Fi scanning method and mobile terminal
CN107861830A (en) Detection method, device, storage medium and the mobile terminal of application crash
CN107483737B (en) Antenna switching method and mobile terminal
CN110875059B (en) Method and device for judging reception end and storage device
CN107797841A (en) Window control method, apparatus, terminal device and storage medium
CN107748685A (en) Application program launching control method, device, terminal device and storage medium
CN110097884B (en) Voice interaction method and device
CN111273769B (en) Equipment control method and device, electronic equipment and storage medium
CN112634894A (en) Awakening method, awakening device and terminal
CN110766074B (en) Method and device for testing identification qualification of abnormal grains in biological identification method
CN113507680B (en) Type-C earphone identification method and device, electronic equipment and storage medium
CN111200767B (en) Earphone detection method, earphone detection device, terminal and storage medium
CN110888799B (en) Software testing method and device
CN110955894B (en) Malicious content detection method and device, electronic equipment and readable storage medium
CN111327760B (en) Control method and device for false touch prevention mode, mobile terminal and storage medium
CN111748964A (en) Equipment control method, device and computer storage medium
CN113129902B (en) Voice processing method and device, electronic equipment and storage medium
CN114465681A (en) Multi-node cooperative spectrum sensing method and device for power Internet of things
CN116416992A (en) Monitoring method, monitoring device, device and electronic device of communication device
CN107220093B (en) Process processing method and device
CN115148199A (en) Voice false wake-up processing method and electronic equipment
CN112637139A (en) Voice transmission processing method and device based on Internet of things and computer equipment
CN108388797B (en) Intrusion detection method and device and electronic equipment
CN112634891A (en) Identification code response method and device, vehicle-mounted terminal and storage medium
CN114338089B (en) Anti-attack method, device, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant