Nothing Special   »   [go: up one dir, main page]

CN113507680B - 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
CN113507680B
CN113507680B CN202110672007.8A CN202110672007A CN113507680B CN 113507680 B CN113507680 B CN 113507680B CN 202110672007 A CN202110672007 A CN 202110672007A CN 113507680 B CN113507680 B CN 113507680B
Authority
CN
China
Prior art keywords
detection
time
earphone
detection time
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.)
Active
Application number
CN202110672007.8A
Other languages
Chinese (zh)
Other versions
CN113507680A (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, electronic equipment and a storage medium, wherein the earphone identification method comprises the following steps: acquiring 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; calculating a contact time difference between a 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 the first preset moment is detected, acquiring 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; and determining the recognition result of the terminal equipment on the earphone according to the detection time difference between the first detection time and the second detection time, and improving the problem of slow probabilistic recognition of the earphone.

Description

Type-C earphone identification method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of earphone identification, in particular to a Type-C earphone identification method, a device, electronic equipment and a storage medium.
Background
Type-C headphones are widely used in mobile phones, but the conventional Type-C headphones are slower to recognize after being inserted into terminal equipment, for example, the headphones can be recognized after being inserted into 1 minute. When the earphone is inserted into the terminal device, the terminal device recognizes the earphone after 1 minute, which affects the experience of the user, and the user considers that the earphone or the terminal device has a functional problem within 1 minute.
The specific process for identifying the earphone 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, the Type-C interface of the mobile phone is considered to be possibly at risk of soaking, 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 phenomenon that the detection time difference between the first detection pin and the second detection pin exceeds 175ms occurs when the mobile phone is not immersed in water, for example, when the angle of oblique insertion 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 oblique insertion 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 equipment is controlled to perform impedance detection, so that the earphone recognition process is longer, and the efficiency of the terminal equipment on earphone recognition is affected.
Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, the disclosure provides a Type-C earphone identification method, a device, an electronic device and a storage medium, which improve the efficiency of terminal equipment in earphone identification.
In a first aspect, an embodiment of the present disclosure provides a Type-C earphone identification method, where the method is applied to a terminal device having a data interface, and the method includes:
acquiring a first contact time when a first detection pin contacts the data interface and a second contact time when a second detection pin contacts 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, 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 determining the recognition result of the terminal equipment on 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 recognition result of the terminal device on the earphone includes:
determining that the recognition result of the terminal equipment on the earphone is recognition earphone 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;
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 recognition result of the terminal equipment on the earphone is an unidentified earphone.
Optionally, after the detection time 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 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;
and determining the recognition result of the terminal equipment on 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 recognition result of the terminal device on 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 recognition result of the terminal equipment on the earphone is recognition earphone;
and when the detection time difference between the third detection time and the fourth detection time is larger than a second preset threshold value, determining that the recognition result of the terminal equipment on the earphone is an unidentified earphone.
Optionally, the second impedance detection is performed for a time greater than the time for which the first impedance detection is performed.
Optionally, when the first impedance detects 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 includes:
triggering the terminal equipment to cut off the first impedance detection when the first impedance detection is executed to a first preset moment;
and acquiring 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.
Optionally, when the second impedance detects the 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:
triggering the terminal equipment to cut off the second impedance detection when the second impedance detection is executed to a second preset moment;
and acquiring 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.
In a second aspect, an embodiment of the present disclosure further provides a Type-C earphone identification device, including:
the contact time acquisition module is used for acquiring 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;
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 a first detection time when the first impedance detects the data interface and a second detection time when the second detection pin detects the data interface when the first detection pin detects the first preset time;
And the earphone identification result determining module is used for determining the identification result of the terminal equipment on the earphone according to the detection time difference between the first detection time and the second detection time.
In a third aspect, embodiments of the present disclosure further provide an electronic device, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the Type-C earpiece identification method of any of the first aspects.
In a fourth aspect, an embodiment of the present disclosure further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the Type-C earpiece identification method of any one of the first aspects.
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, device, electronic equipment and storage medium, through 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, triggering the terminal equipment to execute first impedance detection, when the detection time of the first impedance detection is larger than the second preset threshold value, acquiring 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, determining the earphone identification result of the terminal equipment according to the time difference of the first detection time and the second detection time, and avoiding that the probability terminal equipment cannot identify the inserted Type-C earphone due to overlarge angle of the Type-C earphone.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic flow chart of a Type-C earphone identification method provided in an embodiment of the present disclosure;
fig. 2 is a flow chart of another Type-C earphone identification method provided in an embodiment of the present disclosure;
fig. 3 is a flowchart of another Type-C earphone identification method according to an embodiment of the present disclosure;
fig. 4 is a flowchart of another Type-C earphone identification method provided in an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a Type-C earphone recognition device according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to 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, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
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 otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
Fig. 1 is a schematic flow chart of a Type-C earphone identification method provided in an embodiment of the present disclosure. The embodiment can be applied to a terminal device with a data interface, and the earphone is identified under the condition that the terminal device receives the earphone insertion. The method of the embodiment can be executed by a Type-C earphone identification device, and the device can be realized in a hardware/software mode and can be configured in electronic equipment. The Type-C earphone identification method can be realized.
In the prior art, when the angle of oblique insertion of the Type-C earphone 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 at risk of soaking according to the acquired time difference between the detection time of the first detection pin and the detection time of the second detection pin, and then the impedance detection is performed, and the impedance detection time is 60S, so that in the impedance detection time period, a user can consider that the earphone or the terminal device has a functional problem, and therefore the action of pulling and inserting the earphone can be performed, multiple tests are performed to determine whether the terminal device can identify the earphone, and the recognition efficiency of the earphone is reduced when the angle of oblique insertion of the earphone is too large.
As shown in fig. 1, the Type-C earphone identification method includes:
s110, acquiring 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.
Specifically, the first detection pin may be a first surface of the Type-C earphone in contact with the data interface, the second detection pin may be a second surface of the Type-C earphone in contact with the data interface, and when the Type-C earphone is inserted into the data interface of the terminal device, if the angle of the inclination of the Type-C earphone inserted is too large, the time that the first detection pin contacts the data interface is different from the time that the second detection pin contacts the data interface. For example, if the Type-C earphone is inserted into the data interface of the terminal device, 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 are obtained.
S120, calculating a contact time difference between the first contact time and the second contact time.
And when 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 are obtained, calculating the contact time difference between the first contact time and the second contact time according to the obtained first contact time when the first detection pin contacts the data interface and the obtained second contact time when the second detection pin contacts the data interface. For example, when the first contact time when the first probe pin contacts the data interface is detected to be t1, the second contact time when the second probe pin contacts the data interface is detected to be 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, by judging the relationship between the difference between the first contact time t1 and the second contact time t2 and the first preset threshold value, 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, the possible reason is that the data interface of the terminal device is immersed in water or the probability that the inserted Type-C earphone cannot be identified by the probabilistic terminal device due to the overlarge oblique insertion angle of the Type-C earphone. If the terminal equipment is directly controlled to enter the soaking detection, and the time of the soaking detection is 60S, so that in the 60S time, a user can continuously insert and pull out the earphone to check the earphone and the terminal equipment, and in the 60S time, even if the earphone cannot be identified due to the fact that the data interface of the terminal equipment is soaked, the soaking detection cannot be timely withdrawn, and therefore, when the situation that the probability that the terminal equipment cannot identify the inserted Type-C earphone due to the fact that the angle of the inclined inserting Type-C earphone is too large occurs, the time of the soaking detection can reduce the identification efficiency of the terminal equipment to the earphone.
Therefore, according to the Type-C earphone identification method 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 greater than the first preset threshold value, triggering the terminal equipment to execute the first impedance detection, namely not directly triggering the terminal equipment to execute the immersion detection, and by reducing the time of the first impedance detection, if the problem that the earphone cannot be identified due to the immersion of the data interface of the terminal equipment is found, the first impedance detection is withdrawn in time, so that the terminal equipment is prevented from entering the immersion detection and further the identification efficiency of the terminal equipment to the earphone is prevented from being influenced.
And S140, when the first impedance is executed and the first preset moment is detected, acquiring 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.
Specifically, after the terminal device is triggered to execute the first impedance detection, when the first impedance is executed to detect a first preset moment, 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 smaller than the time for soaking detection. 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, at the 3 rd S, the loop of the first impedance detection is cut off, and 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 acquired again, where the first detection time corresponds to the time when the Type-C earphone is inserted into the data interface in a flat state and the first detection pin is in contact with the data interface, and the second detection time corresponds to the time when the Type-C earphone is inserted into the data interface in a flat state and the second detection pin is in contact with the data interface.
In addition, when the first impedance detection is performed at the first preset time, the terminal device is triggered to cut off the first impedance detection, that is, after the detection time of the first impedance detection satisfies the time of 3S, the terminal device is triggered to cut off the first impedance detection.
S150, determining the recognition result of the terminal equipment on 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 acquired, determining an 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, it is determined that the recognition result of the terminal device on the earphone is recognition earphone, and when the time difference between the first detection time and the second detection time is larger than the first preset threshold, it is determined that the recognition result of the terminal device on the earphone is recognition-unrecognized earphone. When the angle of the oblique insertion of the Type-C earphone is too large, the probability terminal device cannot identify the inserted Type-C earphone, firstly, the terminal device is controlled to enter first impedance detection, after the first impedance detection is completed, the Type-C earphone is inserted into the data interface in a flat state, first detection time and second detection time when the Type-C earphone is inserted into the data interface in a flat state are obtained, if 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, namely, at the moment, 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 in step S130 is larger than the first preset threshold value, the probability terminal device cannot identify the inserted Type-C earphone due to the fact that the angle of the oblique insertion of the Type-C earphone is too large, and the terminal device identifies the earphone when the Type-C earphone is inserted into the data interface in a flat state, so that the earphone can be identified within 4 seconds. If the difference between the first detection time and the second detection time is greater than the second preset threshold, that is, it may be determined 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 due to the problem that the earphone cannot be identified when the data interface of the terminal device is immersed in water, so that the terminal device does not identify the earphone.
According to the Type-C earphone identification method, 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 larger than the first preset threshold value, triggering the terminal equipment to execute first impedance detection, acquiring 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 when the first impedance detection is executed at the first preset moment, determining the identification result of the terminal equipment to the earphone according to the detection time difference of the first detection time and the second detection time, and avoiding the problem that the probability terminal equipment cannot identify the inserted Type-C earphone due to overlarge oblique insertion angle of the Type-C earphone.
Fig. 2 is a flow chart of another Type-C earphone identification method provided by an embodiment of the present disclosure, where on the basis of the foregoing embodiment, one implementation manner of S150 is as follows, including:
s151, judging the relation between the detection time difference between the first detection time and the second preset threshold, if the detection time difference between the first detection time and the second detection time is smaller 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 larger than the second preset threshold, executing step S153.
S152, determining that the recognition result of the terminal equipment on the earphone is that the earphone is recognized.
S153, determining that the earphone is not recognized as the recognition result of the terminal equipment.
Specifically, as shown in fig. 2, after the first detection time and the second detection time are acquired, the relationship between the detection time difference between the first detection time and the second preset threshold is determined, 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 recognition result of the terminal device on the earphone is determined to be the recognition earphone, and the detection time difference between the first detection time and the second detection time is greater than the second preset threshold, the recognition result of the terminal device on the earphone is determined to be the recognition-free earphone. When the angle of the oblique insertion of the Type-C earphone is too large, the probability terminal device cannot identify the inserted Type-C earphone, firstly, the terminal device is controlled to enter first impedance detection, after the first impedance detection is completed, the Type-C earphone is inserted into the data interface in a flat state, first detection time and second detection time when the Type-C earphone is inserted into the data interface in a flat state are obtained, if 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, namely, at the moment, 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 in step S130 is larger than the first preset threshold value, the probability terminal device cannot identify the inserted Type-C earphone due to the fact that the angle of the oblique insertion of the Type-C earphone is too large, and the terminal device identifies the earphone when the Type-C earphone is inserted into the data interface in a flat state, so that the earphone can be identified within 4 seconds. If the difference between the first detection time and the second detection time is greater than the first preset threshold, that is, it may be determined 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 due to the problem that the earphone cannot be identified when the data interface of the terminal device is immersed in water, so that the terminal device does not identify the earphone.
According to the Type-C earphone identification method provided by the embodiment of the disclosure, whether the terminal equipment identifies the state of the earphone is determined by judging the relation between the detection time difference of the first detection time and the second preset threshold value, when the detection time difference of the first detection time and the second detection time is smaller than or equal to the second preset threshold value, the terminal equipment identifies the earphone, when the detection time difference of the first detection time and the second detection time is larger than the second preset threshold value, the terminal equipment does not identify the earphone, and therefore the situation that probability that the terminal equipment cannot identify the inserted Type-C earphone due to the fact that the oblique insertion angle of the Type-C earphone is too large is achieved, and when the detection time difference of the first detection time and the second detection time is smaller than or equal to the second preset threshold value, the earphone is identified in 4S.
Fig. 3 is a flowchart of another Type-C earphone recognition method according to an embodiment of the present disclosure, where, based on the foregoing 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:
s1511, performing a second impedance detection.
In step S130, the reason why the contact time difference between the first contact time and the second contact time is greater than the first preset threshold may be that the data interface of the terminal device is immersed, or that the insertion angle of the Type-C earphone by the user is too large, which is likely to be unrecognizable by the inserted Type-C earphone. If the reason that the contact time difference between the first contact time and the second contact time is greater than the first preset threshold is that the probability that the inserted Type-C earphone cannot be identified by the terminal device is due to the fact that the angle of the inserted Type-C earphone is too large, in step S150, the detection time difference between the first detection time and the second detection time is necessarily smaller than or equal to the second preset threshold. And when the detection time difference between the first contact time and the second contact time is greater than the second preset threshold, because the data interface of the terminal device is immersed and the terminal device cannot be identified by the inserted Type-C earphone, in step S150, the detection time difference between the first detection time and the second detection time must be greater than the second preset threshold, so as to avoid the influence of the immersion of the data interface of the terminal device 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 greater than the second preset threshold, the terminal device is triggered to execute the 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 moment is detected, acquiring 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.
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 flooding detection, and the time of the flooding detection is 60S, and thus the time of the second impedance detection is 60S. And when the second impedance is detected to be at a second preset time, namely after 60S second impedance detection is performed, acquiring 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 data interface of the terminal equipment has the problem of soaking, when the Type-C interface is inserted into the data interface, the problem of soaking 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 is detected at the second preset time, the terminal device is triggered to cut off the second impedance detection.
And acquiring 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.
When the second impedance detection is executed at a second preset time, triggering the terminal equipment to cut off the second impedance detection, namely closing the terminal equipment to perform the second impedance detection, so that the terminal equipment enters a third detection time when the first detection pin detection data interface is acquired and a fourth detection time when the second detection pin detection data interface is acquired.
S1513, determining the recognition result of the terminal equipment on the earphone according to the detection time difference of the third detection time and the fourth detection time.
After the third detection time and the fourth detection time are obtained, determining the recognition result of the terminal equipment on 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 recognition result of the terminal device on the earphone is recognition 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 recognition result of the terminal device on the earphone is recognition-unrecognized earphone. When the angle of the oblique insertion of the Type-C earphone is too large, the probability terminal device cannot identify the inserted Type-C earphone, firstly, the terminal device is controlled to enter first impedance detection, after the first impedance detection is completed, the Type-C earphone is inserted into the data interface in a flat state, first detection time and second detection time when the Type-C earphone is inserted into the data interface in a flat state are obtained, if 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, namely, at the moment, 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 in step S130 is larger than the first preset threshold value, the probability terminal device cannot identify the inserted Type-C earphone due to the fact that the angle of the oblique insertion of the Type-C earphone is too large, and the terminal device identifies the earphone when the Type-C earphone is inserted into the data interface in a flat state, so that the earphone can be identified within 4 seconds. If the difference between the first detection time and the second detection time is greater than the first preset threshold, that is, it may be determined 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 in step S130 is greater than the first preset threshold, where the problem that the earphone cannot be identified due to the flooding of the data interface of the terminal device is solved, so that the terminal device is controlled to enter the second impedance detection, that is, the flooding detection, and when the second impedance detection is performed, the second preset time, that is, 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 are acquired after the terminal device completes the flooding detection, and the identification result of the terminal device to the earphone is determined according to the 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 equipment is controlled to enter the second impedance detection, namely the soaking detection, so that on one hand, the situation that the identification result of the earphone is affected due to the fact that the data interface of the terminal equipment is soaked is avoided, and on the other hand, the situation that the earphone forms a loop with the main control circuit of the terminal equipment to cause the short circuit of the main control circuit of the terminal equipment after the earphone is connected to the data interface due to the fact that the data interface of the terminal equipment is soaked is avoided.
Fig. 4 is a flowchart of another Type-C earphone identification method according to an embodiment of the present disclosure, where based on fig. 3 of the foregoing embodiment, an implementation manner of S1513 is shown below, and includes:
s15131, judging the relation between the detection time difference between the third detection time and the fourth detection time and the second preset threshold, if the detection time difference between the third detection time and the fourth detection time is smaller 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 larger than the second preset threshold, executing step S153.
S152, determining that the recognition result of the terminal equipment on the earphone is that the earphone is recognized.
S153, determining that the earphone is not recognized as the recognition result of the terminal equipment.
Specifically, according to the detection time difference between the third detection time and the fourth detection time, determining the recognition result of the terminal device on 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, determining that the recognition result of the terminal equipment on the earphone is recognition earphone, 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 recognition result of the terminal equipment on the earphone is unrecognized earphone, namely after the second impedance detection is carried out on the terminal equipment, if the obtained 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 equipment does not have the problem of soaking, recognizing the earphone, and the obtained 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 equipment does not trigger the terminal equipment to recognize the earphone.
According to the Type-C earphone identification method provided by the embodiment of the disclosure, when the detection time difference between the first detection time and the second detection time is larger than the second preset threshold value, triggering second impedance detection, namely soaking detection, acquiring third detection time and fourth detection time after soaking detection, and determining an earphone identification result of the terminal equipment according to the relation between the detection time difference between the third detection time and the fourth detection time and the second preset threshold value, so that influence on the earphone identification result due to soaking of a data interface of the terminal equipment is avoided.
It should be noted that, in the process of determining the recognition result of the terminal device to the earphone in the above embodiment, in the process of determining that the recognition result of the terminal device to the earphone is the recognition result of the earphone, the connection between the terminal device and the earphone is realized by triggering an interrupt loop, that is, interrupting a detection loop when the earphone is inserted into the data interface. In the process of determining that the terminal equipment does not recognize the earphone as the recognition result of the earphone, the interruption loop is not triggered, namely the detection loop when the earphone is inserted into the data interface is not interrupted, and at the moment, the terminal equipment and the earphone cannot be connected.
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:
the contact time obtaining module 510 is 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;
the detection time obtaining module 530 is configured to obtain, when the first impedance 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;
The earphone recognition result determining module 540 is configured to determine a recognition result of the terminal device on the earphone according to the detection time difference between the first detection time and the second detection time.
According to the Type-C earphone identification device provided by the embodiment of the disclosure, the contact time acquisition module acquires 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, the contact time difference calculation module calculates the contact time difference between the first contact time and the second contact time, the detection time acquisition module acquires 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 when executing the first preset moment, and the earphone identification result determination module determines the identification result of the terminal equipment to the earphone according to the detection time difference of the first detection time and the second detection time, so that the problem that the probability terminal equipment cannot identify the inserted Type-C earphone due to overlarge angle of oblique insertion of the Type-C earphone is avoided.
The Type-C earphone identification device provided by the embodiment of the invention can execute the Type-C earphone identification method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, and 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 processors 610 in the electronic device may be one or more, one processor 610 being taken as an example in fig. 6; the processor 610, memory 620, input device 630, and output device 640 in the electronic device may be connected by a bus or other means, for example in fig. 6.
The memory 620 is used as a computer readable storage medium for storing a software program, a computer executable program, and modules, such as program instructions/modules corresponding to the Type-C earphone identification method in the embodiment of the present invention. The processor 610 executes various functional applications and data processing of the electronic device by running software programs, instructions and modules stored in the memory 620, i.e. implements the Type-C headset identification method provided by the embodiments of the present invention.
Memory 620 may include primarily a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application program required for functionality; the storage data area may store data created according to the use of the terminal, etc. In addition, 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, memory 620 may further include memory remotely located relative to processor 610, which may be connected to the electronic device via 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 to generate key signal inputs related to user settings and function control of the electronic device, which may include a keyboard, mouse, etc. The output device 640 may include a display device such as a display screen.
The embodiments of the present disclosure also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to implement the Type-C headset identification method provided by the embodiments of the present disclosure.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present invention is not limited to the above-mentioned method operations, and may also perform the related operations in the Type-C earphone identification method provided in any embodiment of the present invention.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
It should be noted that, in the embodiment of the identification device, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
It should be noted that in this document, relational terms such as "first" and "second" and the like are 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. Moreover, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the 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 and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (7)

1. A Type-C headset identification method, wherein the method is applied to a terminal device having a data interface, the method comprising:
acquiring a first contact time when a first detection pin contacts the data interface and a second contact time when a second detection pin contacts 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, 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;
Determining that the recognition result of the terminal equipment on the earphone is recognition earphone 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;
executing second impedance detection when the detection time difference between the first detection time and the second detection time is larger than a second preset threshold value;
when the second impedance is executed and a second preset moment is detected, acquiring 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;
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 recognition result of the terminal equipment on the earphone is recognition earphone;
and when the detection time difference between the third detection time and the fourth detection time is larger than a second preset threshold value, determining that the recognition result of the terminal equipment on the earphone is an unidentified earphone.
2. The method of claim 1, wherein the second impedance detection is performed for a time greater than the time for which the first impedance detection is performed.
3. The method of claim 1, wherein the 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 detects a first preset time is performed comprises:
Triggering the terminal equipment to cut off the first impedance detection when the first impedance detection is executed to a first preset moment;
and acquiring 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.
4. The method of claim 1, 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 detects a second preset time is performed comprises:
triggering the terminal equipment to cut off the second impedance detection when the second impedance detection is executed to a second preset moment;
and acquiring 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.
5. Type-C earphone recognition device, characterized in that includes:
the contact time acquisition module is used for acquiring 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;
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 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 when the first impedance is executed to detect a first preset moment;
the earphone identification result determining module is used for determining that the identification result of the terminal equipment to the earphone is an identification earphone 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;
executing second impedance detection when the detection time difference between the first detection time and the second detection time is larger than a second preset threshold value;
when the second impedance is executed and a second preset moment is detected, acquiring 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;
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 recognition result of the terminal equipment on the earphone is recognition earphone;
And when the detection time difference between the third detection time and the fourth detection time is larger than a second preset threshold value, determining that the recognition result of the terminal equipment on the earphone is an unidentified earphone.
6. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the Type-C earpiece identification method of any of claims 1-4.
7. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the Type-C earpiece identification method of any of claims 1 to 4.
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 CN113507680A (en) 2021-10-15
CN113507680B true 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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107295140A (en) * 2017-06-27 2017-10-24 努比亚技术有限公司 A kind of detection method of earphone, device and terminal
CN111200767A (en) * 2018-11-20 2020-05-26 成都鼎桥通信技术有限公司 Earphone detection method, earphone detection device, terminal and storage medium

Family Cites Families (7)

* 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
KR101640465B1 (en) * 2010-08-26 2016-07-18 삼성전자 주식회사 Method and apparatus for recognizing an accessory of a portable terminal
CN104202691B (en) * 2014-08-28 2019-05-10 惠州Tcl移动通信有限公司 A kind of earphone and mobile terminal for ECG detecting
CN105353858A (en) * 2015-10-29 2016-02-24 广东未来之星网络科技股份有限公司 Repeatable-triggered forced shutdown anti-addiction intelligent power control method
KR20180123879A (en) * 2017-05-10 2018-11-20 삼성전자주식회사 Electronic device and method for controlling audio output according to type of earphone
CN108063994B (en) * 2017-12-21 2020-07-14 Tcl移动通信科技(宁波)有限公司 Mobile terminal, earphone detection control method, storage medium and earphone
US10837934B2 (en) * 2018-03-28 2020-11-17 Samsung Electronics Co., Ltd. Water detection circuit, electronic device including the same, and water detection method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107295140A (en) * 2017-06-27 2017-10-24 努比亚技术有限公司 A kind of detection method of earphone, device and terminal
CN111200767A (en) * 2018-11-20 2020-05-26 成都鼎桥通信技术有限公司 Earphone detection method, earphone detection device, terminal and storage medium

Also Published As

Publication number Publication date
CN113507680A (en) 2021-10-15

Similar Documents

Publication Publication Date Title
CN109378000B (en) Voice wake-up method, device, system, equipment, server and storage medium
CN106507445B (en) Wireless fidelity Wi-Fi scanning method and mobile terminal
CN109346061B (en) Audio detection method, device and storage medium
US20180203986A1 (en) Fingerprint Recognition Method and Apparatus, and Touchscreen Terminal
CN106201304A (en) A kind of method and device of false-touch prevention operation
WO2019007169A1 (en) Method and apparatus for operating terminal
CN107748685A (en) Application program launching control method, device, terminal device and storage medium
CN103593140A (en) Method and terminal for touch screen terminal screen locking
CN110875059A (en) Method and device for judging reception end and storage device
CN109726121B (en) Verification code obtaining method and terminal equipment
CN106028309B (en) Method and device for restoring main card in dual-card dual-standby terminal to data network
CN112634894A (en) Awakening method, awakening device and terminal
CN109669566B (en) Method and device for controlling report point output
CN111273769B (en) Equipment control method and device, electronic equipment and storage medium
CN113507680B (en) Type-C earphone identification method and device, electronic equipment and storage medium
CN110955894B (en) Malicious content detection method and device, electronic equipment and readable storage medium
CN111200767B (en) Earphone detection method, earphone detection device, terminal and storage medium
CN109710111B (en) False touch prevention method and electronic equipment
CN112149091A (en) Equipment unlocking method and device, electronic equipment and storage medium
CN112634891A (en) Identification code response method and device, vehicle-mounted terminal and storage medium
CN105956443B (en) A kind of method and terminal of incoming call handling
CN114338089B (en) Anti-attack method, device, equipment and computer readable storage medium
CN112637139A (en) Voice transmission processing method and device based on Internet of things and computer equipment
CN109558772B (en) Fingerprint identification method, fingerprint identification device, terminal and computer readable storage medium
CN112750429A (en) Voice interaction method and device, electronic equipment and 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