CN108628713B - Device detection method and device, storage medium and electronic device - Google Patents

Device detection method and device, storage medium and electronic device Download PDF

Info

Publication number
CN108628713B
CN108628713B CN201810475646.3A CN201810475646A CN108628713B CN 108628713 B CN108628713 B CN 108628713B CN 201810475646 A CN201810475646 A CN 201810475646A CN 108628713 B CN108628713 B CN 108628713B
Authority
CN
China
Prior art keywords
type
interface
voltage
external
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810475646.3A
Other languages
Chinese (zh)
Other versions
CN108628713A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810475646.3A priority Critical patent/CN108628713B/en
Publication of CN108628713A publication Critical patent/CN108628713A/en
Application granted granted Critical
Publication of CN108628713B publication Critical patent/CN108628713B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test input/output devices or peripheral units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2284Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing by power-on test, e.g. power-on self test [POST]

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Power Sources (AREA)

Abstract

The embodiment of the application discloses a device detection method, a device, a storage medium and electronic equipment, wherein the embodiment of the application detects whether an external object exists in a Type-C interface; when an external object is stored in the Type-C interface, providing a preset detection voltage for a configuration channel pin of the Type-C interface; acquiring a voltage change value of a configuration channel pin; and judging whether the external object is external Type-C equipment or not according to the voltage change value. In the scheme, the power supply for the configuration channel pin of the Type-C interface is not required to be continuously realized, but an external object exists in the Type-C interface when the Type-C interface is detected, namely the Type-C interface can be connected into external Type-C equipment, the preset detection voltage is provided for the configuration channel pin, the connection detection for the external Type-C equipment is realized, therefore, the power supply for the configuration channel pin is only required within a short time, the corrosion of the external Type-C equipment connection detection on the Type-C interface is reduced, and the purpose of prolonging the service life of the Type-C interface is achieved.

Description

Device detection method and device, storage medium and electronic device
Technical Field
The present application relates to the field of electronic device technologies, and in particular, to a device detection method and apparatus, a storage medium, and an electronic device.
Background
At present, a Type-C interface becomes a standard interface of electronic equipment such as a tablet personal computer and a mobile phone. The electronic equipment can be connected with external Type-C equipment through a Type-C interface, and interaction between the equipment is realized. For this, access detection of the external Type-C device is first performed. When the electronic equipment realizes the access detection of the external Type-C equipment, detection voltage can be continuously provided for the pins of the configuration channels of the Type-C interface. However, for the convenience of the user, the Type-C interface of the electronic device is usually exposed, which makes the Type-C interface easily contact with corrosive liquid (such as sweat), while the configuration channel pins are continuously electrified, which accelerates the corrosion of the Type-C interface, thereby affecting the service life of the Type-C interface.
Disclosure of Invention
The embodiment of the application provides a device detection method and device, a storage medium and electronic equipment, and the service life of a Type-C interface can be prolonged.
In a first aspect, an apparatus detection method provided in an embodiment of the present application includes:
detecting whether an external object exists in the Type-C interface;
when the external object exists in the Type-C interface, providing a preset detection voltage for a configuration channel pin of the Type-C interface;
acquiring a voltage change value of the configuration channel pin;
and judging whether the external object is external Type-C equipment or not according to the voltage change value.
In a second aspect, an apparatus detection device provided in an embodiment of the present application includes:
the object detection module is used for detecting whether an external object exists in the Type-C interface;
the voltage providing module is used for providing preset detection voltage for a configuration channel pin of the Type-C interface when the external object exists in the Type-C interface;
the voltage obtaining module is used for obtaining a voltage change value of the configuration channel pin;
and the equipment identification module is used for judging whether the external object is external Type-C equipment or not according to the voltage change value.
In a third aspect, a storage medium is provided in this application, where a computer program is stored, and when the computer program runs on a computer, the computer is caused to execute the device detection method provided in any embodiment of this application.
In a fourth aspect, an electronic device provided in an embodiment of the present application includes a processor and a memory, where the memory has a computer program, and the processor is configured to execute the device detection method provided in any embodiment of the present application by calling the computer program.
The method includes the steps that whether an external object exists in a Type-C interface or not is detected; when an external object is stored in the Type-C interface, providing a preset detection voltage for a configuration channel pin of the Type-C interface; acquiring a voltage change value of a configuration channel pin; and judging whether the external object is external Type-C equipment or not according to the voltage change value. In the scheme, the power supply for the configuration channel pin of the Type-C interface is not required to be continuously realized, but an external object exists in the Type-C interface when the Type-C interface is detected, namely the Type-C interface can be connected into external Type-C equipment, the preset detection voltage is provided for the configuration channel pin, the connection detection for the external Type-C equipment is realized, therefore, the power supply for the configuration channel pin is only required within a short time, the corrosion of the external Type-C equipment connection detection on the Type-C interface is reduced, and the purpose of prolonging the service life of the Type-C interface is achieved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of the device detection method provided in the embodiment of the present application.
Fig. 2 is a schematic flowchart of a device detection method according to an embodiment of the present application.
Fig. 3 is a schematic structural diagram of a Type-C interface provided in an embodiment of the present application.
Fig. 4 is a diagram illustrating an example of providing a distance sensor at a Type-C interface in an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a detection circuit provided in the embodiment of the present application.
Fig. 6 is a diagram illustrating an example of providing a temperature sensor at a Type-C interface in an embodiment of the present application.
Fig. 7 is a schematic diagram showing an information input window in the embodiment of the present application.
Fig. 8 is another schematic flow chart of the device detection method according to the embodiment of the present application.
Fig. 9 is a schematic structural diagram of an apparatus detection device provided in an embodiment of the present application.
Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 11 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the application and should not be taken as limiting the application with respect to other embodiments that are not detailed herein.
In the description that follows, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise indicated. Accordingly, these steps and operations will be referred to, several times, as being performed by a computer, the computer performing operations involving a processing unit of the computer in electronic signals representing data in a structured form. This operation transforms the data or maintains it at locations in the computer's memory system, which may be reconfigured or otherwise altered in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, while the principles of the application have been described in language specific to above, it is not intended to be limited to the specific form set forth herein, and it will be recognized by those of ordinary skill in the art that various of the steps and operations described below may be implemented in hardware.
The term module, as used herein, may be considered a software object executing on the computing system. The various components, modules, engines, and services described herein may be viewed as objects implemented on the computing system. The apparatus and method described herein may be implemented in software, but may also be implemented in hardware, and are within the scope of the present application.
The terms "first", "second", and "third", etc. in this application are used to distinguish between different objects and not to describe a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to only those steps or modules listed, but rather, some embodiments may include other steps or modules not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
An execution main body of the device detection method may be the device detection apparatus provided in the embodiment of the present application, or an electronic device integrated with the device detection apparatus, where the device detection apparatus may be implemented in a hardware or software manner. The electronic device may be a computer device such as a smart phone, a tablet computer, a palm computer, a notebook computer, or a desktop computer.
Referring to fig. 1, fig. 1 is a schematic view of an application scenario of a device detection method provided in an embodiment of the present application, taking an example that a device detection apparatus is integrated in an electronic device, where the electronic device can detect whether an external object exists in a Type-C interface (for example, when the Type-C interface of an external Type-C device shown in fig. 1 is inserted into the Type-C interface of the electronic device, the electronic device will detect that the external object exists in the Type-C interface); when an external object stored in the Type-C interface is detected, providing a preset detection voltage for a configuration channel pin of the Type-C interface; acquiring a voltage change value of a configuration channel pin; and judging whether the external object is an external Type-C device or not according to the voltage change value to obtain the result that the external object is the external Type-C device or not.
Referring to fig. 2, fig. 2 is a schematic flow chart of an apparatus detection method according to an embodiment of the present disclosure. The specific process of the device detection method provided by the embodiment of the application can be as follows:
in step 101, whether external objects exist in the Type-C interface is detected.
Referring to fig. 3, the Type-C interface of the electronic device includes an interface portion and a housing portion, and the housing portion surrounds the interface portion, as shown in fig. 3, the housing portion surrounds the interface portion to form a receiving space, which is accessible to the Type-C interface of the external Type-C device, so that the electronic device and the external Type-C device are electrically connected. The external Type-C device can be an earphone adopting a Type-C interface, a U disk adopting a Type-C interface, a mobile phone adopting a Type-C interface, a tablet computer adopting a Type-C interface, a notebook computer adopting a Type-C interface, a desktop computer adopting a Type-C interface and other electronic devices.
In the embodiment of the application, whether an external object exists in the Type-C interface is detected, namely whether the external object exists in an accommodating space formed by the interface part and the shell part of the Type-C interface is detected.
For example, after the user accesses the Type-C interface of the external Type-C device to the Type-C interface of the electronic device, the electronic device will detect that the external object is stored in the Type-C interface.
In step 102, when an external object is stored in the Type-C interface, a preset detection voltage is provided for a configuration channel pin of the Type-C interface.
It should be noted that the Type-C interface has three roles, which are a downlink interface, an uplink interface, and a dual role interface, respectively, where when the Type-C interface of the electronic device is used as the downlink interface, the electronic device is used as a master device, and can supply power to an accessed external Type-C device, send data to the external Type-C device, read data from the external Type-C device, and so on; when the Type-C interface of the electronic equipment is used as an uplink interface, the electronic equipment is used as slave equipment, and can be powered off from the accessed external Type-C equipment to provide data and the like for the external Type-C equipment; when the Type-C interface of the electronic equipment is used as a dual role interface, the electronic equipment can be dynamically switched between the master equipment and the slave equipment.
In addition, the biggest characteristics of Type-C interface are that support all can insert "positive and negative the inserting" function on positive and negative two sides, and for realizing "positive and negative the inserting" function, the positive and negative two sides of its interface portion all is provided with 12 pins, and the pin definition is as shown in following table 1:
GND TX1+ TX1- VBUS CC1 D+ D- SBU1 VBUS RX2- RX2+ GND
GND RX1+ RX1- VBUS SBU2 D- D+ CC2 VBUS TX2- TX2+ GND
TABLE 1
TX1+, TX1-, RX1+, RX1-, TX2+, TX2-, RX2+ and RX 2-are four pairs of differential signal pins, D + and D-are differential signal pins compatible with USB2 and 0 standards, VBUS is a power supply pin, CC1 and CC2 are configuration channel pins, and SBU1 and SBU2 are bus pins.
Wherein, through configuration channel pin, electronic equipment can realize that the access of outside Type-C equipment detects, role differentiation and positive and negative discernment etc..
In the embodiment of the application, when a Type-C interface memory is detected as an external object, that is, it is stated that there may be an external Type-C device to be accessed currently, at this time, a preset detection voltage may be provided for a configuration channel pin of the Type-C interface, so as to implement access detection of the external Type-C device based on the configuration channel pin.
The preset detection voltage can be a pulse width modulation voltage, the voltage range can be 2.4V to 3.4V, the period range can be 50ms to 100ms, and the duty ratio range can be 30% to 70%.
For example, when the electronic device detects an external object stored in the Type-C interface, a preset detection voltage with a voltage value of 3.4V, a period of 50ms, and a duty cycle of 70% is provided to the configuration channel pin of the Type-C interface.
In step 103, a voltage variation value of the configuration channel pin is obtained.
In the embodiment of the application, after the preset detection voltage is provided for the Type-C interface, voltage detection is performed on the configuration channel pin, the current voltage of the configuration channel pin is obtained, the voltage difference value between the preset detection voltage and the current voltage is calculated, and the calculated voltage difference value is used as the voltage change value of the configuration channel.
In step 104, whether the external object is an external Type-C device is determined according to the voltage variation value.
In the embodiment of the application, the Type-C interface of the electronic device is configured as a downlink interface, that is, the electronic device serves as a master device. When the Type-C interface of the external Type-C device is configured as an uplink interface, that is, the external Type-C device is used as a slave device, a configuration channel pin of the Type-C interface is connected with a pull-down resistor (the pull-down resistor may be a single resistor, or may be formed by connecting a plurality of resistors in series and/or in parallel).
It is easy to understand that, when the Type-C interface of the external Type-C device is connected to the Type-C interface of the electronic device, the configuration channel pin of the electronic device will be connected to the configuration channel pin of the external Type-C device, so that the configuration channel pin of the electronic device is connected to the pull-down resistor of the external Type-C device, and the voltage on the configuration channel pin of the electronic device is pulled down.
Therefore, the electronic device can judge whether the external object existing in the Type-C interface of the electronic device is the external Type-C device (specifically, the Type-C interface of the external Type-C device) according to the voltage change value of the configuration channel pin of the electronic device.
It should be noted that, for external Type-C devices with different functions (for example, an earphone and a usb disk that use a Type-C interface), the resistance values of the pull-down resistors connected to the configuration channel pins of the external Type-C devices are different, and correspondingly, when the external Type-C devices with different functions are connected to the electronic device, the voltage pull-down degrees of the configuration channel pins of the electronic device are different. Therefore, a preset voltage interval can be set to reflect the voltage reduction degree of the external Type-C device with different functions, for example, the preset voltage interval can be set to [ Vmin, Vmax ], Vmin is the minimum voltage value of the configuration channel pin of the electronic device when the external Type-C device is connected to the electronic device, and Vmax is the maximum voltage value of the configuration channel pin of the electronic device when the external Type-C device is connected to the electronic device. The values of Vmin and Vmax may be determined in advance through experiments, for example, if the determined Vmin is 1.5V and the determined Vmax is 3V, the preset voltage interval [1.5V, 3V ] may be obtained.
In the embodiment of the application, when judging whether the external object is an external Type-C device or not according to the voltage change value, the electronic device can judge whether the obtained voltage change value is within a preset voltage interval or not; if the voltage change value is within the preset voltage interval, the electronic equipment determines that the external object is external Type-C equipment; if the voltage variation value is outside the preset voltage interval, the electronic device determines that the external object is not an external Type-C device.
For example, when the preset voltage interval is [1.5V, 3V ], if the electronic device obtains that the voltage variation value of the pin of the configuration channel is 2V, it may be determined that the external object in the Type-C interface is an external Type-C device; if the electronic device obtains that the voltage variation value of the configuration channel pin is 0.2V, it can be determined that the external object in the Type-C interface is not the external Type-C device.
According to the method, whether the external object exists in the Type-C interface is detected; when an external object is stored in the Type-C interface, providing a preset detection voltage for a configuration channel pin of the Type-C interface; acquiring a voltage change value of a configuration channel pin; and judging whether the external object is external Type-C equipment or not according to the voltage change value. In the scheme, the power supply for the configuration channel pin of the Type-C interface is not required to be continuously realized, but an external object exists in the Type-C interface when the Type-C interface is detected, namely the Type-C interface can be connected into external Type-C equipment, the preset detection voltage is provided for the configuration channel pin, the connection detection for the external Type-C equipment is realized, therefore, the power supply for the configuration channel pin is only required within a short time, the corrosion of the external Type-C equipment connection detection on the Type-C interface is reduced, and the purpose of prolonging the service life of the Type-C interface is achieved.
In one embodiment, referring to fig. 4, to implement the detection of the external object inside and outside the Type-C interface, a distance sensor may be disposed on a housing portion of the Type-C interface, and a detection end of the distance sensor is disposed toward an interface portion of the Type-C interface to detect whether the external object exists inside the Type-C interface, including:
acquiring a distance value detected by a distance sensor;
and judging whether the acquired distance value is within a preset distance interval, wherein if the acquired distance value is within the preset distance interval, the Type-C interface is stored in an external object.
It should be noted that, in the embodiment of the present application, no specific limitation is imposed on what Type of distance sensor is used, and a person skilled in the art may select any one of different types of distance sensors such as a laser distance sensor, an infrared distance sensor, and an ultrasonic distance sensor according to actual needs, for example, in the embodiment of the present application, an infrared distance sensor is disposed on a housing portion of a Type-C interface, and a detection end of the infrared distance sensor faces the interface portion.
As shown in FIG. 4, the distance sensor disposed in the housing portion will detect its own distance value to the interface portion when no external object is present in the Type-C interface, and will detect its own distance value to the Type-C interface of the external Type-C device when an external object, such as an external Type-C device, is present in the Type-C interface.
It is easy to understand that, when no external object exists in the Type-C interface of the electronic device, it is obviously impossible for the external Type-C device to access, and when an external object exists in the Type-C interface of the electronic device, the external Type-C device may be accessed only, so in this embodiment of the application, the electronic device may determine whether an external object exists in the Type-C interface according to the distance value detected by the distance sensor, so as to preliminarily determine whether an external Type-C device accesses.
In the embodiment of the application, when detecting whether an external object exists in the Type-C interface, the electronic device firstly obtains a distance value detected by the distance sensor, then judges whether the obtained distance value is located in a preset distance interval, determines that the external object exists in the Type-C interface when the obtained distance value is located in the preset distance interval, and determines that the external object does not exist in the Type-C interface when the obtained distance value is located outside the preset distance interval.
The preset distance interval can be set to be [0, Lmax ], when the Lmax indicates that external Type-C equipment is connected to the Type-C interface of the electronic equipment, the maximum distance value which can be detected by the distance sensor (when the thicknesses of the Type-C interfaces of different external Type-C equipment are different, and different external Type-C equipment are connected to the Type-C interfaces of the electronic equipment, the distance value detected by the distance sensor is different), and the maximum distance value can be obtained in advance through experiments.
For example, the preset distance interval is set to [0,0.5mm ], and if the obtained distance value is 1mm (if no external Type-C device is connected to the Type-C interface of the electronic device), the electronic device detects that no external object exists in the Type-C interface;
if the obtained distance value is 0.2mm (if an external Type-C device is connected to a Type-C interface of the electronic device), the electronic device detects that the Type-C interface of the electronic device is stored in an external object.
In one embodiment, to detect the external object in the Type-C interface, a first brightness sensor may be disposed on the housing portion of the Type-C interface, and a detection end of the first brightness sensor faces the interface portion, a second brightness sensor may be disposed at a position outside the Type-C interface, and a detection end of the second brightness sensor faces a direction away from the electronic device, so as to detect whether the external object exists in the Type-C interface, including:
acquiring a first brightness value detected by a first brightness sensor;
acquiring a second brightness value detected by a second brightness sensor;
and acquiring a brightness difference value between the first brightness value and the second brightness value, and judging whether the brightness difference value reaches a preset brightness difference value, wherein when the brightness difference value reaches the preset brightness difference value, determining that the Type-C interface is stored in an external object.
It is easy to understand that, when no external object exists in the Type-C interface of the electronic device, the brightness difference between the first brightness sensor disposed in the Type-C interface and the second brightness sensor disposed outside the Type-C interface (the difference between the brightness values detected by the two brightness sensors) is small, and when an external object exists in the Type-C interface of the electronic device (for example, the Type-C interface of the external Type-C device connected to the electronic device), the external object blocks the light emitted to the first brightness sensor, so that the brightness difference between the first brightness sensor and the second brightness sensor is large. Therefore, the electronic equipment can determine whether external objects exist in the Type-C interface according to the brightness difference value of the first brightness sensor and the second brightness sensor.
It should be noted that, for the specific value of the preset luminance difference, the embodiment of the present application is not particularly limited, and may be set by a person skilled in the art according to actual needs.
In one embodiment, referring to fig. 5, to detect an external object inside and outside a Type-C interface, an electronic device includes a detection circuit, the detection circuit includes a metal contact, a detection voltage providing module and a detection resistor, wherein one end of the metal contact passes through a through hole formed in a housing portion and is fixed to a middle frame of the electronic device, and the other end of the metal contact passes through another through hole formed in the housing portion and extends into the electronic device to connect the detection voltage providing module and the detection resistor when a deformation occurs, so as to detect whether the external object exists inside the Type-C interface, including:
acquiring an input voltage value of a detection resistor;
if the obtained input voltage value is the same as the output voltage value of the detection voltage providing module, an external object is stored in the Type-C interface.
The detection resistor may be a single resistor, or may be formed by connecting a plurality of resistors in series and/or in parallel, and the selection of the resistance value may be a suitable value according to actual needs by those skilled in the art, which is not specifically limited in the embodiment of the present application, and may be set to 1.2K Ω, for example.
For example, referring to fig. 5, the output voltage value of the detection voltage providing module is 3.7V, when no external Type-C device is connected, the metal contact plate will not deform, and the input voltage value of the electronic device to the detection resistor is zero; when external Type-C equipment is connected, the Type-C interface of the external Type-C equipment extrudes the metal contact plate to deform the metal contact plate, so that the detection voltage providing module and the detection resistor are connected, the input voltage value of the detection resistor acquired by the electronic equipment is the same as the output voltage value of the detection voltage providing module at the moment, the input voltage value is 3.7V, and the external object stored in the Type-C interface is detected.
In an embodiment, after providing the preset detection voltage for the configuration channel pin of the Type-C interface, the method further includes:
when detecting that there is not external article in the Type-C interface, stop providing for configuration channel pin and predetermine detection voltage.
The step of detecting whether an external object exists in the Type-C interface is carried out in real time, and at a certain moment, if the external object is detected in the Type-C interface, preset detection voltage is provided for the Type-C interface so as to realize access detection of external Type-C equipment.
After providing the preset detection voltage for the configuration channel pin of the Type-C interface, that is, during the period of providing the preset detection voltage for the configuration channel pin of the Type-C interface, the electronic device still detects whether the external object exists in the Type-C interface in real time, wherein for how to detect whether the external object exists in the Type-C interface, the above related description may be specifically referred to, and details are not repeated here.
When it is detected that no external object exists in the Type-C interface (for example, after the user accesses the external Type-C device to the Type-C interface of the electronic device, the external Type-C device is pulled out from the Type-C interface of the electronic device), the electronic device stops supplying power to the configuration channel pin of the Type-C interface of the electronic device, so that the configuration channel pin is not electrified.
In short, in the embodiment of the present application, during the period that the electronic device is and only has an external object in the Type-C interface, the electronic device provides a preset detection voltage for the configuration channel pin of the Type-C interface, so as to implement access detection on the external Type-C device, and when there is no external object in the Type-C interface, the electronic device does not supply power to the configuration channel pin, so that the configuration channel pin is not powered.
In an embodiment, after determining whether the external object is an external Type-C device according to the voltage variation value, the method further includes:
if the external object in the Type-C interface is external Type-C equipment, establishing electrical connection with the external Type-C equipment through the Type-C interface;
according to the voltage change value of the configuration channel pin, corresponding power supply voltage is provided for the external Type-C equipment through the established electric connection, and power is supplied for the external Type-C equipment.
In the embodiment of the application, the electronic equipment serves as a master device, the external Type-C equipment serves as a slave device and is connected with the electronic equipment, and electric connection is established between the electronic equipment and the external Type-C equipment.
Based on the above description about "determining whether the external object is an external Type-C device according to the voltage variation value", it can be known that, when the external Type-C devices with different functions are connected to the electronic device, the voltage variation values detected by the electronic device on the configuration channel pins are different. In addition, as can be known by those skilled in the art, the power supply voltage required by the external Type-C device with different functions is different, for example, the power supply voltage required by the earphone adopting the Type-C interface is 3.3V, and the power supply voltage required by the usb flash disk adopting the Type-C interface is 4.5V.
Therefore, in the embodiment of the present application, a corresponding relationship between the voltage variation value and the power supply voltage is preset. Correspondingly, when the electronic equipment detects that the Type-C interface is internally stored in an external object and determines that the external object is the external Type-C equipment, the electronic equipment determines the power supply voltage corresponding to the acquired voltage change value according to the acquired voltage change value of the pin of the configuration channel and the corresponding relation between the voltage change value and the power supply voltage, and provides the determined power supply voltage for the external Type-C equipment through the established electric connection.
Therefore, the function Type of the external Type-C device can be further identified by configuring the voltage change value on the channel pin, and a corresponding power supply voltage is provided for the external Type-C device.
It is easy to understand that if the temperature of the Type-C interface is too high, it will be possible to burn out the Type-C interface and even damage the whole electronic device. And when the electronic equipment supplies power for the external Type-C equipment through the Type-C interface, the temperature of the Type-C interface of the electronic equipment is rapidly increased. In order to avoid the damage of the electronic device caused by the power supply of the external Type-C device, in an embodiment, the method further comprises the following steps:
acquiring a temperature value of a Type-C interface during the period of providing power supply voltage for external Type-C equipment;
and when the acquired temperature value is within the preset temperature interval, disconnecting the electric connection with the external Type-C equipment.
Referring to fig. 6, a temperature sensor may be further disposed on a housing portion of the Type-C interface, and is used to detect a temperature of the Type-C interface.
In the embodiment of the application, during the period that the electronic device provides the power supply voltage for the external Type-C device, the temperature value of the Type-C interface is acquired from the temperature sensor arranged on the Type-C interface in real time, and after the temperature value of the Type-C interface is acquired, whether the temperature value is within the preset temperature range is judged, wherein when the temperature value is within the preset temperature range, the temperature of the Type-C interface is over high, at the moment, the electric connection with the external Type-C device is disconnected, so that the power supply to the external Type-C interface is stopped, and the temperature of the Type-C interface is prevented from being continuously increased.
The preset temperature interval may be set to [ Tmin, + ∞), [ Tmin ] indicates the lowest temperature value that may cause damage to the electronic device, and may be obtained in advance through experiments.
For example, the preset temperature interval is set to [60 ℃, + ∞ ], if the obtained temperature value of the Type-C interface is 37 ℃, the electronic device continues to supply power to the external Type-C device; and if the obtained temperature value of the Type-C interface is 67 ℃, the electronic equipment is disconnected from the electric connection with the external Type-C equipment, and the power supply for the external Type-C equipment is stopped.
In an embodiment, when the obtained temperature value is within the preset temperature interval, the step of disconnecting the electrical connection with the external Type-C device includes:
when the obtained temperature value is within a preset temperature interval, displaying an information input window;
upon receiving the inputted confirmation information based on the displayed information input window, the electrical connection with the external Type-C device is disconnected.
In the embodiment of the application, whether the electrical connection with the external Type-C device is disconnected or not is determined by a user. For example, referring to fig. 7, when the electronic device acquires a temperature value of the Type-C interface and determines that the temperature value is within a preset temperature range, an information input window is displayed in a screen display area, where the information input window includes a yes control and a no control, and prompt information that prompts a user whether to disconnect the external Type-C device is that "the current temperature is too high and the external device is disconnected", and the user can input confirmation information by clicking the yes control and input denial information by clicking the no control. If the electronic equipment receives confirmation information input by a user, the electronic equipment is disconnected from the external Type-C equipment; and if the denial information input by the user is received, not operating, and continuously supplying power to the external Type-C equipment.
The device detection method of the present application will be further described below on the basis of the methods described in the above embodiments. Specifically, referring to fig. 4, a Type-C interface of an electronic device includes an interface portion and a housing portion, the housing portion surrounds the interface portion, a distance sensor is disposed on the housing portion of the Type-C interface, and a detection end of the distance sensor is disposed toward the interface portion of the Type-C interface, referring to fig. 8, a specific flow of the device detection method is as follows:
in step 201, a distance value detected by the distance sensor is obtained, and it is determined whether the obtained distance value is within a preset distance interval.
It should be noted that, in the embodiment of the present application, no specific limitation is imposed on what Type of distance sensor is used, and a person skilled in the art may select any one of different types of distance sensors such as a laser distance sensor, an infrared distance sensor, and an ultrasonic distance sensor according to actual needs, for example, in the embodiment of the present application, an infrared distance sensor is disposed on a housing portion of a Type-C interface, and a detection end of the infrared distance sensor faces the interface portion.
As shown in FIG. 4, the distance sensor disposed in the housing portion will detect its own distance value to the interface portion when no external object is present in the Type-C interface, and will detect its own distance value to the Type-C interface of the external Type-C device when an external object, such as an external Type-C device, is present in the Type-C interface.
It is easy to understand that, when no external object exists in the Type-C interface of the electronic device, it is obviously impossible for the external Type-C device to access, and when an external object exists in the Type-C interface of the electronic device, the external Type-C device may be accessed only, so in this embodiment of the application, the electronic device may determine whether an external object exists in the Type-C interface according to the distance value detected by the distance sensor, so as to preliminarily determine whether an external Type-C device accesses.
When detecting whether an external object exists in the Type-C interface, the electronic equipment firstly acquires a distance value detected by the distance sensor, then judges whether the acquired distance value is located in a preset distance interval, and determines whether the external object exists in the Type-C interface according to a judgment result.
In step 202, if the obtained distance value is within the preset distance interval, it is determined that the Type-C interface is stored in an external object, and a preset detection voltage is provided for a configuration channel pin of the Type-C interface.
If the obtained distance value is located outside the preset distance interval, the electronic device determines that no external object exists in the Type-C interface.
The preset distance interval can be set to be [0, Lmax ], when the Lmax indicates that external Type-C equipment is connected to the Type-C interface of the electronic equipment, the maximum distance value which can be detected by the distance sensor (when the thicknesses of the Type-C interfaces of different external Type-C equipment are different, and different external Type-C equipment are connected to the Type-C interfaces of the electronic equipment, the distance value detected by the distance sensor is different), and the maximum distance value can be obtained in advance through experiments.
For example, the preset distance interval is set to [0,0.5mm ], and if the obtained distance value is 1mm (if no external Type-C device is connected to the Type-C interface of the electronic device), the electronic device detects that no external object exists in the Type-C interface;
if the obtained distance value is 0.2mm (if an external Type-C device is connected to a Type-C interface of the electronic device), the electronic device detects that the Type-C interface of the electronic device is stored in an external object.
In the embodiment of the application, when a Type-C interface memory is detected as an external object, that is, it is stated that there may be an external Type-C device to be accessed currently, at this time, a preset detection voltage may be provided for a configuration channel pin of the Type-C interface, so as to implement access detection of the external Type-C device based on the configuration channel pin.
The preset detection voltage can be a pulse width modulation voltage, the voltage range can be 2.4V to 3.4V, the period range can be 50ms to 100ms, and the duty ratio range can be 30% to 70%.
For example, when the electronic device detects an external object stored in the Type-C interface, a preset detection voltage with a voltage value of 3.4V, a period of 50ms, and a duty cycle of 70% is provided to the configuration channel pin of the Type-C interface.
In step 203, a voltage variation value of the pin of the configuration channel is obtained, and whether the obtained voltage variation value is within a preset voltage interval is determined.
In the embodiment of the application, after the preset detection voltage is provided for the Type-C interface, voltage detection is performed on the configuration channel pin, the current voltage of the configuration channel pin is obtained, the voltage difference value between the preset detection voltage and the current voltage is calculated, and the calculated voltage difference value is used as the voltage change value of the configuration channel.
In the embodiment of the application, the Type-C interface of the electronic device is configured as a downlink interface, that is, the electronic device serves as a master device. When the Type-C interface of the external Type-C device is configured as an uplink interface, that is, the external Type-C device is used as a slave device, a configuration channel pin of the Type-C interface is connected with a pull-down resistor (the pull-down resistor may be a single resistor, or may be formed by connecting a plurality of resistors in series and/or in parallel).
It is easy to understand that, when the Type-C interface of the external Type-C device is connected to the Type-C interface of the electronic device, the configuration channel pin of the electronic device will be connected to the configuration channel pin of the external Type-C device, so that the configuration channel pin of the electronic device is connected to the pull-down resistor of the external Type-C device, and the voltage on the configuration channel pin of the electronic device is pulled down.
Therefore, the electronic device can judge whether the external object existing in the Type-C interface of the electronic device is the external Type-C device (specifically, the Type-C interface of the external Type-C device) according to the voltage change value of the configuration channel pin of the electronic device.
It should be noted that, for external Type-C devices with different functions (for example, an earphone and a usb disk that use a Type-C interface), the resistance values of the pull-down resistors connected to the configuration channel pins of the external Type-C devices are different, and correspondingly, when the external Type-C devices with different functions are connected to the electronic device, the voltage pull-down degrees of the configuration channel pins of the electronic device are different. Therefore, a preset voltage interval can be set to reflect the voltage reduction degree of the external Type-C device with different functions, for example, the preset voltage interval can be set to [ Vmin, Vmax ], Vmin is the minimum voltage value of the configuration channel pin of the electronic device when the external Type-C device is connected to the electronic device, and Vmax is the maximum voltage value of the configuration channel pin of the electronic device when the external Type-C device is connected to the electronic device. The values of Vmin and Vmax may be determined in advance through experiments, for example, if the determined Vmin is 1.5V and the determined Vmax is 3V, the preset voltage interval [1.5V, 3V ] may be obtained.
In the embodiment of the application, when judging whether the external object is the external Type-C device according to the voltage change value, the electronic device can judge whether the obtained voltage change value is within a preset voltage interval, and determine whether the external object in the Type-C interface is the external Type-C device according to the judgment result.
In step 204, when the obtained voltage variation value is within the preset voltage interval, it is determined that the external object in the Type-C interface is an external Type-C device.
If the voltage change value is within the preset voltage interval, the electronic equipment determines that the external object is external Type-C equipment; if the voltage variation value is outside the preset voltage interval, the electronic device determines that the external object is not an external Type-C device.
For example, when the preset voltage interval is [1.5V, 3V ], if the electronic device obtains that the voltage variation value of the pin of the configuration channel is 2V, it may be determined that the external object in the Type-C interface is an external Type-C device; if the electronic device obtains that the voltage variation value of the configuration channel pin is 0.2V, it can be determined that the external object in the Type-C interface is not the external Type-C device.
In step 205, an electrical connection is established with an external Type-C device through a Type-C interface.
In the embodiment of the application, when the external object in the Type-C interface is determined to be the external Type-C device, the electronic device is electrically connected with the external Type-C device through the Type-C interface, wherein the electronic device serves as a master device, and the external Type-C device serves as a slave device.
In step 206, the external Type-C device is powered by providing a corresponding power supply voltage to the external Type-C device through the established electrical connection according to the voltage variation value.
Based on the above description about "determining whether the external object is an external Type-C device according to the voltage variation value", it can be known that, when the external Type-C devices with different functions are connected to the electronic device, the voltage variation values detected by the electronic device on the configuration channel pins are different. In addition, as can be known to those skilled in the art, the power supply voltage required by external Type-C devices with different functions is different, for example, the power supply voltage required by an earphone adopting a Type-C interface is 3.3V; for another example, the supply voltage required by the usb flash disk adopting the Type-C interface is 4.5V.
Therefore, in the embodiment of the present application, a corresponding relationship between the voltage variation value and the power supply voltage is preset. Correspondingly, when the electronic equipment detects that the Type-C interface is internally stored in an external object and determines that the external object is the external Type-C equipment, the electronic equipment determines the power supply voltage corresponding to the acquired voltage change value according to the acquired voltage change value of the pin of the configuration channel and the corresponding relation between the voltage change value and the power supply voltage, and provides the determined power supply voltage for the external Type-C equipment through the established electric connection.
Therefore, the function Type of the external Type-C device can be further identified by configuring the voltage change value on the channel pin, and a corresponding power supply voltage is provided for the external Type-C device.
In one embodiment, an apparatus detection device is also provided. Referring to fig. 9, fig. 9 is a schematic structural diagram of an apparatus detection device according to an embodiment of the present disclosure. The device detection apparatus is applied to an electronic device, and includes an object detection module 401, a voltage providing module 402, a voltage obtaining module 403, and a device identification module 404, as follows:
the object detection module 401 is configured to detect whether an external object exists in the Type-C interface;
the voltage providing module 402 is configured to provide a preset detection voltage for a configuration channel pin of the Type-C interface when an external object is stored in the Type-C interface;
a voltage obtaining module 403, configured to obtain a voltage variation value of a configuration channel pin;
and the device identification module 404 is configured to determine whether the external object is an external Type-C device according to the voltage variation value.
In one embodiment, the Type-C interface comprises a housing portion and an interface portion, the housing portion is provided with a distance sensor, and a detection end of the distance sensor faces the interface portion, the object detection module 401 is specifically configured to:
acquiring a distance value detected by a distance sensor;
and judging whether the distance value is within a preset distance interval, wherein if the distance value is within the preset distance interval, the Type-C interface is stored in an external object.
In an embodiment, the device identification module 404 is specifically configured to:
and judging whether the voltage change value is within a preset voltage interval, wherein if the voltage change value is within the preset voltage interval, the external object is external Type-C equipment.
In an embodiment, the voltage providing module 402 is further configured to:
when detecting that there is not external article in the Type-C interface, stop providing for configuration channel pin and predetermine detection voltage.
In an embodiment, the device detection apparatus further includes a connection establishment module, configured to:
if the external object is an external Type-C device, establishing electrical connection with the external Type-C device through a Type-C interface;
the voltage providing module 402 is further configured to provide a corresponding power supply voltage to the external Type-C device through the established electrical connection according to the voltage variation value, so as to supply power to the external Type-C device.
In an embodiment, the connection establishing module is further configured to:
acquiring a temperature value of a Type-C interface during the period that the voltage providing module 402 provides a power supply voltage for external Type-C equipment;
and when the temperature value of the Type-C interface is within the preset temperature interval, the established electric connection is disconnected.
In an embodiment, the connection establishing module is specifically configured to:
when the temperature value of the Type-C interface is within a preset temperature interval, displaying an information input window;
upon receiving the inputted confirmation information based on the information input window, the established electrical connection is disconnected.
In specific implementation, the modules may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and specific implementation of the units may refer to the foregoing embodiments, which are not described herein again.
As can be seen from the above, the device detecting apparatus 400 of the embodiment can detect whether an external object exists in the Type-C interface by the object detecting module 401; when an external object is stored in the Type-C interface, the voltage providing module 402 provides a preset detection voltage for a configuration channel pin of the Type-C interface; acquiring a voltage change value of a pin of a configuration channel by a voltage acquisition module 403; the device identification module 404 determines whether the external object is an external Type-C device according to the voltage variation value. In the scheme, the power supply for the configuration channel pin of the Type-C interface is not required to be continuously realized, but an external object exists in the Type-C interface when the Type-C interface is detected, namely the Type-C interface can be connected into external Type-C equipment, the preset detection voltage is provided for the configuration channel pin, the connection detection for the external Type-C equipment is realized, therefore, the power supply for the configuration channel pin is only required within a short time, the corrosion of the external Type-C equipment connection detection on the Type-C interface is reduced, and the purpose of prolonging the service life of the Type-C interface is achieved.
The embodiment of the application also provides the electronic equipment. Referring to fig. 10, an electronic device 500 includes a processor 501 and a memory 502. The processor 501 is electrically connected to the memory 502.
The processor 500 is a control center of the electronic device 500, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device 500 and processes data by running or loading a computer program stored in the memory 502 and calling data stored in the memory 502.
The memory 502 may be used to store software programs and modules, and the processor 501 executes various functional applications and data processing by operating the computer programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
In this embodiment, the processor 501 in the electronic device 500 loads instructions corresponding to one or more processes of the computer program into the memory 502, and the processor 501 runs the computer program stored in the memory 502, so as to implement various functions as follows:
detecting whether an external object exists in the Type-C interface;
when an external object is stored in the Type-C interface, providing a preset detection voltage for a configuration channel pin of the Type-C interface;
acquiring a voltage change value of a configuration channel pin;
and judging whether the external object is external Type-C equipment or not according to the voltage change value.
Referring to fig. 11, in some embodiments, the electronic device 500 may further include: a display 503, radio frequency circuitry 504, audio circuitry 505, and a power supply 506. The display 503, the rf circuit 504, the audio circuit 505, and the power source 506 are electrically connected to the processor 501.
The display 503 may be used to display information entered by or provided to the user as well as various graphical user interfaces, which may be made up of graphics, text, icons, video, and any combination thereof. The Display 503 may include a Display panel, and in some embodiments, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The rf circuit 504 may be used for transceiving rf signals to establish wireless communication with a network device or other electronic devices via wireless communication, and for transceiving signals with the network device or other electronic devices.
The audio circuit 505 may be used to provide an audio interface between a user and an electronic device through a speaker, microphone.
The power source 506 may be used to power various components of the electronic device 500. In some embodiments, power supply 506 may be logically coupled to processor 501 through a power management system, such that functions of managing charging, discharging, and power consumption are performed through the power management system.
Although not shown in fig. 11, the electronic device 500 may further include a camera, a bluetooth module, and the like, which are not described in detail herein.
In some embodiments, the Type-C interface comprises a housing portion and an interface portion, the housing portion is provided with a distance sensor, and a detection end of the distance sensor faces the interface portion, and when detecting whether an external object exists in the Type-C interface, the processor 501 may specifically perform the following steps:
acquiring a distance value detected by a distance sensor;
and judging whether the distance value is within a preset distance interval, wherein if the distance value is within the preset distance interval, the Type-C interface is stored in an external object.
In some embodiments, when determining whether the external object is an external Type-C device according to the voltage variation value, the processor 501 may specifically perform the following steps:
and judging whether the voltage change value is within a preset voltage interval, wherein if the voltage change value is within the preset voltage interval, the external object is external Type-C equipment.
In some embodiments, after providing the preset detection voltage for the configuration channel pin of the Type-C interface, the processor 501 may specifically perform the following steps:
when detecting that there is not external article in the Type-C interface, stop providing for configuration channel pin and predetermine detection voltage.
In some embodiments, after determining whether the external object is an external Type-C device according to the voltage variation value, the processor 501 may further perform the following steps:
if the external object is an external Type-C device, establishing electrical connection with the external Type-C device through a Type-C interface;
the voltage providing module 402 is further configured to provide a corresponding power supply voltage to the external Type-C device through the established electrical connection according to the voltage variation value, so as to supply power to the external Type-C device.
In some embodiments, processor 501 may also perform the following steps:
acquiring a temperature value of a Type-C interface during the period of providing power supply voltage for external Type-C equipment;
and when the temperature value of the Type-C interface is within the preset temperature interval, the established electric connection is disconnected.
In some embodiments, upon breaking the established electrical connection, processor 501 may further perform the following steps:
when the temperature value of the Type-C interface is within a preset temperature interval, displaying an information input window;
upon receiving the inputted confirmation information based on the information input window, the established electrical connection is disconnected.
An embodiment of the present application further provides a storage medium, where the storage medium stores a computer program, and when the computer program runs on a computer, the computer is caused to execute the device detection method in any one of the above embodiments, for example: detecting whether an external object exists in the Type-C interface; when an external object is stored in the Type-C interface, providing a preset detection voltage for a configuration channel pin of the Type-C interface; acquiring a voltage change value of a configuration channel pin; and judging whether the external object is external Type-C equipment or not according to the voltage change value.
In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It should be noted that, for the device detection method of the embodiment of the present application, it can be understood by those skilled in the art that all or part of the process of implementing the device detection method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer-readable storage medium, such as a memory of an electronic device, and executed by at least one processor in the electronic device, and during the execution process, the process of the embodiment of the device detection method can be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, etc.
For the device detection apparatus in the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The above detailed description is provided for a device detection method, apparatus, storage medium and electronic device provided in the embodiments of the present application, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiments is only used to help understanding the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (9)

1. An equipment detection method is characterized by being applied to electronic equipment, wherein the electronic equipment comprises a detection circuit, the detection circuit comprises a metal contact, a detection voltage supply module and a detection resistor, the metal contact is used for connecting the detection voltage supply module and the detection resistor when deformation occurs, and the method comprises the following steps:
acquiring a first brightness value detected by a first brightness sensor;
acquiring a second brightness value detected by a second brightness sensor;
acquiring a brightness difference value between a first brightness value and a second brightness value, and judging whether the brightness difference value reaches a preset brightness difference value, wherein when the brightness difference value reaches the preset brightness difference value, an external object stored in a Type-C interface is determined, the first brightness sensor is arranged on a shell part of the Type-C interface, a detection end of the first brightness sensor faces to the interface part, the second brightness sensor is arranged at a position outside the Type-C interface, and the detection end of the second brightness sensor faces to a direction far away from the electronic equipment; alternatively, the first and second electrodes may be,
acquiring an input voltage value of a detection resistor;
if the acquired input voltage value is the same as the output voltage value of the detection voltage providing module, storing an external object in the Type-C interface;
when the external object exists in the Type-C interface, providing a preset detection voltage for a configuration channel pin of the Type-C interface;
acquiring a voltage change value of the configuration channel pin;
judging whether the external object is external Type-C equipment or not according to the voltage change value;
and when the external object does not exist in the Type-C interface, stopping providing preset detection voltage for the configuration channel pin.
2. The device detection method of claim 1, wherein the Type-C interface includes a housing portion and an interface portion, the housing portion is provided with a distance sensor, and a detection end of the distance sensor faces the interface portion to detect whether a foreign object exists in the Type-C interface, including:
acquiring a distance value detected by the distance sensor;
and judging whether the distance value is within a preset distance interval, wherein if the distance value is within the preset distance interval, an external object is stored in the Type-C interface.
3. The device detection method of claim 1, wherein determining whether the external object is an external Type-C device according to the voltage variation value comprises:
and judging whether the voltage change value is within a preset voltage interval, wherein if the voltage change value is within the preset voltage interval, the external object is external Type-C equipment.
4. The device detection method of any one of claims 1 to 3, wherein after determining whether the external object is an external Type-C device according to the voltage variation value, further comprising:
if the external object is an external Type-C device, establishing electrical connection with the external Type-C device through the Type-C interface;
and according to the voltage change value, providing corresponding power supply voltage for the external Type-C equipment through the electric connection to supply power for the external Type-C equipment.
5. The device detection method of claim 4, further comprising:
acquiring a temperature value of the Type-C interface during the period of providing the power supply voltage for the external Type-C device;
and when the temperature value is within a preset temperature interval, the electric connection is disconnected.
6. The device detection method of claim 5, wherein disconnecting the electrical connection when the temperature value is within a preset temperature interval comprises:
when the temperature value is within a preset temperature interval, displaying an information input window;
the electrical connection is disconnected upon receiving input confirmation information based on the information input window.
7. The utility model provides a device detection apparatus which characterized in that is applied to electronic equipment, electronic equipment includes detection circuitry, and this detection circuitry includes the metal contact, and detection voltage provides module and detection resistance, the metal contact is used for putting through detection voltage when producing deformation and provides module and detection resistance, the device includes:
the object detection module is used for acquiring a first brightness value detected by the first brightness sensor;
acquiring a second brightness value detected by a second brightness sensor;
acquiring a brightness difference value between a first brightness value and a second brightness value, and judging whether the brightness difference value reaches a preset brightness difference value, wherein when the brightness difference value reaches the preset brightness difference value, an external object stored in a Type-C interface is determined, the first brightness sensor is arranged on a shell part of the Type-C interface, a detection end of the first brightness sensor faces to the interface part, the second brightness sensor is arranged at a position outside the Type-C interface, and the detection end of the second brightness sensor faces to a direction far away from the electronic equipment; alternatively, the first and second electrodes may be,
acquiring an input voltage value of a detection resistor; if the acquired input voltage value is the same as the output voltage value of the detection voltage providing module, storing an external object in the Type-C interface;
the voltage providing module is used for providing preset detection voltage for a configuration channel pin of the Type-C interface when the external object exists in the Type-C interface; the device is further used for stopping providing preset detection voltage for the configuration channel pin when the external object is detected not to exist in the Type-C interface;
the voltage obtaining module is used for obtaining a voltage change value of the configuration channel pin;
and the equipment identification module is used for judging whether the external object is external Type-C equipment or not according to the voltage change value.
8. A storage medium having stored thereon a computer program, characterized in that, when the computer program is run on a computer, it causes the computer to execute the device detection method according to any one of claims 1 to 6.
9. An electronic device comprising a processor and a memory, the memory storing a computer program, wherein the processor is configured to perform the device detection method of any one of claims 1 to 6 by invoking the computer program.
CN201810475646.3A 2018-05-17 2018-05-17 Device detection method and device, storage medium and electronic device Active CN108628713B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810475646.3A CN108628713B (en) 2018-05-17 2018-05-17 Device detection method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810475646.3A CN108628713B (en) 2018-05-17 2018-05-17 Device detection method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN108628713A CN108628713A (en) 2018-10-09
CN108628713B true CN108628713B (en) 2021-06-01

Family

ID=63693691

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810475646.3A Active CN108628713B (en) 2018-05-17 2018-05-17 Device detection method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN108628713B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110112620B (en) * 2019-05-30 2020-09-22 维沃移动通信有限公司 Terminal equipment and control method
CN112397948A (en) * 2019-08-13 2021-02-23 北京小米移动软件有限公司 Female seat of Type-C, Type-C plug system and electronic system
CN112510361B (en) * 2019-09-16 2023-07-18 北京小米移动软件有限公司 Passive antenna and antenna system
CN112510345B (en) * 2019-09-16 2023-07-18 北京小米移动软件有限公司 External antenna device, control method and device thereof and storage medium
CN112333327B (en) * 2020-11-20 2022-01-07 Oppo广东移动通信有限公司 Equipment detection method, device, storage medium, electronic equipment, external equipment and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975039A (en) * 2016-04-29 2016-09-28 乐视控股(北京)有限公司 Method and device for controlling power supply of Type-C interface, and electronic equipment
CN107451079A (en) * 2017-08-09 2017-12-08 合肥联宝信息技术有限公司 The identification of lines method and device of a kind of electronic equipment
US10539999B2 (en) * 2016-08-25 2020-01-21 Samsung Electronics Co., Ltd. Semiconductor device and method of operating the same

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975039A (en) * 2016-04-29 2016-09-28 乐视控股(北京)有限公司 Method and device for controlling power supply of Type-C interface, and electronic equipment
US10539999B2 (en) * 2016-08-25 2020-01-21 Samsung Electronics Co., Ltd. Semiconductor device and method of operating the same
CN107451079A (en) * 2017-08-09 2017-12-08 合肥联宝信息技术有限公司 The identification of lines method and device of a kind of electronic equipment

Also Published As

Publication number Publication date
CN108628713A (en) 2018-10-09

Similar Documents

Publication Publication Date Title
CN108628713B (en) Device detection method and device, storage medium and electronic device
US12013735B2 (en) Electronic device, method of controlling charging by electronic device, and method of supplying power by power supply device
US10042801B2 (en) System for detecting universal serial bus (USB) device and method thereof
EP2852006A1 (en) Connection member for headset plug, headset jack and terminal device
CN111277991B (en) Operator name display method and device, mobile terminal and storage medium
EP3713279B1 (en) Adjacent cell rrm measurement control method, mobile communication terminal, and network side device
CN109450023B (en) Charging circuit, charging processing method, electronic device, and storage medium
CN111651387B (en) Interface circuit and electronic equipment
CN108681514A (en) Equipment detection method, device, storage medium and electronic equipment
US20130326092A1 (en) Processing input event of external device
US20220132250A1 (en) Mobile Terminal and Control Method
TW202030579A (en) Indicator for ac power adapter
CN112199065A (en) Method and device for determining local display area compensation value, storage medium and terminal equipment
CN108777627B (en) Power supply method and device
CN112286849A (en) Wireless charging base data switching method and system, storage medium and terminal equipment
KR101485154B1 (en) Method for Changing to Wake Up Mode at External Device and Mobile Terminal Docking Thereat
CN112333327B (en) Equipment detection method, device, storage medium, electronic equipment, external equipment and system
CN112367701B (en) Mobile terminal control method, device, storage medium and mobile terminal
US10983586B2 (en) Power management system and power management method
CN112256610B (en) Connection control method, system, storage medium and mobile terminal
EP4280072A1 (en) Data transmission method of electronic device, electronic device, and interface circuit
WO2022065688A1 (en) Method for controlling power supply and electronic device using same
US20150086061A1 (en) Connection member for connecting headset plug, headset jack and electronic device
US20220360093A1 (en) Charging and discharging structure, and charging method
WO2023159705A1 (en) Dimming method and apparatus for display panel, and storage medium and terminal device

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