CN108681514A - Equipment detection method, device, storage medium and electronic equipment - Google Patents
Equipment detection method, device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN108681514A CN108681514A CN201810411563.8A CN201810411563A CN108681514A CN 108681514 A CN108681514 A CN 108681514A CN 201810411563 A CN201810411563 A CN 201810411563A CN 108681514 A CN108681514 A CN 108681514A
- Authority
- CN
- China
- Prior art keywords
- voltage
- pins
- serial bus
- bus interface
- universal serial
- 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
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 107
- 238000012790 confirmation Methods 0.000 claims description 16
- 230000005283 ground state Effects 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 14
- 238000000034 method Methods 0.000 claims description 11
- 230000005055 memory storage Effects 0.000 claims 1
- 230000007797 corrosion Effects 0.000 abstract description 10
- 238000005260 corrosion Methods 0.000 abstract description 10
- 230000005611 electricity Effects 0.000 description 23
- 230000006870 function Effects 0.000 description 18
- 238000010586 diagram Methods 0.000 description 11
- 230000002093 peripheral effect Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000002474 experimental method Methods 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000006399 behavior Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 239000003795 chemical substances by application Substances 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000003628 erosive effect Effects 0.000 description 1
- 230000007717 exclusion Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000007788 liquid Substances 0.000 description 1
- 210000004243 sweat Anatomy 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/40—Bus structure
- G06F13/4063—Device-to-bus coupling
- G06F13/4068—Electrical coupling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2213/00—Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F2213/0042—Universal serial bus [USB]
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Power Sources (AREA)
Abstract
The embodiment of the present application discloses a kind of equipment detection method, device, storage medium and electronic equipment, wherein, the embodiment of the present application for the ID pins of Universal Serial Bus Interface by providing a low-voltage, and whether preset value is reached according to the voltage change of ID pins, to judge whether Universal Serial Bus Interface may access external equipment, and then when Universal Serial Bus Interface may access external equipment, a high voltage for external equipment access detection is provided for ID pins, to realize that the access of external equipment detects.Thus, it only needs to provide high voltage in a relatively short period of time for ID pins, and low-voltage is provided for ID pins in longer other times, in contrast, the corrosion that low-voltage brings Universal Serial Bus Interface, the corrosion that high voltage brings Universal Serial Bus Interface is will be far below, almost can be ignored.Thus, it is possible to achieve the purpose that put forward Universal Serial Bus Interface service life.
Description
Technical field
This application involves technical field of electronic equipment, and in particular to a kind of equipment detection method, device, storage medium and electricity
Sub- equipment.
Background technology
Currently, Universal Serial Bus Interface has become the standard configuration interface of the electronic equipments such as tablet computer, mobile phone.Electronics is set
It is standby to be attached by Universal Serial Bus Interface and external equipment, realize the interaction of equipment room.For this purpose, first will be into
The access of row external equipment detects.The relevant technologies can continue in the access detection for realizing external equipment to universal serial bus
The ID pins of interface provide detection voltage.
However, in order to facilitate the use of the user, the Universal Serial Bus Interface of electronic equipment is typically exposed setting, this is just
So that Universal Serial Bus Interface readily accesses corrosive liquid (such as sweat), and it is to continue electrification on ID pins,
It will accelerate the corrosion of Universal Serial Bus Interface, to influence the service life of Universal Serial Bus Interface.
Invention content
The embodiment of the present application provides a kind of equipment detection method, device, storage medium and electronic equipment, can improve logical
With the service life of serial bus interface.
In a first aspect, a kind of equipment detection method for providing of the embodiment of the present application, including:
First voltage is provided for the ID pins of Universal Serial Bus Interface;
Whether the voltage change for detecting the ID pins reaches preset value;
When the voltage change reaches the preset value, provides to access for external equipment for the ID pins and detect
Second voltage, wherein the first voltage be less than the second voltage;
According to the current state of the ID pins, it is determined whether there is external equipment to access the Universal Serial Bus Interface.
Second aspect, a kind of assembly detection apparatus that the embodiment of the present application provides, including:
Voltage provides module, for providing first voltage for the ID pins of Universal Serial Bus Interface;
Whether voltage detection module, the voltage change for detecting the ID pins reach preset value;
The voltage provides module and is additionally operable to when the voltage change reaches the preset value, is carried for the ID pins
For the second voltage for external equipment access detection, wherein the first voltage is less than the second voltage;
Equipment identification module, for according to the ID pins, it is determined whether there is external equipment to access the general serial total
Line interface.
The third aspect, storage medium provided by the embodiments of the present application, is stored thereon with computer program, when the computer
When program is run on computers so that the computer executes the equipment detection method provided such as the application any embodiment.
Fourth aspect, electronic equipment provided by the embodiments of the present application, including processor and memory, the memory have meter
Calculation machine program, the processor is by calling the computer program, for executing as what the application any embodiment provided sets
Standby detection method.
The embodiment of the present application for the ID pins of Universal Serial Bus Interface by providing a low-voltage, and according to ID pins
Voltage change whether reach preset value, to judge whether Universal Serial Bus Interface may access external equipment, in turn
When Universal Serial Bus Interface may access external equipment, a height for external equipment access detection is provided for ID pins
Voltage, to realize that the access of external equipment detects.Thus, it is only necessary to high voltage is provided for ID pins in a relatively short period of time, and
Low-voltage is provided for ID pins in longer other times, in contrast, the corruption that low-voltage brings Universal Serial Bus Interface
Erosion, will be far below the corrosion that high voltage brings Universal Serial Bus Interface, almost can be ignored.Thus, it is possible to reach
Improve the purpose of Universal Serial Bus Interface service life.
Description of the drawings
In order to more clearly explain the technical solutions in the embodiments of the present application, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description is only some embodiments of the present application, for
For those skilled in the art, without creative efforts, it can also be obtained according to these attached drawings other attached
Figure.
Fig. 1 is the application scenarios schematic diagram of equipment detection method provided by the embodiments of the present application.
Fig. 2 is a flow diagram of equipment detection method provided by the embodiments of the present application.
Fig. 3 is the structural schematic diagram of the equipment detection circuit provided in the embodiment of the present application.
Fig. 4 is the exemplary plot for providing first voltage in the embodiment of the present application for ID pins.
Fig. 5 is the exemplary plot for having in the embodiment of the present application external equipment access Universal Serial Bus Interface.
Fig. 6 is the exemplary plot for providing second voltage in the embodiment of the present application for ID pins.
Fig. 7 is the schematic diagram that confirmation message input interface is shown in the embodiment of the present application.
Fig. 8 is another flow diagram of equipment detection method provided by the embodiments of the present application.
Fig. 9 is a structural schematic diagram of assembly detection apparatus provided by the embodiments of the present application.
Figure 10 is a structural schematic diagram of electronic equipment provided by the embodiments of the present application.
Figure 11 is another structural schematic diagram of electronic equipment provided by the embodiments of the present application.
Specific implementation mode
Schema is please referred to, wherein identical component symbol represents identical component, the principle of the application is to implement one
It is illustrated in computing environment appropriate.The following description be based on illustrated by the application specific embodiment, should not be by
It is considered as limitation the application other specific embodiments not detailed herein.
In the following description, the specific embodiment of the application will be with reference to by the step performed by one or multi-section computer
And symbol illustrates, unless otherwise stating clearly.Therefore, these steps and operation will have to mention for several times is executed by computer, this paper institutes
The computer execution of finger includes by representing with the computer processing unit of the electronic signal of the data in a structuring pattern
Operation.This operation is converted at the data or the position being maintained in the memory system of the computer, reconfigurable
Or in addition change the running of the computer in a manner of known to the tester of this field.The data structure that the data are maintained
For the provider location of the memory, there is the specific feature defined in the data format.But the application principle is with above-mentioned text
Word illustrates that be not represented as a kind of limitation, this field tester will appreciate that plurality of step as described below and behaviour
Also it may be implemented in hardware.
Term as used herein " module " can regard the software object to be executed in the arithmetic system as.It is as described herein
Different components, module, engine and service can be regarded as the objective for implementation in the arithmetic system.And device as described herein and side
Method can be implemented in the form of software, can also be implemented on hardware certainly, within the application protection domain.
Term " first ", " second " and " third " in the application etc. is for distinguishing different objects, rather than for retouching
State particular order.In addition, term " comprising " and " having " and their any deformations, it is intended that cover and non-exclusive include.
Such as contain the step of process, method, system, product or the equipment of series of steps or module is not limited to list or
Module, but some embodiments further include the steps that do not list or module or some embodiments further include for these processes,
Method, product or equipment intrinsic other steps or module.
Referenced herein " embodiment " is it is meant that a particular feature, structure, or characteristic described can wrap in conjunction with the embodiments
It is contained at least one embodiment of the application.Each position in the description occur the phrase might not each mean it is identical
Embodiment, nor the independent or alternative embodiment with other embodiments mutual exclusion.Those skilled in the art explicitly and
Implicitly understand, embodiment described herein can be combined with other embodiments.
The embodiment of the present application provides a kind of equipment detection method, and the executive agent of the equipment detection method can be the application
The assembly detection apparatus that embodiment provides, or it is integrated with the electronic equipment of the assembly detection apparatus, wherein equipment detection fills
It sets and the mode of hardware or software may be used realizes.Wherein, electronic equipment can be smart mobile phone, tablet computer, palm electricity
The computer equipments such as brain, laptop or desktop computer.
Fig. 1 is please referred to, Fig. 1 is the application scenarios schematic diagram of equipment detection method provided by the embodiments of the present application, with equipment
For detection device integrates in the electronic device, electronic equipment can provide the first electricity for the ID pins of Universal Serial Bus Interface
Pressure;Whether the voltage change of detection ID pins reaches preset value;It is ID when the voltage change of ID pins reaches preset value
Pin provides the second voltage for external equipment access detection, wherein first voltage is less than second voltage, for example, the second electricity
Pressure is configured as 3.3V, and first voltage is configured as 0.5V;According to the current state of ID pins, it is determined whether there is external equipment to connect
Enter Universal Serial Bus Interface, obtains external equipment access Universal Serial Bus Interface or external equipment does not access general serial
The testing result of bus interface.
Fig. 2 is please referred to, Fig. 2 is the flow diagram of equipment detection method provided by the embodiments of the present application.The application is implemented
The flow for the equipment detection method that example provides can be as follows:
In a step 101, first voltage is provided for the ID pins of Universal Serial Bus Interface.
In the embodiment of the present application, the Universal Serial Bus Interface of electronic equipment is that mini universal serial bus connects in form
Mouth or micro universal serial bus interface support OTG functions.Using OTG functions, electronic equipment can be " host " and " outer
If " two kinds of identity work.
It should be noted that in the embodiment of the present application, external equipment accesses electronic equipment with the identity of " peripheral hardware ", accordingly
, electronic equipment is worked with " host " identity, and by accessing external equipment, it is logical that electronic equipment can carry out data with external equipment
Letter, or expand the function of itself using external equipment.Wherein, external equipment can be USB flash disk, mouse, keyboard, game paddle
And other electronic equipments etc..
For example, by taking electronic equipment is mobile phone as an example, mouse can be accessed to the Universal Serial Bus Interface of mobile phone by user,
Electronic equipment is operated by mouse;USB flash disk can also be accessed to the Universal Serial Bus Interface of mobile phone by user, pass through hand
Machine reads the audio-video document in USB flash disk, carries out the broadcasting of audio-video document, alternatively, storing the file in mobile phone to USB flash disk
In, realize file backup etc..
To realize that OTG functions, the Universal Serial Bus Interface of electronic equipment are provided with 5 pins, pin is defined as follows
Shown in table 1:
VBUS | D- | D+ | ID | GND |
Table 1
Wherein, VBUS is power pins, and for providing power supply to the external equipment of access, D-, D+ are signal pins, are used for
Carry out data transmission with the external equipment of access, GND is grounding pin, and ID pins different cable endpoint for identification is realized
The access detection of external equipment, role zone grade.
In the embodiment of the present application, to realize that the access to external equipment detects, electronic equipment is universal serial bus first
The ID pins of interface provide first voltage.
In a step 102, whether the voltage change of detection ID pins reaches preset value.
It should be noted that the external equipment as " peripheral hardware ", the ID pins ground connection of Universal Serial Bus Interface, than
Such as, the ID pins of external equipment are grounded by a pull down resistor, wherein pull down resistor can be an individual resistance, also may be used
To be that multiple resistance are connected and/or composed in parallel.
In this way, when external equipment accesses electronic equipment, the voltage on electronic equipment ID pins will be by the ID of external equipment
Pin drags down.As a result, in the embodiment of the present application, electronic equipment can be after providing first voltage, according to detection for ID pins
The voltage change of ID pins, to judge whether its Universal Serial Bus Interface has accessed external equipment.
In the embodiment of the present application, after providing first voltage for the ID pins of Universal Serial Bus Interface, electronic equipment
Whether the voltage change of detection ID pins reaches preset value, wherein is detecting that the voltage change of ID pins reaches default
When value, determination may have external equipment to access its Universal Serial Bus Interface, not reached in the voltage change for detecting ID pins
When to preset value, determine that no external equipment accesses its Universal Serial Bus Interface.
As an implementation, electronic equipment the ID pins for its Universal Serial Bus Interface provide first voltage it
Afterwards, voltage detecting is carried out to ID pins in real time, obtains real-time voltage, and calculate the voltage difference of first voltage and the real-time voltage
Value, using the voltage difference being calculated as the voltage change of its ID pin.
It should be noted that the ID pins due to external equipment are grounded, when external equipment accesses the general string of electronic equipment
When row bus interface, the ID pins for making electronic equipment are equally grounded, are 0V by the voltage pull-down of ID pins.Therefore, this Shen
It please will be set as the first electricity for judging whether Universal Serial Bus Interface may access the preset value of external equipment in embodiment
The voltage value of pressure, for example, when the first voltage that electronic equipment is provided in the ID for its Universal Serial Bus Interface is 0.5V, it is aforementioned
Preset value is also configured to 0.5V.
In step 103, it when the voltage change of ID pins reaches preset value, is provided for external equipment for ID pins
Access the second voltage of detection, wherein first voltage is less than second voltage.
In the embodiment of the present application, electronic equipment completes the detection to voltage change on its ID pin, and detects this
Voltage change reaches preset value, namely is to determine when may have external equipment to access its Universal Serial Bus Interface, draws for ID
Foot provides the second voltage for external equipment access detection, that is to say that by ID pins pull-up be high voltage.
It should be noted that in the embodiment of the present application, the first voltage provided before by ID pins, it is currently ID to be less than
The second voltage that pin provides, and the first voltage is to be much smaller than the second voltage.For example, electronic equipment provides for its ID pin
First voltage be 0.5V, and when detecting that the voltage change of ID pins reaches preset value, provided for its ID pin the
Two voltages are 3.3V.
At step 104, according to the current state of ID pins, it is determined whether there is external equipment access universal serial bus to connect
Mouthful.
In the embodiment of the present application, electronic equipment after providing second voltage for ID pins, to the state of its ID pin into
Row detection, obtains the current state of ID pins.Then, according to the current state got, it is determined whether there is external equipment to connect
Enter Universal Serial Bus Interface.
It should be noted that the ID pins due to external equipment are grounded, when external equipment accesses the general string of electronic equipment
When row bus interface, the ID pins for making electronic equipment are equally grounded, in other words, electronic equipment are accessed in external equipment
When Universal Serial Bus Interface, the ID pins of electronic equipment will appear as ground state.
Therefore, in the embodiment of the present application, in the current state according to ID pins, it is determined whether there is external equipment access logical
When with serial bus interface, can detect ID pins current state whether ground state;Wherein, in the current state of ID pins
For ground state when, determine have external equipment access Universal Serial Bus Interface;It is not ground connection shape in the current state of ID pins
When state, determines and access Universal Serial Bus Interface without external equipment.
From the foregoing, it will be observed that the embodiment of the present application is for the ID pins of Universal Serial Bus Interface by providing a low-voltage, and
Whether reach preset value according to the voltage change of ID pins, to judge it is external whether Universal Serial Bus Interface may access
Equipment, and then when Universal Serial Bus Interface may access external equipment, provide one for ID pins and connect for external equipment
The high voltage for entering detection, to realize that the access of external equipment detects.Thus, it is only necessary to be provided in a relatively short period of time for ID pins
High voltage, and low-voltage is provided for ID pins in longer other times, in contrast, low-voltage is to Universal Serial Bus Interface
The corrosion brought will be far below the corrosion that high voltage brings Universal Serial Bus Interface, almost can be ignored.As a result,
It can achieve the purpose that put forward Universal Serial Bus Interface service life.
In one embodiment, the equipment detection circuit for providing a kind of electronic equipment, please refers to Fig. 3, equipment detection electricity
Road includes Universal Serial Bus Interface, single-pole double-throw switch (SPDT), first voltage provides module, second voltage provides module and compares
Device.Wherein, the ID pins of Universal Serial Bus Interface are electrically connected with the input terminal of single-pole double-throw switch (SPDT), the single-pole double-throw switch (SPDT)
One output end is electrically connected with an input terminal of comparator, and also providing module with first voltage is electrically connected, the single-pole double-throw switch (SPDT)
Another output end provides module with second voltage and is electrically connected, and another input terminal and the reference voltage of comparator provide module and be electrically connected
It connects, which provides the reference voltage that module provides and be less than the first voltage that first voltage provides module offer, the first electricity
Pressure provides the first voltage that module is provided and is less than the second voltage that second voltage offer module is provided.
Based on equipment detection circuit shown in Fig. 3, in one embodiment, provided for the ID pins of Universal Serial Bus Interface
First voltage, including:
It controls single-pole double-throw switch (SPDT) and ID pins and first voltage offer module is provided, provide module by first voltage draws for ID
Foot provides first voltage.
Wherein, Fig. 4 is please referred to, when providing first voltage for the ID pins of Universal Serial Bus Interface, electronic equipment can
ID pins and first voltage offer module are connected to control single-pole double-throw switch (SPDT), provide module by first voltage provides for ID pins
First voltage.
For example, first voltage provide module output voltage be 0.5V, by single-pole double-throw switch (SPDT) connect ID pins with
When first voltage provides module, first voltage module will provide the first voltage of 0.5V for ID pins.
In an optional embodiment, if the anode of output end and comparator that single-pole double-throw switch (SPDT) is connect with ID pins
Input terminal connects, and when the negative input connection of reference voltage offer module and comparator, please refers to Fig. 3, as shown in figure 3,
ID pins and second power supply module are not connected in single-pole double-throw switch (SPDT), also do not connect the electrode input end of ID pins and comparator
When logical, first voltage provides module and provides first voltage for the electrode input end of comparator, and it is to compare that reference voltage, which provides module,
The negative input of device provides reference voltage, and since first voltage is more than reference voltage, the output end of comparator will export high electricity
Pressure.
Fig. 4 is please referred to, when single-pole double-throw switch (SPDT) provides first voltage to module and connected with ID pins, first voltage provides
Module will provide first voltage for the electrode input end and ID pins of comparator simultaneously, at this point, the output end of comparator will be still defeated
Go out high voltage.
In another optional embodiment, if output end that single-pole double-throw switch (SPDT) is connect with ID pins and comparator is negative
Pole input terminal connection, and when the electrode input end connection of reference voltage offer module and comparator, Fig. 3 is please referred to, such as Fig. 3 institutes
Show, ID pins and second power supply module are not connected in single-pole double-throw switch (SPDT), also do not input the anode of ID pins and comparator
When termination is logical, first voltage provides module and provides first voltage for the electrode input end of comparator, and reference voltage provides module and is
The negative input of comparator provides reference voltage, and since first voltage is more than reference voltage, the output end of comparator will export
Low-voltage.
Fig. 4 is please referred to, when single-pole double-throw switch (SPDT) provides first voltage to module and connected with ID pins, first voltage provides
Module will provide first voltage for the electrode input end and ID pins of comparator simultaneously, at this point, the output end of comparator will be still defeated
Go out low-voltage.
Based on equipment detection circuit shown in Fig. 3, in one embodiment, whether the voltage change of detection ID pins reaches
Preset value, including:
Whether the output voltage of detection comparator output end changes, wherein when output voltage changes, determines
The voltage change of ID pins reaches preset value.
In an optional embodiment, if the anode of output end and comparator that single-pole double-throw switch (SPDT) is connect with ID pins
Input terminal connects, and when the negative input connection of reference voltage offer module and comparator, please refers to Fig. 3, as shown in figure 3,
ID pins and second power supply module are not connected in single-pole double-throw switch (SPDT), also do not connect the electrode input end of ID pins and comparator
When logical, first voltage provides module and provides first voltage for the electrode input end of comparator, and it is to compare that reference voltage, which provides module,
The negative input of device provides reference voltage, and since first voltage is more than reference voltage, the output end of comparator will export high electricity
Pressure.
Incorporated by reference to reference to Fig. 4, when single-pole double-throw switch (SPDT) provides first voltage to module and connected with ID pins, first voltage
First voltage will be provided for the electrode input end and ID pins of comparator simultaneously by providing module, at this point, the output end of comparator will
Still output HIGH voltage.
If setting preset value to the voltage value of first voltage itself, Fig. 5 is please referred to, is set when there is external equipment access electronics
When standby Universal Serial Bus Interface, the ID pins of Universal Serial Bus Interface and the electrode input end of comparator are connect
Ground, at this point, the voltage of electrode input end will be that 0V (that is to say that the voltage change of ID pins reaches default by first voltage variation
Value), it is low-voltage that the output voltage of comparator will be changed by high voltage.Therefore, electronic equipment is detecting comparator output
When the output voltage at end becomes low-voltage from high voltage, you can determine that the voltage change of ID pins reaches preset value.
In another optional embodiment, if output end that single-pole double-throw switch (SPDT) is connect with ID pins and comparator is negative
Pole input terminal connection, and when the electrode input end connection of reference voltage offer module and comparator, Fig. 3 is please referred to, such as Fig. 3 institutes
Show, ID pins and second power supply module are not connected in single-pole double-throw switch (SPDT), also do not input the anode of ID pins and comparator
When termination is logical, first voltage provides module and provides first voltage for the electrode input end of comparator, and reference voltage provides module and is
The negative input of comparator provides reference voltage, and since first voltage is more than reference voltage, the output end of comparator will export
Low-voltage.
Fig. 4 is please referred to, when single-pole double-throw switch (SPDT) provides first voltage to module and connected with ID pins, first voltage provides
Module will provide first voltage for the electrode input end and ID pins of comparator simultaneously, at this point, the output end of comparator will be still defeated
Go out low-voltage.
If setting preset value to the voltage value of first voltage itself, Fig. 5 is please referred to, is set when there is external equipment access electronics
When standby Universal Serial Bus Interface, the ID pins of Universal Serial Bus Interface and the electrode input end of comparator are connect
Ground, at this point, the voltage of electrode input end will be that 0V (that is to say that the voltage change of ID pins reaches default by first voltage variation
Value), it is high voltage that the output voltage of comparator will be changed by low-voltage.Therefore, electronic equipment is detecting comparator output
When the output voltage at end becomes high voltage from low-voltage, you can determine that the voltage change of ID pins reaches preset value.
Based on the equipment detection circuit described in Fig. 3, in one embodiment, provides to access for external equipment for ID pins and examine
The second voltage of survey, including:
It controls single-pole double-throw switch (SPDT) and ID pins and second voltage offer module is provided, provide module by second voltage draws for ID
Foot provides second voltage.
Wherein, Fig. 6 is please referred to, when providing second voltage for the ID pins of Universal Serial Bus Interface, electronic equipment can
ID pins and second voltage offer module are connected to control single-pole double-throw switch (SPDT), provide module by second voltage provides for ID pins
Second voltage.
For example, second voltage provide module output voltage be 3.3V, by single-pole double-throw switch (SPDT) connect ID pins with
When second voltage provides module, second voltage module will provide the second voltage of 3.3V for ID pins, for realizing external equipment
Access detection.
In one embodiment, after the second voltage for external equipment access detection is provided for ID pins, further include:
The current state for detecting ID pins no longer be ground state when, control single-pole double-throw switch (SPDT) connect ID pins with
First voltage provides module, and provide module by first voltage provides first voltage for ID pins.
In the embodiment of the present application, electronic equipment is determined when the current state for detecting ID pins is no longer ground state
External equipment is extracted from its Universal Serial Bus Interface, is controlled single-pole double-throw switch (SPDT) at this time and is connected ID pins and the first electricity
Pressure provide module, by first voltage provide module provide first voltage for ID pins, with the access next time to external equipment into
Row detection.
In one embodiment, according to the current state of ID pins, it is determined whether there is external equipment to access universal serial bus
After interface, further include:
When there is external equipment to access Universal Serial Bus Interface, supplied to external equipment by Universal Serial Bus Interface
Electricity;
During powering to external equipment, the temperature value of Universal Serial Bus Interface is obtained;
When the temperature value got is located within preset temperature section, stop powering for external equipment.
In the embodiment of the present application, electronic equipment determine there is external equipment to access its Universal Serial Bus Interface when, and it is outer
Portion's equipment establishes electrical connection, and is powered for external equipment by the power pins of its Universal Serial Bus Interface.
It is easily understood that if the temperature of Universal Serial Bus Interface is excessively high, it would be possible to burn universal serial bus and connect
Mouthful, or even the entire electronic equipment of damage.And when it is that external equipment is powered that electronic equipment is by Universal Serial Bus Interface, it will make
The temperature for obtaining its Universal Serial Bus Interface increases rapidly.To avoid causing external equipment power supply the damage of electronic equipment,
In the embodiment of the present application, electronic equipment is total in general serial from being arranged in real time during providing supply voltage to external equipment
The temperature value of Universal Serial Bus Interface is obtained at temperature sensor at line interface, and is getting Universal Serial Bus Interface
Temperature value after, judge the temperature value whether be located at preset temperature section within, wherein be located at preset temperature in the temperature value
When within section, illustrate that the temperature of Universal Serial Bus Interface is excessively high, stops powering to external equipment at this time, avoid general serial
The temperature of bus interface continues to increase.
Wherein it is possible to set preset temperature section to [Tmin ,+∞), Tmin expressions may cause electronic equipment to damage
Lowest temperature angle value, specifically can first pass through experiment in advance and obtain.
For example, preset temperature section be arranged to [60 DEG C ,+∞), if getting the temperature value of Universal Serial Bus Interface
It it is 37 DEG C, then electronic equipment continues as external equipment power supply;If the temperature value for getting Universal Serial Bus Interface is 67 DEG C,
Electronic equipment stops being that external equipment is powered.
In one embodiment, when the temperature value got is located within preset temperature section, stop supplying for external equipment
Electricity, including:
When the temperature value got is located within preset temperature section, confirmation message input interface is shown;
When the confirmation information input interface based on display receives the confirmation message of input, stop supplying for external equipment
Electricity.
In the embodiment of the present application, determine whether to stop by user to be that external equipment is powered.For example, please referring to Fig. 7, electronics is set
It is standby in the temperature value for getting Universal Serial Bus Interface, and when judging that the temperature value is located within preset temperature section, shielding
Curtain display area shows that confirmation message input interface, the confirmation message input interface include "Yes" control and "No" control, and
For prompting the user whether to disconnect and the prompt message of external equipment " Current Temperatures are excessively high, if disconnect peripheral hardware ", user Ke Tong
Click "Yes" control is crossed with input validation information, the input of "No" control is clicked and denies information.Wherein, if electronic equipment receives use
The confirmation message of family input is then disconnected and being electrically connected with external equipment, is stopped as external equipment power supply;If receiving user's input
Deny information, then do not operate, continue as external equipment power supply.
Below by the basis of the method that above-described embodiment describes, further Jie is done to the equipment detection method of the application
It continues.Specifically, please referring to Fig. 3, electronic equipment includes Universal Serial Bus Interface, single-pole double-throw switch (SPDT), first voltage offer mould
Group, second voltage provide module and comparator.Wherein, the ID pins and single-pole double-throw switch (SPDT) of Universal Serial Bus Interface is defeated
Enter end electrical connection, an output end of the single-pole double-throw switch (SPDT) is electrically connected with an input terminal of comparator, is also provided with first voltage
Module is electrically connected, and another output end of the single-pole double-throw switch (SPDT) is electrically connected with second voltage offer module, comparator it is another defeated
Enter end to be electrically connected with reference voltage offer module, which provides the reference voltage that module provides and provide less than first voltage
The first voltage that module provides, first voltage provide the first voltage that module is provided and are provided less than second voltage offer module
Second voltage, please refer to Fig. 8, the detailed process of the equipment detection method is as follows:
In step 201, control single-pole double-throw switch (SPDT) connects ID pins and provides module with first voltage, is carried by first voltage
For module first voltage is provided for ID pins.
In the embodiment of the present application, the Universal Serial Bus Interface of electronic equipment is that mini universal serial bus connects in form
Mouth or micro universal serial bus interface support OTG functions.Using OTG functions, electronic equipment can be " host " and " outer
If " two kinds of identity work.
It should be noted that in the embodiment of the present application, external equipment accesses electronic equipment with the identity of " peripheral hardware ", accordingly
, electronic equipment is worked with " host " identity, and by accessing external equipment, it is logical that electronic equipment can carry out data with external equipment
Letter, or expand the function of itself using external equipment.Wherein, external equipment can be USB flash disk, mouse, keyboard, game paddle
And other electronic equipments etc..
For example, by taking electronic equipment is mobile phone as an example, mouse can be accessed to the Universal Serial Bus Interface of mobile phone by user,
Electronic equipment is operated by mouse;USB flash disk can also be accessed to the Universal Serial Bus Interface of mobile phone by user, pass through hand
Machine reads the audio-video document in USB flash disk, carries out the broadcasting of audio-video document, alternatively, storing the file in mobile phone to USB flash disk
In, realize file backup etc..
To realize that OTG functions, the Universal Serial Bus Interface of electronic equipment are provided with 5 pins, pin definition such as table 1
It is shown.
In the embodiment of the present application, to realize that the access to external equipment detects, electronic equipment is universal serial bus first
The ID pins of interface provide first voltage.
Wherein, Fig. 4 is please referred to, when providing first voltage for the ID pins of Universal Serial Bus Interface, electronic equipment can
ID pins and first voltage offer module are connected to control single-pole double-throw switch (SPDT), provide module by first voltage provides for ID pins
First voltage.
For example, first voltage provide module output voltage be 0.5V, by single-pole double-throw switch (SPDT) connect ID pins with
When first voltage provides module, first voltage module will provide the first voltage of 0.5V for ID pins.
In an optional embodiment, if the anode of output end and comparator that single-pole double-throw switch (SPDT) is connect with ID pins
Input terminal connects, and when the negative input connection of reference voltage offer module and comparator, please refers to Fig. 3, as shown in figure 3,
ID pins and second power supply module are not connected in single-pole double-throw switch (SPDT), also do not connect the electrode input end of ID pins and comparator
When logical, first voltage provides module and provides first voltage for the electrode input end of comparator, and it is to compare that reference voltage, which provides module,
The negative input of device provides reference voltage, and since first voltage is more than reference voltage, the output end of comparator will export high electricity
Pressure.
Fig. 4 is please referred to, when single-pole double-throw switch (SPDT) provides first voltage to module and connected with ID pins, first voltage provides
Module will provide first voltage for the electrode input end and ID pins of comparator simultaneously, at this point, the output end of comparator will be still defeated
Go out high voltage.
In another optional embodiment, if output end that single-pole double-throw switch (SPDT) is connect with ID pins and comparator is negative
Pole input terminal connection, and when the electrode input end connection of reference voltage offer module and comparator, Fig. 3 is please referred to, such as Fig. 3 institutes
Show, ID pins and second power supply module are not connected in single-pole double-throw switch (SPDT), also do not input the anode of ID pins and comparator
When termination is logical, first voltage provides module and provides first voltage for the electrode input end of comparator, and reference voltage provides module and is
The negative input of comparator provides reference voltage, and since first voltage is more than reference voltage, the output end of comparator will export
Low-voltage.
Fig. 4 is please referred to, when single-pole double-throw switch (SPDT) provides first voltage to module and connected with ID pins, first voltage provides
Module will provide first voltage for the electrode input end and ID pins of comparator simultaneously, at this point, the output end of comparator will be still defeated
Go out low-voltage.
In step 202, whether the output voltage of detection comparator output end changes.
It should be noted that the external equipment as " peripheral hardware ", the ID pins ground connection of Universal Serial Bus Interface, than
Such as, the ID pins of external equipment are grounded by a pull down resistor, wherein pull down resistor can be an individual resistance, also may be used
To be that multiple resistance are connected and/or composed in parallel.
In this way, when external equipment accesses electronic equipment, the voltage on electronic equipment ID pins will be by the ID of external equipment
Pin drags down.As a result, in the embodiment of the present application, electronic equipment can be after providing first voltage, according to detection for ID pins
The voltage change of ID pins, to judge whether its Universal Serial Bus Interface has accessed external equipment.
In the embodiment of the present application, after providing first voltage for the ID pins of Universal Serial Bus Interface, electronic equipment
Whether the voltage change of detection ID pins reaches preset value, wherein is detecting that the voltage change of ID pins reaches default
When value, determination may have external equipment to access its Universal Serial Bus Interface, not reached in the voltage change for detecting ID pins
When to preset value, determine that no external equipment accesses its Universal Serial Bus Interface.
As an implementation, electronic equipment the ID pins for its Universal Serial Bus Interface provide first voltage it
Afterwards, voltage detecting is carried out to ID pins in real time, obtains real-time voltage, and calculate the voltage difference of first voltage and the real-time voltage
Value, using the voltage difference being calculated as the voltage change of its ID pin.
It should be noted that the ID pins due to external equipment are grounded, when external equipment accesses the general string of electronic equipment
When row bus interface, the ID pins for making electronic equipment are equally grounded, are 0V by the voltage pull-down of ID pins.Therefore, this Shen
It please will be set as the first electricity for judging whether Universal Serial Bus Interface may access the preset value of external equipment in embodiment
The voltage value of pressure, for example, when the first voltage that electronic equipment is provided in the ID for its Universal Serial Bus Interface is 0.5V, it is aforementioned
Preset value is also configured to 0.5V.
In one embodiment, if the electrode input end of output end and comparator that single-pole double-throw switch (SPDT) is connect with ID pins
Connection, and when the negative input connection of reference voltage offer module and comparator, Fig. 3 is please referred to, as shown in figure 3, in hilted broadsword
Commutator does not connect ID pins and second power supply module, when also the electrode input end of ID pins and comparator not being connected,
First voltage provides module and provides first voltage for the electrode input end of comparator, and it is the negative of comparator that reference voltage, which provides module,
Pole input terminal provides reference voltage, and since first voltage is more than reference voltage, the output end of comparator is by output HIGH voltage.
Incorporated by reference to reference to Fig. 4, when single-pole double-throw switch (SPDT) provides first voltage to module and connected with ID pins, first voltage
First voltage will be provided for the electrode input end and ID pins of comparator simultaneously by providing module, at this point, the output end of comparator will
Still output HIGH voltage.
If setting preset value to the voltage value of first voltage itself, Fig. 5 is please referred to, is set when there is external equipment access electronics
When standby Universal Serial Bus Interface, the ID pins of Universal Serial Bus Interface and the electrode input end of comparator are connect
Ground, at this point, the voltage of electrode input end will be that 0V (that is to say that the voltage change of ID pins reaches default by first voltage variation
Value), it is low-voltage that the output voltage of comparator will be changed by high voltage.Therefore, electronic equipment is detecting comparator output
When the output voltage at end becomes low-voltage from high voltage, you can determine that the voltage change of ID pins reaches preset value.
In another embodiment, if the cathode input of output end and comparator that single-pole double-throw switch (SPDT) is connect with ID pins
End connection, and when the electrode input end connection of reference voltage offer module and comparator, Fig. 3 is please referred to, as shown in figure 3, in list
Double-pole double throw switch does not connect ID pins and second power supply module, does not also connect the electrode input end of ID pins and comparator
When, first voltage provides module and provides first voltage for the electrode input end of comparator, and it is comparator that reference voltage, which provides module,
Negative input reference voltage is provided, since first voltage is more than reference voltage, the output end of comparator will export low-voltage.
Fig. 4 is please referred to, when single-pole double-throw switch (SPDT) provides first voltage to module and connected with ID pins, first voltage provides
Module will provide first voltage for the electrode input end and ID pins of comparator simultaneously, at this point, the output end of comparator will be still defeated
Go out low-voltage.
If setting preset value to the voltage value of first voltage itself, Fig. 5 is please referred to, is set when there is external equipment access electronics
When standby Universal Serial Bus Interface, the ID pins of Universal Serial Bus Interface and the electrode input end of comparator are connect
Ground, at this point, the voltage of electrode input end will be that 0V (that is to say that the voltage change of ID pins reaches default by first voltage variation
Value), it is high voltage that the output voltage of comparator will be changed by low-voltage.Therefore, electronic equipment is detecting comparator output
When the output voltage at end becomes high voltage from low-voltage, you can determine that the voltage change of ID pins reaches preset value.
In step 203, when output voltage changes, control single-pole double-throw switch (SPDT) connects ID pins and second voltage
Module is provided, provide module by second voltage provides second voltage for ID pins.
In the embodiment of the present application, electronic equipment completes the detection to voltage change on its ID pin, and detects this
Voltage change reaches preset value, namely is to determine when may have external equipment to access its Universal Serial Bus Interface, draws for ID
Foot provides the second voltage for external equipment access detection, that is to say that by ID pins pull-up be high voltage.
It should be noted that in the embodiment of the present application, the first voltage provided before by ID pins, it is currently ID to be less than
The second voltage that pin provides, and the first voltage is to be much smaller than the second voltage.For example, electronic equipment provides for its ID pin
First voltage be 0.5V, and when detecting that the voltage change of ID pins reaches preset value, provided for its ID pin the
Two voltages are 3.3V.
In the embodiment of the present application, electronic equipment completes the detection to voltage change on its ID pin, and detects this
Voltage change reaches preset value, namely is to determine when may have external equipment to access its Universal Serial Bus Interface, draws for ID
Foot provides the second voltage for external equipment access detection, that is to say that by ID pins pull-up be high voltage.
It should be noted that in the embodiment of the present application, the first voltage provided before by ID pins, it is currently ID to be less than
The second voltage that pin provides, and the first voltage is to be much smaller than the second voltage.For example, electronic equipment provides for its ID pin
First voltage be 0.5V, and when detecting that the voltage change of ID pins reaches preset value, provided for its ID pin the
Two voltages are 3.3V.
Wherein, Fig. 6 is please referred to, when providing second voltage for the ID pins of Universal Serial Bus Interface, electronic equipment can
ID pins and second voltage offer module are connected to control single-pole double-throw switch (SPDT), provide module by second voltage provides for ID pins
Second voltage.
For example, second voltage provide module output voltage be 3.3V, by single-pole double-throw switch (SPDT) connect ID pins with
When second voltage provides module, second voltage module will provide the second voltage of 3.3V for ID pins, for realizing external equipment
Access detection.
In step 204, whether the current state of detection ID pins is ground state.
It should be noted that the ID pins due to external equipment are grounded, when external equipment accesses the general string of electronic equipment
When row bus interface, the ID pins for making electronic equipment are equally grounded, in other words, electronic equipment are accessed in external equipment
When Universal Serial Bus Interface, the ID pins of electronic equipment will appear as ground state.
It therefore, in the embodiment of the present application, can be according to the current state of ID pins, to determine whether that external equipment connects
Enter Universal Serial Bus Interface, wherein can detect ID pins current state whether ground state, in the current shape of ID pins
When state is ground state, determining has external equipment to access Universal Serial Bus Interface, is not ground connection in the current state of ID pins
When state, determines and access Universal Serial Bus Interface without external equipment.
In step 205, when the current state of ID pins is ground state, determining has external equipment to access general serial
Bus interface, and powered to external equipment by Universal Serial Bus Interface.
In the embodiment of the present application, electronic equipment determine there is external equipment to access its Universal Serial Bus Interface when, and it is outer
Portion's equipment establishes electrical connection, and is powered for external equipment by the power pins of its Universal Serial Bus Interface.
In step 206, during powering to external equipment, the temperature value of Universal Serial Bus Interface is obtained;
It is easily understood that if the temperature of Universal Serial Bus Interface is excessively high, it would be possible to burn universal serial bus and connect
Mouthful, or even the entire electronic equipment of damage.And when it is that external equipment is powered that electronic equipment is by Universal Serial Bus Interface, it will make
The temperature for obtaining its Universal Serial Bus Interface increases rapidly.To avoid causing external equipment power supply the damage of electronic equipment,
In the embodiment of the present application, electronic equipment is total in general serial from being arranged in real time during providing supply voltage to external equipment
The temperature value that Universal Serial Bus Interface is obtained at temperature sensor at line interface, to judge the temperature of Universal Serial Bus Interface
Whether degree is excessively high.
In step 207, when the temperature value got is located within preset temperature section, stop supplying for external equipment
Electricity.
In the embodiment of the present application, after getting the temperature value of Universal Serial Bus Interface, whether the temperature value is judged
Within preset temperature section, wherein when the temperature value is located within preset temperature section, illustrate that universal serial bus connects
The temperature of mouth is excessively high, stops powering to external equipment at this time, the temperature of Universal Serial Bus Interface is avoided to continue to increase.
Wherein it is possible to set preset temperature section to [Tmin ,+∞), Tmin expressions may cause electronic equipment to damage
Lowest temperature angle value, specifically can first pass through experiment in advance and obtain.
For example, preset temperature section be arranged to [60 DEG C ,+∞), if getting the temperature value of Universal Serial Bus Interface
It it is 37 DEG C, then electronic equipment continues as external equipment power supply;If the temperature value for getting Universal Serial Bus Interface is 67 DEG C,
Electronic equipment stops being that external equipment is powered.
In one embodiment, a kind of assembly detection apparatus is additionally provided, Fig. 9 is please referred to, Fig. 9 provides for the embodiment of the present application
Assembly detection apparatus structural schematic diagram.Wherein the assembly detection apparatus is applied to electronic equipment, the assembly detection apparatus packet
It includes voltage and module 401, voltage detection module 402 and equipment identification module 403 is provided, it is as follows:
Voltage provides module 401, for providing first voltage for the ID pins of Universal Serial Bus Interface;
Whether voltage detection module 402, the voltage change for detecting ID pins reach preset value;
Voltage provides module 401, is additionally operable to, when the voltage change of ID pins reaches preset value, use be provided for ID pins
In the second voltage of external equipment access detection, wherein first voltage is less than second voltage;
Equipment identification module 403, for the current state according to ID pins, it is determined whether there is external equipment to access general string
Row bus interface.
In one embodiment, the equipment detection circuit for providing a kind of electronic equipment, please refers to Fig. 3, equipment detection electricity
Road includes Universal Serial Bus Interface, single-pole double-throw switch (SPDT), first voltage provides module, second voltage provides module and compares
Device.Wherein, the ID pins of Universal Serial Bus Interface are electrically connected with the input terminal of single-pole double-throw switch (SPDT), the single-pole double-throw switch (SPDT)
One output end is electrically connected with an input terminal of comparator, and also providing module with first voltage is electrically connected, the single-pole double-throw switch (SPDT)
Another output end provides module with second voltage and is electrically connected, and another input terminal and the reference voltage of comparator provide module and be electrically connected
It connects, which provides the reference voltage that module provides and be less than the first voltage that first voltage provides module offer, the first electricity
Pressure provides the first voltage that module is provided and is less than the second voltage that second voltage offer module is provided.
Based on equipment detection circuit shown in Fig. 3, in one embodiment, voltage provides module 401 and is specifically used for:
It controls single-pole double-throw switch (SPDT) and ID pins and first voltage offer module is provided, provide module by first voltage draws for ID
Foot provides first voltage.
Based on equipment detection circuit shown in Fig. 3, in one embodiment, voltage detection module 402 is specifically used for:
Whether the output voltage of detection comparator output end changes, wherein when output voltage changes, determines
The voltage change of ID pins reaches preset value.
Based on equipment detection circuit shown in Fig. 3, in one embodiment, voltage provide module 401 also particularly useful for:
It controls single-pole double-throw switch (SPDT) and ID pins and second voltage offer module is provided, provide module by second voltage draws for ID
Foot provides second voltage.
In one embodiment, equipment identification module 403 is specifically used for:
Detect ID pins current state whether ground state, wherein ID pins current state be ground state when,
Determining has external equipment to access Universal Serial Bus Interface.
In one embodiment, voltage provides module 401 and is additionally operable to:
When there is external equipment to access Universal Serial Bus Interface, supplied to external equipment by Universal Serial Bus Interface
Electricity;
During powering to external equipment, the temperature value of Universal Serial Bus Interface is obtained;
When the temperature value got is located within preset temperature section, stop powering for external equipment.
In one embodiment, voltage provide module 401 also particularly useful for:
When the temperature value got is located within preset temperature section, confirmation message input interface is shown;
When the confirmation information input interface based on display receives the confirmation message of input, stop supplying for external equipment
Electricity.
When it is implemented, the above modules can be used as independent entity to realize, arbitrary combination can also be carried out, as
Same or several entities realize that the specific implementation of above each unit can be found in the embodiment of front, and details are not described herein.
From the foregoing, it will be observed that it is Universal Serial Bus Interface that the present embodiment assembly detection apparatus can be provided module 401 by voltage
ID pins provide first voltage;Whether the voltage change that ID pins are detected by voltage detection module 402 reaches preset value;By
Voltage provides module 401 when the voltage change of ID pins reaches preset value, provides for ID pins and is accessed for external equipment
The second voltage of detection, wherein first voltage is less than second voltage;By equipment identification module 403 according to the current shape of ID pins
State, it is determined whether there is external equipment to access Universal Serial Bus Interface.In the program, pass through the ID for Universal Serial Bus Interface
Pin provides a low-voltage, and whether reaches preset value according to the voltage change of ID pins, to judge universal serial bus
Whether interface may access external equipment, and then when Universal Serial Bus Interface may access external equipment, be ID pins
A high voltage for external equipment access detection is provided, to realize that the access of external equipment detects.Thus, it is only necessary to compared with
High voltage is provided for ID pins in the short time, and low-voltage is provided for ID pins in longer other times, it is in contrast, low
The corrosion that voltage brings Universal Serial Bus Interface will be far below the corrosion that high voltage brings Universal Serial Bus Interface,
Almost it can be ignored.Thus, it is possible to achieve the purpose that put forward Universal Serial Bus Interface service life.
The embodiment of the present application also provides a kind of electronic equipment.Please refer to Figure 10, electronic equipment 500 include processor 501 with
And memory 502.Wherein, processor 501 is electrically connected with memory 502.
Processor 500 is the control centre of electronic equipment 500, utilizes various interfaces and the entire electronic equipment of connection
Various pieces by the computer program of operation or load store in memory 502, and are called and are stored in memory 502
Interior data execute the various functions of electronic equipment 500 and handle data.
Memory 502 can be used for storing software program and module, and processor 501 is stored in memory 502 by operation
Computer program and module, to perform various functions application and data processing.Memory 502 can include mainly storage
Program area and storage data field, wherein storing program area can storage program area, the computer program needed at least one function
(such as sound-playing function, image player function etc.) etc.;Storage data field can be stored to be created according to using for electronic equipment
Data etc..In addition, memory 502 may include high-speed random access memory, can also include nonvolatile memory, example
Such as at least one disk memory, flush memory device or other volatile solid-state parts.Correspondingly, memory 502 may be used also
To include Memory Controller, to provide access of the processor 501 to memory 502.
In the embodiment of the present application, the processor 501 in electronic equipment 500 can be according to following step, by one or one
The corresponding instruction of process of a above computer program is loaded into memory 502, and is stored in by the operation of processor 501
Computer program in reservoir 502, it is as follows to realize various functions:
First voltage is provided for the ID pins of Universal Serial Bus Interface;
Whether the voltage change of detection ID pins reaches preset value;
When the voltage change of ID pins reaches preset value, for external equipment access detection is provided for ID pins
Two voltages, wherein first voltage is less than second voltage;
According to the current state of ID pins, it is determined whether there is external equipment to access Universal Serial Bus Interface.
From the foregoing, it will be observed that the embodiment of the present application is for the ID pins of Universal Serial Bus Interface by providing a low-voltage, and
Whether reach preset value according to the voltage change of ID pins, to judge it is external whether Universal Serial Bus Interface may access
Equipment, and then when Universal Serial Bus Interface may access external equipment, provide one for ID pins and connect for external equipment
The high voltage for entering detection, to realize that the access of external equipment detects.Thus, it is only necessary to be provided in a relatively short period of time for ID pins
High voltage, and low-voltage is provided for ID pins in longer other times, in contrast, low-voltage is to Universal Serial Bus Interface
The corrosion brought will be far below the corrosion that high voltage brings Universal Serial Bus Interface, almost can be ignored.As a result,
It can achieve the purpose that put forward Universal Serial Bus Interface service life.
Please with reference to Figure 11, in some embodiments, electronic equipment 500 can also include:Display 503, radio frequency
Circuit 504, voicefrequency circuit 505, power supply 506 and equipment detection circuit 507.Wherein, wherein display 503, radio circuit
504, voicefrequency circuit 505 and power supply 506 are electrically connected with processor 501 respectively.
Display 503 is displayed for information input by user or the information of user and various figures is supplied to use
Family interface, these graphical user interface can be made of figure, text, icon, video and its arbitrary combination.Display 503
May include display panel, in some embodiments, may be used liquid crystal display (Liquid Crystal Display,
LCD) or the forms such as Organic Light Emitting Diode (Organic Light-Emitting Diode, OLED) configure display surface
Plate.
Radio circuit 504 can be used for transceiving radio frequency signal, to be set by radio communication with the network equipment or other electronics
It is standby to establish wireless telecommunications, the receiving and transmitting signal between the network equipment or other electronic equipments.
Voicefrequency circuit 505 can be used for providing the audio interface between user and electronic equipment by loud speaker, microphone.
Power supply 506 is used to all parts power supply of electronic equipment 500.In some embodiments, power supply 506 can be with
It is logically contiguous by power-supply management system and processor 501, to by power-supply management system realize management charging, electric discharge, with
And the functions such as power managed.
Fig. 3 is please referred to, equipment detection circuit is carried including 507 Universal Serial Bus Interface, single-pole double-throw switch (SPDT), first voltage
Module and comparator are provided for module, second voltage.Wherein, the ID pins and single-pole double-throw switch (SPDT) of Universal Serial Bus Interface
Input terminal electrical connection, an output end of the single-pole double-throw switch (SPDT) be electrically connected with an input terminal of comparator, and and first voltage
Module electrical connection is provided, another output end of the single-pole double-throw switch (SPDT) is electrically connected with second voltage offer module, comparator it is another
One input terminal provides module with reference voltage and is electrically connected, which provides the reference voltage that module provides and be less than first voltage
The first voltage that module provides is provided, first voltage provides the first voltage that module is provided and is less than second voltage offer module institute
The second voltage of offer.
Although being not shown in Figure 11, electronic equipment 500 can also include camera, bluetooth module etc., and details are not described herein.
In some embodiments, when providing first voltage for the ID pins of Universal Serial Bus Interface, processor 501
Following steps can be executed:
It controls single-pole double-throw switch (SPDT) and ID pins and first voltage offer module is provided, provide module by first voltage draws for ID
Foot provides first voltage.
In some embodiments, when whether the voltage change for detecting ID pins reaches preset value, processor 501 can
To execute following steps:
Whether the output voltage of detection comparator output end changes, wherein when output voltage changes, determines
The voltage change of ID pins reaches preset value.
In some embodiments, when providing the second voltage for external equipment access detection for ID pins, processing
Device 501 can execute following steps:
It controls single-pole double-throw switch (SPDT) and ID pins and second voltage offer module is provided, provide module by second voltage draws for ID
Foot provides second voltage.
In some embodiments, in the current state according to ID pins, it is determined whether there is external equipment to access general string
When row bus interface, processor 501 can execute following steps:
Detect ID pins current state whether ground state, wherein ID pins current state be ground state when,
Determining has external equipment to access Universal Serial Bus Interface.
In some embodiments, in the current state according to ID pins, it is determined whether there is external equipment to access general string
After row bus interface, following steps can also be performed in processor 501:
When there is external equipment to access Universal Serial Bus Interface, supplied to external equipment by Universal Serial Bus Interface
Electricity;
During powering to external equipment, the temperature value of Universal Serial Bus Interface is obtained;
When the temperature value got is located within preset temperature section, stop powering for external equipment.
In some embodiments, when the temperature value got is located within preset temperature section, stop as outside
When equipment is powered, following steps can also be performed in processor 501:
When the temperature value got is located within preset temperature section, confirmation message input interface is shown;
When the confirmation information input interface based on display receives the confirmation message of input, stop supplying for external equipment
Electricity.
The embodiment of the present application also provides a kind of storage medium, and the storage medium is stored with computer program, when the meter
When calculation machine program is run on computers so that the computer executes the equipment detection method in any of the above-described embodiment, than
Such as:First voltage is provided for the ID pins of Universal Serial Bus Interface;Whether the voltage change of detection ID pins reaches default
Value;When the voltage change of ID pins reaches preset value, the second electricity for external equipment access detection is provided for ID pins
Pressure, wherein first voltage is less than second voltage;According to the current state of ID pins, it is determined whether there is external equipment access general
Serial bus interface.
In the embodiment of the present application, storage medium can be magnetic disc, CD, read-only memory (Read Only Memory,
ROM) or random access memory (Random Access Memory, RAM) etc..
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, it may refer to the associated description of other embodiment.
It should be noted that for the equipment detection method of the embodiment of the present application, those of ordinary skill in the art can be with
The all or part of flow for understanding the equipment detection method for realizing the embodiment of the present application, is that can be controlled by computer program
Relevant hardware is completed, and the computer program can be stored in a computer read/write memory medium, be such as stored in electronics
It in the memory of equipment, and is executed, may include in the process of implementation such as equipment by least one processor in the electronic equipment
The flow of the embodiment of detection method.Wherein, the storage medium can be magnetic disc, CD, read-only memory, arbitrary access note
Recall body etc..
For the assembly detection apparatus of the embodiment of the present application, each function module can be integrated in a processing chip
In, can also be that modules physically exist alone, can also two or more modules be integrated in a module.It is above-mentioned
The form that hardware had both may be used in integrated module is realized, can also be realized in the form of software function module.It is described integrated
If module realized in the form of software function module and when sold or used as an independent product, one can also be stored in
In a computer read/write memory medium, the storage medium is for example read-only memory, disk or CD etc..
A kind of equipment detection method, device, storage medium and the electronic equipment that the embodiment of the present application is provided above into
It has gone and has been discussed in detail, specific examples are used herein to illustrate the principle and implementation manner of the present application, the above implementation
The explanation of example is merely used to help understand the present processes and its core concept;Meanwhile for those skilled in the art, according to
According to the thought of the application, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification
It should not be construed as the limitation to the application.
Claims (10)
1. a kind of equipment detection method, which is characterized in that including:
First voltage is provided for the ID pins of Universal Serial Bus Interface;
Whether the voltage change for detecting the ID pins reaches preset value;
When the voltage change reaches the preset value, for external equipment access detection is provided for the ID pins
Two voltages, wherein the first voltage is less than the second voltage;
According to the current state of the ID pins, it is determined whether there is external equipment to access the Universal Serial Bus Interface.
2. equipment detection method as described in claim 1, which is characterized in that the input of the ID pins and single-pole double-throw switch (SPDT)
End electrical connection, an output end of the single-pole double-throw switch (SPDT) are electrically connected with an input terminal of comparator, are also provided with first voltage
Module is electrically connected, and another output end and the second voltage of the single-pole double-throw switch (SPDT) provide module and be electrically connected, the comparator
Another input terminal provides module with reference voltage and is electrically connected, and the reference voltage provides the reference voltage of module offer less than described
First voltage, and whether the voltage change for detecting the ID pins reaches preset value, including:
Whether the output voltage for detecting the comparator output terminal changes, wherein when the output voltage changes,
Determine that the voltage change reaches the preset value.
3. equipment detection method as claimed in claim 2, which is characterized in that provided for the ID pins of Universal Serial Bus Interface
First voltage, including:
It controls the single-pole double-throw switch (SPDT) and the ID pins and first voltage offer module is provided, carried by the first voltage
For module first voltage is provided for the ID pins.
4. equipment detection method as claimed in claim 2, which is characterized in that second voltage is provided for the ID pins, including:
It controls the single-pole double-throw switch (SPDT) and the ID pins and second voltage offer module is provided, carried by the second voltage
For module second voltage is provided for the ID pins.
5. equipment detection method as claimed in claim 2, which is characterized in that according to the current state of the ID pins, determine
Whether there is external equipment to access the Universal Serial Bus Interface, including:
Whether the current state for detecting the ID pins is ground state, wherein when the current state is ground state, really
There is external equipment to access the Universal Serial Bus Interface surely.
6. equipment detection method as described in any one in claim 1-5, which is characterized in that according to the current shape of the ID pins
State, it is determined whether there is external equipment to access after the Universal Serial Bus Interface, further include:
When there is external equipment to access the Universal Serial Bus Interface, by the Universal Serial Bus Interface to the outside
Equipment is powered;
During powering to the external equipment, the temperature value of the Universal Serial Bus Interface is obtained;
When the temperature value is located within preset temperature section, stop powering for the external equipment.
7. equipment detection method as claimed in claim 6, which is characterized in that the temperature value be located at preset temperature section it
When interior, stop powering for the external equipment, including:
When the temperature value is located within preset temperature section, confirmation message input interface is shown;
When receiving the confirmation message of input based on the confirmation message input interface, stop powering for external equipment.
8. a kind of assembly detection apparatus, which is characterized in that including:
Voltage provides module, for providing first voltage for the ID pins of Universal Serial Bus Interface;
Whether voltage detection module, the voltage change for detecting the ID pins reach preset value;
The voltage provides module and is additionally operable to when the voltage change reaches the preset value, and use is provided for the ID pins
In the second voltage of external equipment access detection, wherein the first voltage is less than the second voltage;
Equipment identification module, for the current state according to the ID pins, it is determined whether have external equipment access described general
Serial bus interface.
9. a kind of storage medium, is stored thereon with computer program, which is characterized in that when the computer program on computers
When operation so that the computer executes equipment detection method as described in any one of claim 1 to 7.
10. a kind of electronic equipment, including processor and memory, the memory storage have computer program, which is characterized in that
The processor is by calling the computer program, for executing equipment detection side as described in any one of claim 1 to 7
Method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810411563.8A CN108681514B (en) | 2018-05-02 | 2018-05-02 | Device detection method and device, storage medium and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810411563.8A CN108681514B (en) | 2018-05-02 | 2018-05-02 | Device detection method and device, storage medium and electronic device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108681514A true CN108681514A (en) | 2018-10-19 |
CN108681514B CN108681514B (en) | 2020-04-10 |
Family
ID=63801834
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810411563.8A Expired - Fee Related CN108681514B (en) | 2018-05-02 | 2018-05-02 | Device detection method and device, storage medium and electronic device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108681514B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110022573A (en) * | 2019-04-15 | 2019-07-16 | Oppo广东移动通信有限公司 | Smart card detection method and electronic equipment |
CN111241023A (en) * | 2020-01-19 | 2020-06-05 | 惠州Tcl移动通信有限公司 | Insertion detection circuit and method of flash memory card, and electronic device |
CN113055515A (en) * | 2021-03-04 | 2021-06-29 | Oppo广东移动通信有限公司 | Ultra-wideband data transmission method and equipment support |
CN113113958A (en) * | 2020-01-09 | 2021-07-13 | 广东小天才科技有限公司 | Charger and access detection method of to-be-charged equipment |
WO2022179305A1 (en) * | 2021-02-23 | 2022-09-01 | Oppo广东移动通信有限公司 | Data communication method and apparatus, and storage medium, electronic device and protective sleeve |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN204391372U (en) * | 2015-01-07 | 2015-06-10 | 浙江大学 | The portable wiring board of easily extensible |
CN205721762U (en) * | 2016-03-31 | 2016-11-23 | 维沃移动通信有限公司 | The interface circuit of general-purpose serial bus USB interface and portable terminal |
CN106374581A (en) * | 2016-10-31 | 2017-02-01 | 维沃移动通信有限公司 | Voltage output method for charger and charger |
US20170124010A1 (en) * | 2015-08-21 | 2017-05-04 | Apple Inc. | Contact corrosion mitigation |
CN106648857A (en) * | 2016-11-29 | 2017-05-10 | 维沃移动通信有限公司 | Method for starting OTG function of mobile terminal and mobile terminal |
-
2018
- 2018-05-02 CN CN201810411563.8A patent/CN108681514B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN204391372U (en) * | 2015-01-07 | 2015-06-10 | 浙江大学 | The portable wiring board of easily extensible |
US20170124010A1 (en) * | 2015-08-21 | 2017-05-04 | Apple Inc. | Contact corrosion mitigation |
CN205721762U (en) * | 2016-03-31 | 2016-11-23 | 维沃移动通信有限公司 | The interface circuit of general-purpose serial bus USB interface and portable terminal |
CN106374581A (en) * | 2016-10-31 | 2017-02-01 | 维沃移动通信有限公司 | Voltage output method for charger and charger |
CN106648857A (en) * | 2016-11-29 | 2017-05-10 | 维沃移动通信有限公司 | Method for starting OTG function of mobile terminal and mobile terminal |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110022573A (en) * | 2019-04-15 | 2019-07-16 | Oppo广东移动通信有限公司 | Smart card detection method and electronic equipment |
CN113113958A (en) * | 2020-01-09 | 2021-07-13 | 广东小天才科技有限公司 | Charger and access detection method of to-be-charged equipment |
CN111241023A (en) * | 2020-01-19 | 2020-06-05 | 惠州Tcl移动通信有限公司 | Insertion detection circuit and method of flash memory card, and electronic device |
CN111241023B (en) * | 2020-01-19 | 2021-10-26 | 惠州Tcl移动通信有限公司 | Insertion detection circuit and method of flash memory card, and electronic device |
WO2022179305A1 (en) * | 2021-02-23 | 2022-09-01 | Oppo广东移动通信有限公司 | Data communication method and apparatus, and storage medium, electronic device and protective sleeve |
CN113055515A (en) * | 2021-03-04 | 2021-06-29 | Oppo广东移动通信有限公司 | Ultra-wideband data transmission method and equipment support |
CN113055515B (en) * | 2021-03-04 | 2023-08-15 | Oppo广东移动通信有限公司 | Ultra-wideband data transmission method and equipment support |
Also Published As
Publication number | Publication date |
---|---|
CN108681514B (en) | 2020-04-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108681514A (en) | Equipment detection method, device, storage medium and electronic equipment | |
EP3416062B1 (en) | Method and terminal device for establishing connection between devices with universal serial bus usb type-c interface | |
US9727111B2 (en) | Control device for current switching and electronic device | |
US10042801B2 (en) | System for detecting universal serial bus (USB) device and method thereof | |
CN108628713A (en) | Equipment detection method, device, storage medium and electronic equipment | |
CN105518967B (en) | Apparatus and method for changing current limit | |
US9723408B2 (en) | Electronic device and method of preventing erroneous recognizing inserting connector into earphone jack | |
WO2018129991A1 (en) | Charging method, charging device and terminal | |
CN109672950B (en) | Power saving circuit and power saving method based on Type-C earphone | |
CN106786960A (en) | Charge control method, device and terminal | |
CN104054064B (en) | Flexible port configuration based on interface coupling | |
EP3706007A1 (en) | Electronic device having usb type-c interface, control method, and readable storage medium | |
CN111163203A (en) | Liquid inlet monitoring device, mobile terminal and liquid inlet monitoring method of mobile terminal | |
CN113452102A (en) | Charging device and method thereof | |
US8780514B2 (en) | Data cable and electronic device using same | |
CN106292989A (en) | A kind of information processing method and electronic equipment | |
CN108664430B (en) | Equipment identification method and device, storage medium and electronic equipment | |
CN103853638A (en) | Method for refreshing firmware and electronic equipment | |
EP2866150B1 (en) | Electronic Device Assembly | |
CN106210948A (en) | A kind of on-off circuit, earphone socket, mobile terminal and method | |
CN106776400B (en) | Electronic equipment and circuit thereof, switching equipment and circuit thereof and signal control system | |
CN105357579A (en) | Online upgrading method for set top box, related device and set top box | |
US10423561B2 (en) | Computing devices with hot swapping prediction circuits | |
CN112256610B (en) | Connection control method, system, storage medium and mobile terminal | |
CN111949103B (en) | Integrated electronic device with data access, transmission and power management and method thereof |
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 | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200410 |
|
CF01 | Termination of patent right due to non-payment of annual fee |