CN108768379A - Polymorphic recognition methods, system and terminal - Google Patents

Polymorphic recognition methods, system and terminal Download PDF

Info

Publication number
CN108768379A
CN108768379A CN201810552935.9A CN201810552935A CN108768379A CN 108768379 A CN108768379 A CN 108768379A CN 201810552935 A CN201810552935 A CN 201810552935A CN 108768379 A CN108768379 A CN 108768379A
Authority
CN
China
Prior art keywords
detected
capacitance
pull
state
gpio 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
CN201810552935.9A
Other languages
Chinese (zh)
Other versions
CN108768379B (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.)
Huaqin Telecom Technology Co Ltd
Original Assignee
Huaqin Telecom Technology 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 Huaqin Telecom Technology Co Ltd filed Critical Huaqin Telecom Technology Co Ltd
Priority to CN201810552935.9A priority Critical patent/CN108768379B/en
Publication of CN108768379A publication Critical patent/CN108768379A/en
Application granted granted Critical
Publication of CN108768379B publication Critical patent/CN108768379B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03KPULSE TECHNIQUE
    • H03K19/00Logic circuits, i.e. having at least two inputs acting on one output; Inverting circuits
    • H03K19/0175Coupling arrangements; Interface arrangements
    • H03K19/017509Interface arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/385Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices

Abstract

The invention discloses a kind of polymorphic recognition methods, system and terminal, polymorphic identifying system includes GPIO interface, charging/discharging apparatus and detection module;Detection module is used for when GPIO interface is electrically connected with device to be detected, if GPIO interface detects high level, it is determined that device to be detected is pull-up state;If GPIO interface detects low level, it is determined that it is pull-down state;Detection module is additionally operable to when device to be detected be pull-up state, detects the charging time that device to be detected charges to charging/discharging apparatus, obtains the type of device to be detected;Detection module is additionally operable to when device to be detected be pull-down state, and detection charging/discharging apparatus treats the discharge time that detection device discharges, obtains the type of device to be detected.The present invention identifies different types of device to be detected according to different resistance values, to realize that a GPIO interface can identify the different types of component of different suppliers, to improve the utilization rate of GPIO interface.

Description

Polymorphic recognition methods, system and terminal
Technical field
The present invention relates to field of communication technology, more particularly to a kind of polymorphic recognition methods, system and terminal.
Background technology
During terminal development, it usually needs the various types of components provided using different suppliers are (such as display mould Group, camera module etc.), terminal needs correctly to identify each component to realize the corresponding component of driving.
Each component has the component ID (identity number) of itself, and indicates in a binary fashion, in the prior art It is connected by the ends component ID of GPIO (universal input/output) interfaces and component.But each GPIO interface can only identify 2 The component (being distinguished by 1 and 0) of supplier then needs 2 GPIO interfaces (i.e. when the component for needing 4 suppliers of identification It is distinguished by 11,10,01 and 00);When the component for needing 8 suppliers of identification, then 3 GPIO interfaces is needed (to pass through 111,110,101,011,100,010,001 and 000 distinguish), other and so on, i.e., it ought need to identify more component When, just the property of must adapt to increases the quantity of GPIO interface;Therefore, different suppliers are being identified using GPIO interface in the prior art Component when, there is a problem of that utilization rate is relatively low.
Invention content
The technical problem to be solved by the present invention is in the prior art in the component for identifying different suppliers using GPIO interface When, there are the lower defect of utilization rate, and it is an object of the present invention to provide a kind of polymorphic recognition methods, system and terminal.
The present invention is to solve above-mentioned technical problem by following technical proposals:
The present invention provides a kind of polymorphic identifying system, the polymorphic identifying system include GPIO interface, charging/discharging apparatus and Detection module;
The GPIO interface is electrically connected with the detection module;
The detection module is used for when the GPIO interface is electrically connected with the device to be detected, if the GPIO interface The level detected is high level, it is determined that the device to be detected is pull-up state;If the electricity that the GPIO interface detects It puts down as low level, it is determined that the device to be detected is pull-down state;
Wherein, the different types of device to be detected corresponds to different resistance values;
The detection module is additionally operable to when the device to be detected be pull-up state, and the charging/discharging apparatus is waited for described When detecting device electrical connection, detects the device to be detected and required charging time of charging, root are carried out to the charging/discharging apparatus The resistance value of the device to be detected is obtained according to the charging time, and the class of the device to be detected is obtained according to the resistance value Type;Or,
The detection module is additionally operable to when the device to be detected be pull-down state, and the charging/discharging apparatus is waited for described When detecting device electrical connection, detects the charging/discharging apparatus and required discharge time of discharging, root are carried out to the device to be detected The resistance value of the device to be detected is obtained according to the discharge time, and the class of the device to be detected is obtained according to the resistance value Type.
Optionally, the charging/discharging apparatus is capacitance;
One end of the capacitance is electrically connected with the GPIO interface, the other end ground connection of the capacitance;
The detection module in one end of the capacitance with the device to be detected for being electrically connected, and the GPIO interface Internal resistance be vacant state when, detect the capacitance voltage value whether be less than initial voltage value, if not, it is determined that described Device to be detected is pull-up state;If so, determining that the device to be detected is pull-down state.
Optionally, when the device to be detected is pull-up state, by one end of the capacitance and the device to be detected It disconnects, and sets the internal resistance of the GPIO interface to pull-down state, the capacitance discharges, until the electricity The voltage value of appearance is zero;
When the voltage value that the capacitance is discharged to the capacitance is zero, set the internal resistance of the GPIO interface to Vacant state, and one end of the capacitance is electrically connected with the device to be detected, the device to be detected to the capacitance into Row charging;
The detection module, which is additionally operable to detect the device to be detected, charges to the capacitance, until the capacitance Voltage value reaches the charging time required when second voltage value, and the resistance of the device to be detected is obtained according to the charging time It is worth, and obtains the type of the device to be detected according to the resistance value;
When the device to be detected is pull-down state, one end of the capacitance is electrically connected with the device to be detected, And setting the internal resistance of the GPIO interface to vacant state, the capacitance discharges to the device to be detected;
The detection module, which is additionally operable to detect the capacitance, discharges to the device to be detected, until the capacitance Voltage value drops to discharge time required when third voltage value, and the resistance of the device to be detected is obtained according to the discharge time It is worth, and obtains the type of the device to be detected according to the resistance value.
Optionally, it is disconnected in one end of the capacitance and the device to be detected, and the inside of the GPIO interface When resistance is pull-up state, the capacitance charges, until the voltage value of the capacitance reaches the initial voltage value.
Optionally, the internal resistance includes pull-up resistor and pull down resistor;
The GPIO interface includes switch;
The switch includes moved end and non-moving end;
Wherein, the non-moving end is electrically connected with the charging/discharging apparatus and the detection module respectively;
When the internal resistance of the GPIO interface is pull-up state, one end and the power end of the pull-up resistor are electrically connected It connects, the other end of the pull-up resistor is electrically connected with the moved end;
When the internal resistance of the GPIO interface is pull-down state, one end of the pull down resistor is electrically connected with the moved end It connects, the other end ground connection of the pull down resistor;
When the internal resistance of the GPIO interface is vacant state, the moved end is in vacant state;
Or, the switch includes the first moved end, the second moved end and non-moving end;
Wherein, the non-moving end is electrically connected with the charging/discharging apparatus and the detection module respectively;
When the internal resistance of the GPIO interface is pull-up state, one end and the power end of the pull-up resistor are electrically connected It connects, the other end of the pull-up resistor is electrically connected with first moved end;
When the internal resistance of the GPIO interface is pull-down state, one end of the pull down resistor and second moved end Electrical connection, the other end ground connection of the pull down resistor;
When the internal resistance of the GPIO interface is vacant state, first moved end and second moved end are in Vacant state.
Optionally, when the device to be detected is pull-up state, one end and the capacitance of the device to be detected One end is electrically connected, and the other end of the device to be detected is electrically connected with power end;
When the device to be detected is pull-down state, one end and one end of the capacitance of the device to be detected are electrically connected It connects, the other end ground connection of the device to be detected.
The present invention also provides a kind of terminal, the terminal includes above-mentioned polymorphic identifying system.
The present invention also provides a kind of polymorphic recognition methods, the polymorphic recognition methods includes:
GPIO interface is electrically connected with device to be detected, if the level that the GPIO interface detects is high level, really The fixed device to be detected is pull-up state;If the level that the GPIO interface detects is low level, it is determined that described to be checked Survey device is pull-down state;
Wherein, the different types of device to be detected corresponds to different resistance values;
When the device to be detected be pull-up state, the charging/discharging apparatus is electrically connected with the device to be detected, inspection It surveys the device to be detected and the required charging time of charging is carried out to the charging/discharging apparatus, institute is obtained according to the charging time The resistance value of device to be detected is stated, and obtains the type of the device to be detected according to the resistance value;Or,
When the device to be detected be pull-down state, the charging/discharging apparatus is electrically connected with the device to be detected, inspection It surveys the charging/discharging apparatus and required discharge time of discharging is carried out to the device to be detected, institute is obtained according to the discharge time The resistance value of device to be detected is stated, and obtains the type of the device to be detected according to the resistance value.
Optionally, the charging/discharging apparatus is capacitance;
One end of the capacitance is electrically connected with the GPIO interface, the other end ground connection of the capacitance;
It is described to be electrically connected the GPIO interface with the device to be detected, if the level that the GPIO interface detects is High level, it is determined that the device to be detected is pull-up state;If the level that the GPIO interface detects is low level, really Determining the step of device to be detected is pull-down state includes:
One end of the capacitance is electrically connected with the device to be detected, and the internal resistance of the GPIO interface is set as Whether vacant state, the voltage value for detecting the capacitance are less than initial voltage value, if not, it is determined that the device to be detected is upper Tension state;If so, determining that the device to be detected is pull-down state.
Optionally, described to work as the device to be detected for pull-up state, by the charging/discharging apparatus and the device to be detected Part is electrically connected, and is detected the device to be detected and is carried out the required charging time of charging to the charging/discharging apparatus, is filled according to described The electric time obtains the resistance value of the device to be detected, and the step of obtaining the type of the device to be detected according to the resistance value is wrapped It includes:
When the device to be detected is pull-up state, one end of the capacitance is disconnected with the device to be detected and is connected It connects, and sets the internal resistance of the GPIO interface to pull-down state, the capacitance discharges, until the electricity of the capacitance Pressure value is zero;
When the voltage value that the capacitance is discharged to the capacitance is zero, set the internal resistance of the GPIO interface to Vacant state, and one end of the capacitance is electrically connected with the device to be detected, the device to be detected to the capacitance into Row charging;
It detects the device to be detected to charge to the capacitance, until the voltage value of the capacitance reaches second voltage Required charging time when value obtains the resistance value of the device to be detected according to the charging time, and is obtained according to the resistance value Take the type of the device to be detected;
It is described to work as the device to be detected for pull-down state, the charging/discharging apparatus and the device to be detected are electrically connected It connects, detects the charging/discharging apparatus and required discharge time of discharging is carried out to the device to be detected, according to the discharge time The resistance value of the device to be detected is obtained, and the step of obtaining the type of the device to be detected according to the resistance value includes:
When the device to be detected is pull-down state, one end of the capacitance is electrically connected with the device to be detected, And setting the internal resistance of the GPIO interface to vacant state, the capacitance discharges to the device to be detected;
It detects the capacitance to discharge to the device to be detected, until the voltage value of the capacitance drops to third electricity Required discharge time when pressure value obtains the resistance value of the device to be detected according to the discharge time, and according to the resistance value Obtain the type of the device to be detected.
Optionally, described to be electrically connected the GPIO interface with the device to be detected, if the GPIO interface detects Level be high level, it is determined that the device to be detected be pull-up state;If the level that the GPIO interface detects is low Level, it is determined that the device to be detected is that pull-down state step further includes before:
One end of the capacitance and the device to be detected are disconnected, and the internal resistance setting of the GPIO interface For pull-up state, the capacitance charges, until the voltage value of the capacitance reaches the initial voltage value.
The positive effect of the present invention is that:
In the present invention, it is pull-up state or pull-down state to detect device to be detected first, is then upper in device to be detected When tension state, the resistance value of device to be detected is obtained according to the charging time charged to the capacitance after electric discharge, in device to be detected When part is pull-down state, the resistance value that detection discharge time for discharging of device obtains device to be detected is treated according to capacitance, most Different types of device to be detected is identified according to different resistance values eventually, to realize that a GPIO interface can identify different confessions The different types of component for answering quotient, to improve the utilization rate of GPIO interface.
Description of the drawings
Fig. 1 is the module diagram of the polymorphic identifying system of the embodiment of the present invention 1;
The circuit diagram that Fig. 2 is the device to be detected of the polymorphic identifying system of the embodiment of the present invention 2 when being pull-up state;
The circuit diagram that Fig. 3 is the device to be detected of the polymorphic identifying system of the embodiment of the present invention 2 when being pull-down state;
Fig. 4 is the flow chart of the method for the polymorphic identifying system of the embodiment of the present invention 4;
Fig. 5 is the flow chart of the method for the polymorphic identifying system of the embodiment of the present invention 5.
Specific implementation mode
It is further illustrated the present invention below by the mode of embodiment, but does not therefore limit the present invention to the reality It applies among a range.
Embodiment 1
As shown in Figure 1, the polymorphic identifying system of the present embodiment includes GPIO interface 1, charging/discharging apparatus 2 and detection module 3. GPIO interface 1 is electrically connected with detection module 3.
Detection module 3 is used for when GPIO interface 1 is electrically connected with device to be detected, if the level that GPIO interface 1 detects For high level, it is determined that device to be detected is pull-up state;If the level that GPIO interface 1 detects is low level, it is determined that wait for Detection device is pull-down state;
Wherein, device to be detected includes various types of components (such as display module, the camera shooting head mould that different suppliers provide Group etc.), and device to be detected is not limited only to above-mentioned included several components.
Different types of device to be detected corresponds to different resistance values, i.e., different resistance value such as 10K Ω, 20K Ω, 30K Ω, 40K Ω ... .. correspond to the different types of component that different suppliers provide respectively.
Detection module 3 is additionally operable to when device to be detected be pull-up state, and charging/discharging apparatus is electrically connected with device to be detected When, it detects device to be detected and the required charging time of charging is carried out to charging/discharging apparatus, device to be detected is obtained according to the charging time The resistance value of part, and obtain according to resistance value the type of device to be detected;Or,
Detection module 3 is additionally operable to when device to be detected be pull-down state, and charging/discharging apparatus is electrically connected with device to be detected When, detection charging/discharging apparatus treats detection device and carries out required discharge time of discharging, and device to be detected is obtained according to discharge time The resistance value of part, and obtain according to resistance value the type of device to be detected.
In the present embodiment, it is pull-up state or pull-down state to detect device to be detected first, is then in device to be detected When pull-up state, the resistance value of device to be detected is obtained according to the charging time charged to the capacitance after electric discharge, to be detected When device is pull-down state, the resistance value that detection discharge time for discharging of device obtains device to be detected is treated according to capacitance, Different types of device to be detected is finally identified according to different resistance values, to realize that a GPIO interface can identify difference The different types of component of supplier, to improve the utilization rate of GPIO interface.
Embodiment 2
As shown in Figures 2 and 3, the present embodiment is further improved on the basis of embodiment 1, specifically:
Charging/discharging apparatus 2 is capacitance C;One end of capacitance C is electrically connected with GPIO interface, the other end ground connection of capacitance C.
The internal resistance of GPIO interface 1 includes pull-up resistor R1 and pull down resistor R2.
GPIO interface 1 includes switch 11;Switch includes moved end a and non-moving end b;
Wherein, non-moving end b is electrically connected with charging/discharging apparatus 2 and detection module 3 respectively.
When the internal resistance of GPIO interface 1 is pull-up state, one end of pull-up resistor R1 is electrically connected with power end, pull-up The other end of resistance R1 is electrically connected with moved end a;
When the internal resistance of GPIO interface 1 is pull-down state, one end of pull down resistor R2 is electrically connected with moved end a, drop-down The other end of resistance R2 is grounded;
When the internal resistance of GPIO interface 1 is vacant state, moved end a is in vacant state.
Or, switch 11 includes two moved end a (the first moved end and the second moved end) and non-moving end b;
Wherein, non-moving end b is electrically connected with charging/discharging apparatus and detection module respectively;
When the internal resistance of GPIO interface 1 is pull-up state, one end of pull-up resistor R1 is electrically connected with power end, pull-up The other end of resistance R1 is electrically connected with the first moved end;
When the internal resistance of GPIO interface 1 is pull-down state, one end of pull down resistor R2 is electrically connected with the second moved end, under The other end of pull-up resistor R2 is grounded;
When the internal resistance of GPIO interface 1 is vacant state, the first moved end and the second moved end are in vacant state.
Disconnected in one end of capacitance C and device to be detected, and the internal resistance of GPIO interface 1 be pull-up state when, Capacitance charges, until the voltage value of capacitance C reaches initial voltage value (such as 1.8V), then by the internal resistance of GPIO interface It is set as vacant state.
Detection module 3 in one end of capacitance C with device to be detected for being electrically connected, and the internal resistance of GPIO interface 1 is When vacant state, whether the voltage value of detection capacitance C is less than initial voltage value, if not, it is determined that device to be detected is pull-up shape State;If so, determining that device to be detected is pull-down state.
As shown in Fig. 2, when device to be detected (R3) is pull-up state, one end of one end and capacitance C of device to be detected Electrical connection, the other end of device to be detected are electrically connected with power end.
When device to be detected is pull-up state, one end of capacitance C and device to be detected are disconnected, and GPIO is connect The internal resistance of mouth 1 is set as pull-down state, and capacitance C discharges, until the voltage value of capacitance C is zero;
When the voltage value that capacitance C is discharged to capacitance C is zero, it sets the internal resistance of GPIO interface 1 to vacant state, And be electrically connected one end of capacitance C with device to be detected, device to be detected charges to capacitance C;
Detection module 3, which is additionally operable to detect device to be detected, charges to capacitance C, until the voltage value of capacitance C reaches the Required charging time when two voltage values obtains the resistance value of device to be detected according to the charging time, and to be checked according to resistance value acquisition Survey the type of device.
Specifically, when the power end that voltage is E is charged by the resistance value R3 of device to be detected to capacitance C, capacitance C's is first Beginning voltage value V0 is 0, and capacitance C is E full of the voltage value Vu after terminating, and the corresponding capacitances of capacitance C are C0, then at any time When t, the voltage value Vt=E* [1-exp (- t/R3C0)] on capacitance C;When the voltage value Vt on capacitance C reaches second voltage value V2 When, according to V2=E* [1-exp (- t/R3C0)] and charging time, the resistance value R3 of device to be detected is obtained, and then according to resistance value R3 Obtain the type of device to be detected.
As shown in figure 3, when device to be detected (R4) is pull-down state, one end of one end and capacitance C of device to be detected Electrical connection, the other end ground connection of device to be detected.
When device to be detected is pull-down state, one end of capacitance C is electrically connected with device to be detected, and by GPIO interface Internal resistance be set as vacant state, capacitance C treats detection device and discharges;
Detection module 3, which is additionally operable to detection capacitance C, to be treated detection device and discharges, until the voltage value of capacitance C drops to Required discharge time when third voltage value obtains the resistance value of device to be detected according to discharge time, and is waited for according to resistance value acquisition Detect the type of device.
Specifically, when the resistance value R4 that capacitance C treats detection device is discharged, the initial voltage value V0 on capacitance C is Voltage value Vu after E, capacitance C electric discharge is 0, and the corresponding capacitances of capacitance C are C0, then at any time t when, on capacitance C Voltage value Vt=E*exp (- t/R4C0);When the voltage value on capacitance C reaches third voltage value V3, according to V3=E*exp (- t/R4C0) and discharge time obtains the resistance value R4 of device to be detected, and then the class of device to be detected is obtained according to resistance value R4 Type.
In the present embodiment, it is pull-up state or pull-down state to detect device to be detected first, is then in device to be detected When pull-up state, the resistance value of device to be detected is obtained according to the charging time charged to the capacitance after electric discharge, to be detected When device is pull-down state, the resistance value that detection discharge time for discharging of device obtains device to be detected is treated according to capacitance, Different types of device to be detected is finally identified according to different resistance values, to realize that a GPIO interface can identify difference The different types of component of supplier, to improve the utilization rate of GPIO interface.
Embodiment 3
The present embodiment is the terminal for including polymorphic identifying system in embodiment 1 or 2 in any one embodiment.
Wherein, terminal includes mobile phone, tablet computer, PDA (palm PC) etc., and terminal be not limited only to it is above-mentioned included Several equipment.
GPIO interface in the terminal of the present embodiment can identify different types of device to be detected according to different resistance values Part, to which the GPIO interface realized in terminal can identify the different types of component of different suppliers, to improve The utilization rate of GPIO interface in terminal.
Embodiment 4
As shown in figure 4, the polymorphic recognition methods of the present embodiment includes:
S101, GPIO interface is electrically connected with device to be detected, if the level that GPIO interface detects is high level, really Fixed device to be detected is pull-up state;If the level that GPIO interface detects is low level, it is determined that device to be detected is drop-down State;
Wherein, device to be detected includes various types of components (such as display module, the camera shooting head mould that different suppliers provide Group etc.), and device to be detected is not limited only to above-mentioned included several components.
Different types of device to be detected corresponds to different resistance values, i.e., different resistance value such as 10K Ω, 20K Ω, 30K Ω, 40K Ω ... .. correspond to the different types of component that different suppliers provide respectively.
S102, when device to be detected be pull-up state, charging/discharging apparatus is electrically connected with device to be detected, detect it is to be detected Device carries out the required charging time of charging to charging/discharging apparatus, and the resistance value of device to be detected, and root are obtained according to the charging time The type of device to be detected is obtained according to resistance value;Or,
When device to be detected be pull-down state, charging/discharging apparatus is electrically connected with device to be detected, detection charging/discharging apparatus It treats detection device and carries out required discharge time of discharging, the resistance value of device to be detected is obtained according to discharge time, and according to resistance Value obtains the type of device to be detected.
In the present embodiment, it is pull-up state or pull-down state to detect device to be detected first, is then in device to be detected When pull-up state, the resistance value of device to be detected is obtained according to the charging time charged to the capacitance after electric discharge, to be detected When device is pull-down state, the resistance value that detection discharge time for discharging of device obtains device to be detected is treated according to capacitance, Different types of device to be detected is finally identified according to different resistance values, to realize that a GPIO interface can identify difference The different types of component of supplier, to improve the utilization rate of GPIO interface.
Embodiment 5
As shown in figure 5, the present embodiment is further improved on the basis of embodiment 4, specifically:
Charging/discharging apparatus is capacitance;One end of capacitance is electrically connected with GPIO interface, the other end ground connection of capacitance.
Further include before step S101:
S100, one end of capacitance and device to be detected are disconnected, and the internal resistance of GPIO interface is set as pulling up State, capacitance charge, until the voltage value of capacitance reaches initial voltage value.
Step S101 is specifically included:
S1011, one end of capacitance is electrically connected with device to be detected, and the internal resistance of GPIO interface is set as hanging shape State, judges whether the voltage value of capacitance is less than initial voltage value, if not, it is determined that device to be detected is pull-up state;If so, really Fixed device to be detected is pull-down state.
Step S102 is specifically included:
Wherein, when device to be detected be pull-up state, charging/discharging apparatus is electrically connected with device to be detected, detect it is to be detected Device carries out the required charging time of charging to charging/discharging apparatus, and the resistance value of device to be detected, and root are obtained according to the charging time The step of obtaining the type of device to be detected according to resistance value include:
When device to be detected is pull-up state, one end of capacitance and device to be detected are disconnected, and GPIO is connect The internal resistance of mouth is set as pull-down state, and capacitance discharges, until the voltage value of capacitance is zero;
When the voltage value that capacitance is discharged to capacitance is zero, it sets the internal resistance of GPIO interface to vacant state, and One end of capacitance is electrically connected with device to be detected, device to be detected charges to capacitance;
It detects device to be detected to charge to capacitance, be filled until the voltage value of capacitance is required when reaching second voltage value The electric time obtains the resistance value of device to be detected according to the charging time, and the type of device to be detected is obtained according to resistance value.
Specifically, when the power end that voltage is E is charged by the resistance value R3 of device to be detected to capacitance C, capacitance C's is first Beginning voltage value V0 is 0, and capacitance C is E full of the voltage value Vu after terminating, and the corresponding capacitances of capacitance C are C0, then at any time When t, the voltage value Vt=E* [1-exp (- t/R3C0)] on capacitance C;When the voltage value Vt on capacitance C reaches second voltage value V2 When, according to V2=E* [1-exp (- t/R3C0)] and charging time, the resistance value R3 of device to be detected is obtained, and then according to resistance value R3 Obtain the type of device to be detected.
Wherein, when device to be detected be pull-down state, charging/discharging apparatus is electrically connected with device to be detected, detection charge and discharge Equipment treats detection device and carries out required discharge time of discharging, and the resistance value of device to be detected, and root are obtained according to discharge time The step of obtaining the type of device to be detected according to resistance value include:
When device to be detected is pull-down state, one end of capacitance is electrically connected with device to be detected, and by GPIO interface Internal resistance be set as vacant state, capacitance treats detection device and discharges;
Detection capacitance treat detection device discharge, until capacitance voltage value drop to it is required when third voltage value Discharge time obtains the resistance value of device to be detected according to discharge time, and the type of device to be detected is obtained according to resistance value.
Specifically, when the resistance value R4 that capacitance C treats detection device is discharged, the initial voltage value V0 on capacitance C is Voltage value Vu after E, capacitance C electric discharge is 0, and the corresponding capacitances of capacitance C are C0, then at any time t when, on capacitance C Voltage value Vt=E*exp (- t/R4C0);When the voltage value on capacitance C reaches third voltage value V3, according to V3=E*exp (- t/R4C0) and discharge time obtains the resistance value R4 of device to be detected, and then the class of device to be detected is obtained according to resistance value R4 Type.
In the present embodiment, it is pull-up state or pull-down state to detect device to be detected first, is then in device to be detected When pull-up state, the resistance value of device to be detected is obtained according to the charging time charged to the capacitance after electric discharge, to be detected When device is pull-down state, the resistance value that detection discharge time for discharging of device obtains device to be detected is treated according to capacitance, Different types of device to be detected is finally identified according to different resistance values, to realize that a GPIO interface can identify difference The different types of component of supplier, to improve the utilization rate of GPIO interface.
Although specific embodiments of the present invention have been described above, it will be appreciated by those of skill in the art that these It is merely illustrative of, protection scope of the present invention is defined by the appended claims.Those skilled in the art is not carrying on the back Under the premise of from the principle and substance of the present invention, various changes or modifications can be made to these embodiments, but these are changed Protection scope of the present invention is each fallen with modification.

Claims (11)

1. a kind of polymorphic identifying system, which is characterized in that the polymorphic identifying system includes GPIO interface, charging/discharging apparatus and inspection Survey module;
The GPIO interface is electrically connected with the detection module;
The detection module is used for when the GPIO interface is electrically connected with the device to be detected, if the GPIO interface detects The level arrived is high level, it is determined that the device to be detected is pull-up state;If the level that the GPIO interface detects is Low level, it is determined that the device to be detected is pull-down state;
Wherein, the different types of device to be detected corresponds to different resistance values;
The detection module be additionally operable to when the device to be detected be pull-up state, and the charging/discharging apparatus with it is described to be detected When device is electrically connected, detects the device to be detected and the required charging time of charging is carried out to the charging/discharging apparatus, according to institute The resistance value that the charging time obtains the device to be detected is stated, and obtains the type of the device to be detected according to the resistance value;Or,
The detection module be additionally operable to when the device to be detected be pull-down state, and the charging/discharging apparatus with it is described to be detected When device is electrically connected, detects the charging/discharging apparatus and required discharge time of discharging is carried out to the device to be detected, according to institute The resistance value that discharge time obtains the device to be detected is stated, and obtains the type of the device to be detected according to the resistance value.
2. polymorphic identifying system as described in claim 1, which is characterized in that the charging/discharging apparatus is capacitance;
One end of the capacitance is electrically connected with the GPIO interface, the other end ground connection of the capacitance;
The detection module in one end of the capacitance with the device to be detected for being electrically connected, and the GPIO interface is interior When portion's resistance is vacant state, whether the voltage value for detecting the capacitance is less than initial voltage value, if not, it is determined that described to be checked Survey device is pull-up state;If so, determining that the device to be detected is pull-down state.
3. polymorphic identifying system as claimed in claim 2, which is characterized in that when the device to be detected is pull-up state, One end of the capacitance and the device to be detected are disconnected, and the internal resistance of the GPIO interface is set as pulling down State, the capacitance discharge, until the voltage value of the capacitance is zero;
When the voltage value that the capacitance is discharged to the capacitance is zero, the internal resistance of the GPIO interface is set as hanging State, and one end of the capacitance is electrically connected with the device to be detected, the device to be detected fills the capacitance Electricity;
The detection module, which is additionally operable to detect the device to be detected, charges to the capacitance, until the voltage of the capacitance Value reaches the charging time required when second voltage value, and the resistance value of the device to be detected is obtained according to the charging time, and The type of the device to be detected is obtained according to the resistance value;
When the device to be detected is pull-down state, one end of the capacitance is electrically connected with the device to be detected, and will The internal resistance of the GPIO interface is set as vacant state, and the capacitance discharges to the device to be detected;
The detection module, which is additionally operable to detect the capacitance, discharges to the device to be detected, until the voltage of the capacitance Value drops to discharge time required when third voltage value, and the resistance value of the device to be detected is obtained according to the discharge time, And the type of the device to be detected is obtained according to the resistance value.
4. polymorphic identifying system as claimed in claim 2, which is characterized in that in one end of the capacitance and the device to be detected Part disconnects, and when the internal resistance of the GPIO interface is pull-up state, and the capacitance charges, until the capacitance Voltage value reach the initial voltage value.
5. polymorphic identifying system as described in claim 1, which is characterized in that the internal resistance includes pull-up resistor and drop-down Resistance;
The GPIO interface includes switch;
The switch includes moved end and non-moving end;
Wherein, the non-moving end is electrically connected with the charging/discharging apparatus and the detection module respectively;
When the internal resistance of the GPIO interface is pull-up state, one end of the pull-up resistor is electrically connected with power end, institute The other end for stating pull-up resistor is electrically connected with the moved end;
When the internal resistance of the GPIO interface is pull-down state, one end of the pull down resistor is electrically connected with the moved end, The other end of the pull down resistor is grounded;
When the internal resistance of the GPIO interface is vacant state, the moved end is in vacant state;
Or, the switch includes the first moved end, the second moved end and non-moving end;
Wherein, the non-moving end is electrically connected with the charging/discharging apparatus and the detection module respectively;
When the internal resistance of the GPIO interface is pull-up state, one end of the pull-up resistor is electrically connected with power end, institute The other end for stating pull-up resistor is electrically connected with first moved end;
When the internal resistance of the GPIO interface is pull-down state, one end of the pull down resistor is electrically connected with second moved end It connects, the other end ground connection of the pull down resistor;
When the internal resistance of the GPIO interface is vacant state, first moved end and second moved end are in vacantly State.
6. polymorphic identifying system as claimed in claim 2, which is characterized in that when the device to be detected is pull-up state, One end of the device to be detected is electrically connected with one end of the capacitance, and the other end of the device to be detected is electrically connected with power end It connects;
When the device to be detected is pull-down state, one end of the device to be detected is electrically connected with one end of the capacitance, The other end of the device to be detected is grounded.
7. a kind of terminal, which is characterized in that the terminal includes the polymorphic identification system described in any one of claim 1-6 System.
8. a kind of polymorphic recognition methods, which is characterized in that the polymorphic recognition methods includes:
GPIO interface is electrically connected with device to be detected, if the level that the GPIO interface detects is high level, it is determined that institute It is pull-up state to state device to be detected;If the level that the GPIO interface detects is low level, it is determined that the device to be detected Part is pull-down state;
Wherein, the different types of device to be detected corresponds to different resistance values;
When the device to be detected be pull-up state, the charging/discharging apparatus is electrically connected with the device to be detected, detection institute It states device to be detected and the required charging time of charging is carried out to the charging/discharging apparatus, waited for according to described in charging time acquisition The resistance value of device is detected, and obtains the type of the device to be detected according to the resistance value;Or,
When the device to be detected be pull-down state, the charging/discharging apparatus is electrically connected with the device to be detected, detection institute It states charging/discharging apparatus and required discharge time of discharging is carried out to the device to be detected, waited for according to described in discharge time acquisition The resistance value of device is detected, and obtains the type of the device to be detected according to the resistance value.
9. polymorphic recognition methods as claimed in claim 8, which is characterized in that the charging/discharging apparatus is capacitance;
One end of the capacitance is electrically connected with the GPIO interface, the other end ground connection of the capacitance;
It is described to be electrically connected the GPIO interface with the device to be detected, if the level that the GPIO interface detects is high electricity It is flat, it is determined that the device to be detected is pull-up state;If the level that the GPIO interface detects is low level, it is determined that institute Stating the step of device to be detected is pull-down state includes:
One end of the capacitance is electrically connected with the device to be detected, and the internal resistance of the GPIO interface is set as hanging Whether state, the voltage value for detecting the capacitance are less than initial voltage value, if not, it is determined that the device to be detected is pull-up shape State;If so, determining that the device to be detected is pull-down state.
10. polymorphic recognition methods as claimed in claim 9, which is characterized in that described when the device to be detected is pull-up shape The charging/discharging apparatus is electrically connected by state with the device to be detected, detects the device to be detected to the charging/discharging apparatus The required charging time of charging is carried out, the resistance value of the device to be detected is obtained according to the charging time, and according to the resistance Value obtains the step of type of the device to be detected and includes:
When the device to be detected is pull-up state, one end of the capacitance and the device to be detected are disconnected, and Set the internal resistance of the GPIO interface to pull-down state, the capacitance discharges, until the voltage value of the capacitance It is zero;
When the voltage value that the capacitance is discharged to the capacitance is zero, the internal resistance of the GPIO interface is set as hanging State, and one end of the capacitance is electrically connected with the device to be detected, the device to be detected fills the capacitance Electricity;
It detects the device to be detected to charge to the capacitance, until when the voltage value of the capacitance reaches second voltage value The required charging time obtains the resistance value of the device to be detected according to the charging time, and obtains institute according to the resistance value State the type of device to be detected;
It is described to work as the device to be detected for pull-down state, the charging/discharging apparatus is electrically connected with the device to be detected, is examined It surveys the charging/discharging apparatus and required discharge time of discharging is carried out to the device to be detected, institute is obtained according to the discharge time The resistance value of device to be detected is stated, and the step of obtaining the type of the device to be detected according to the resistance value includes:
When the device to be detected is pull-down state, one end of the capacitance is electrically connected with the device to be detected, and will The internal resistance of the GPIO interface is set as vacant state, and the capacitance discharges to the device to be detected;
It detects the capacitance to discharge to the device to be detected, until the voltage value of the capacitance drops to third voltage value The discharge time of Shi Suoxu obtains the resistance value of the device to be detected according to the discharge time, and is obtained according to the resistance value The type of the device to be detected.
11. polymorphic recognition methods as claimed in claim 9, which is characterized in that it is described by the GPIO interface with it is described to be checked Device electrical connection is surveyed, if the level that the GPIO interface detects is high level, it is determined that the device to be detected is pull-up shape State;If the level that the GPIO interface detects is low level, it is determined that before the device to be detected is pull-down state step Further include:
One end of the capacitance and the device to be detected are disconnected, and the internal resistance of the GPIO interface is set as Tension state, the capacitance charge, until the voltage value of the capacitance reaches the initial voltage value.
CN201810552935.9A 2018-05-31 2018-05-31 Polymorphic identification method, polymorphic identification system and terminal Active CN108768379B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810552935.9A CN108768379B (en) 2018-05-31 2018-05-31 Polymorphic identification method, polymorphic identification system and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810552935.9A CN108768379B (en) 2018-05-31 2018-05-31 Polymorphic identification method, polymorphic identification system and terminal

Publications (2)

Publication Number Publication Date
CN108768379A true CN108768379A (en) 2018-11-06
CN108768379B CN108768379B (en) 2022-04-05

Family

ID=64001647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810552935.9A Active CN108768379B (en) 2018-05-31 2018-05-31 Polymorphic identification method, polymorphic identification system and terminal

Country Status (1)

Country Link
CN (1) CN108768379B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324498A (en) * 2020-02-26 2020-06-23 维沃移动通信有限公司 Hardware information detection device, identification device and method
CN111959300A (en) * 2020-07-16 2020-11-20 浙江吉智新能源汽车科技有限公司 Charging environment determination method and device, battery management system and charging and replacing station
CN111983437A (en) * 2020-08-25 2020-11-24 深圳市旗开电子有限公司 5G module product GPIO port test circuit and test method
CN112698875A (en) * 2021-01-07 2021-04-23 深圳市广和通无线股份有限公司 Hardware type identification method and device, computer equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090198841A1 (en) * 2008-02-06 2009-08-06 Matsushita Electric Industrial Co., Ltd. Interface detecting circuit and interface detecting method
CN102216918A (en) * 2011-05-30 2011-10-12 华为终端有限公司 Method and apparatus for acquiring device identification information
CN102708077A (en) * 2012-05-25 2012-10-03 华为终端有限公司 State recognition method and state recognition apparatus
CN105306038A (en) * 2015-11-02 2016-02-03 浙江漫思网络科技有限公司 Capacitive sensing touch control key and key judging method thereof
CN106445862A (en) * 2016-09-06 2017-02-22 广州视睿电子科技有限公司 Identification circuit and method of plugging module
CN106556752A (en) * 2015-09-25 2017-04-05 鸿富锦精密工业(武汉)有限公司 GPIO interface circuit for detecting
CN206248782U (en) * 2016-12-12 2017-06-13 广州视源电子科技股份有限公司 Key press detecting circuit

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090198841A1 (en) * 2008-02-06 2009-08-06 Matsushita Electric Industrial Co., Ltd. Interface detecting circuit and interface detecting method
CN102216918A (en) * 2011-05-30 2011-10-12 华为终端有限公司 Method and apparatus for acquiring device identification information
CN102708077A (en) * 2012-05-25 2012-10-03 华为终端有限公司 State recognition method and state recognition apparatus
CN106556752A (en) * 2015-09-25 2017-04-05 鸿富锦精密工业(武汉)有限公司 GPIO interface circuit for detecting
CN105306038A (en) * 2015-11-02 2016-02-03 浙江漫思网络科技有限公司 Capacitive sensing touch control key and key judging method thereof
CN106445862A (en) * 2016-09-06 2017-02-22 广州视睿电子科技有限公司 Identification circuit and method of plugging module
CN206248782U (en) * 2016-12-12 2017-06-13 广州视源电子科技股份有限公司 Key press detecting circuit

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324498A (en) * 2020-02-26 2020-06-23 维沃移动通信有限公司 Hardware information detection device, identification device and method
CN111959300A (en) * 2020-07-16 2020-11-20 浙江吉智新能源汽车科技有限公司 Charging environment determination method and device, battery management system and charging and replacing station
CN111959300B (en) * 2020-07-16 2022-04-22 浙江吉智新能源汽车科技有限公司 Charging environment determination method and device, battery management system and charging and replacing station
CN111983437A (en) * 2020-08-25 2020-11-24 深圳市旗开电子有限公司 5G module product GPIO port test circuit and test method
CN111983437B (en) * 2020-08-25 2023-09-08 深圳市旗开电子有限公司 5G module product GPIO port test circuit and test method
CN112698875A (en) * 2021-01-07 2021-04-23 深圳市广和通无线股份有限公司 Hardware type identification method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN108768379B (en) 2022-04-05

Similar Documents

Publication Publication Date Title
CN108768379A (en) Polymorphic recognition methods, system and terminal
CN103064489B (en) A kind of method and terminal of carrying out internal circuit selection according to USB interface state
CN102393837B (en) USB charger recognition device and method
CN105182154B (en) A kind of USB detection circuit and method
CN104600774B (en) Charging recognition circuit, charging recognition method, data line and mobile terminal
CN103024195B (en) Smart mobile terminal and implementation method of charging of smart mobile terminal
CN105548895B (en) A kind of battery performance test method and device
CN106597143B (en) Test equipment and test method
CN108874708B (en) OTG device, terminal charging method, mobile terminal and computer readable storage medium
CN109254210A (en) Electronic device port type detection method, apparatus, detection circuit and electronic equipment
CN107658916A (en) Cue circuit and electronic equipment
CN208969205U (en) Detect the circuit of pin floating state
CN107452305A (en) A kind of current sensing means detected for screen, system and method
CN114424088A (en) Multifunctional collecting device and operation method thereof
CN105824732A (en) USB detection method and detection system
CN106374309A (en) USB transmission line, mobile terminal and USB charging method
CN103166062B (en) Electronic installation and adapter thereof
CN106300549A (en) Electronic installation and charging method thereof
CN113922465A (en) Interface identification circuit, interface identification method and intelligent terminal
CN106058975A (en) Protection circuit, method and mobile terminal
CN107214145B (en) Electronic equipment and its dust removal method
CN106856289B (en) Electronic equipment and circuit thereof, switching equipment and circuit thereof and signal processing system
CN202798035U (en) Charging mode detection circuit and mobile terminal
CN105762782B (en) A kind of electronic equipment and electrostatic release method
CN106160073B (en) A kind of electronic equipment and its control method

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Building 1, No. 399 Keyuan Road, Zhangjiang hi tech park, Pudong New Area, Shanghai, 201203

Applicant after: Huaqin Technology Co.,Ltd.

Address before: Building 1, No. 399 Keyuan Road, Zhangjiang hi tech park, Pudong New Area, Shanghai, 201203

Applicant before: Huaqin Technology Co.,Ltd.

Address after: Building 1, No. 399 Keyuan Road, Zhangjiang hi tech park, Pudong New Area, Shanghai, 201203

Applicant after: Huaqin Technology Co.,Ltd.

Address before: 201203 Building 1, 399 Zhangyuan Road, Zhangjiang, Pudong New Area, Shanghai

Applicant before: HUAQIN TELECOM TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant