WO2017206161A1 - 一种接口检测方法及装置 - Google Patents

一种接口检测方法及装置 Download PDF

Info

Publication number
WO2017206161A1
WO2017206161A1 PCT/CN2016/084657 CN2016084657W WO2017206161A1 WO 2017206161 A1 WO2017206161 A1 WO 2017206161A1 CN 2016084657 W CN2016084657 W CN 2016084657W WO 2017206161 A1 WO2017206161 A1 WO 2017206161A1
Authority
WO
WIPO (PCT)
Prior art keywords
interface
bus
extended
expansion
terminal
Prior art date
Application number
PCT/CN2016/084657
Other languages
English (en)
French (fr)
Inventor
张含波
Original Assignee
达闼科技(北京)有限公司
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 达闼科技(北京)有限公司 filed Critical 达闼科技(北京)有限公司
Priority to CN201680002678.0A priority Critical patent/CN107003974B/zh
Priority to PCT/CN2016/084657 priority patent/WO2017206161A1/zh
Publication of WO2017206161A1 publication Critical patent/WO2017206161A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling
    • G06F13/4068Electrical coupling
    • G06F13/4081Live connection to bus, e.g. hot-plugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/10Program control for peripheral devices
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/50Testing of electric apparatus, lines, cables or components for short-circuits, continuity, leakage current or incorrect line connections
    • G01R31/66Testing of connections, e.g. of plugs or non-disconnectable joints
    • G01R31/68Testing of releasable connections, e.g. of terminals mounted on a printed circuit board

Definitions

  • the present invention relates to the field of terminal technologies, and in particular, to an interface detection method and apparatus.
  • the cloud robot is an intelligent robot that puts the cognitive system in the cloud, the body, the drive and the sensor are placed on the robot body, and connects the two through mobile communication; the cloud robot is the development direction of the intelligent humanoid robot.
  • terminals generally include one or more interfaces for plugging USB, earphones or data lines into these corresponding interfaces to establish a connection with the terminal to implement corresponding functions.
  • the USB interface can only be inserted into the USB device, the earphone interface can only be inserted into the earphone device, etc.
  • the terminal When the USB device is inserted into the USB interface and the earphone device is inserted into the earphone interface, the terminal usually informs the system by means of hardware interruption. Determine whether the interface is plugged into the device according to the voltage of the pin of the corresponding interface.
  • the method of detecting the type of the voltage is difficult to control due to the voltage grading, so it can only support a very small number of simple devices, such as USB, headphones, etc., and the scalability is not strong.
  • the embodiment of the invention provides an interface detection method and device for solving the method of detecting the type of the device by the voltage level in the prior art. Since the voltage classification is difficult to control, only a few simple devices can be supported, and the scalability is not strong. technical problem.
  • an embodiment of the present invention provides an interface detection method, including the following steps:
  • the interface pin used for insertion detection is at the first level, it is determined that the interface of the terminal has an extension device. Inserting; the interface chip of the expansion device is hooked onto the bus;
  • the device information includes a device identifier ID
  • an interface detecting apparatus including:
  • a detecting module configured to detect an interface pin of the terminal
  • a first determining module configured to determine that an interface of the terminal has an extended device insertion if the interface pin for insert detection is at a first level
  • a hooking module configured to hang the interface chip of the expansion device on the bus
  • a reading module configured to perform power-on initialization on the extended device, and read device information of the extended device by using a bus;
  • the device information includes a device ID;
  • a second determining module configured to determine, according to the device ID, a device type of the extended device.
  • the current method of detecting the type of the device by the voltage level because the voltage grading is difficult to control, can only support a very small number of simple devices, and the problem of the non-extension is not strong.
  • the technical solution provided by the embodiment of the present invention can pass the interface tube of the detecting terminal. a foot, when the interface pin for insert detection is at a first level, the interface of the terminal is determined to have an extended device insertion, and the extended device is hung on the bus, and after the power is initialized to the extended device, the terminal can be read through the bus.
  • the device type of the extended device is obtained, and the embodiment of the present invention can support more types of extended device insertion, and has better scalability, and solves the method for detecting device type by voltage level in the prior art, because voltage grading is difficult to control, It can only detect a very small number of interface devices and technical problems that are not scalable.
  • FIG. 1 is a schematic flowchart of implementing an interface detection method according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an interface detection process according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram 1 of an interface detecting apparatus according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram 2 of an interface detecting apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram 3 of an interface detecting apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a mobile phone being inserted into an extension device according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a pad plug-in expansion device in an embodiment of the present invention.
  • a terminal such as a mobile phone or a computer can only notify the system by means of hardware interruption, and then the system detects the specific type of the device by switching and judging the hardware state.
  • the pin voltage of the standard interface on the mobile phone or the computer is obtained, and the standard interface is compared with the preset voltage to determine whether the standard interface is inserted into the device corresponding to the interface.
  • the system detects by means of high voltage and low voltage. It can only detect the type of equipment simply, and cannot obtain the specific version of the equipment and the manufacturer. Moreover, the existing equipment detection is difficult to control due to the voltage classification, so it can only support a very small number. Simple devices, such as USB, UART and other standard interface devices, these devices usually have few pins (for example: 3pin), and can only determine whether to insert the corresponding device by obtaining the voltage of the pin and according to the value of the voltage ( For example, if VBUS reaches 5v, it means that USB is plugged in, etc., the usage scenario is limited, and the scalability is not strong, and it cannot be applied to a composite interface device (for example, 68pin) with complicated functions.
  • a composite interface device for example, 68pin
  • an embodiment of the present invention provides an interface detection method and apparatus.
  • a device ID By presetting a device ID, reading a type of an extended device by using a bus technology, loading a corresponding driver and starting a corresponding service and application, thereby making the terminal
  • the interface status can be detected without interruption, and can be applied to composite interface devices with complex functions, which is extremely scalable and widely used.
  • FIG. 1 is a schematic flowchart of an implementation of an interface detection method according to Embodiment 1 of the present invention. As shown in the figure, the interface detection method may include the following steps:
  • Step 101 Detect an interface pin of the terminal.
  • Step 102 If the interface pin for insert detection is at a first level, determine that the interface of the terminal has an expansion device inserted; the interface chip of the expansion device is hooked onto the bus;
  • Step 103 Perform power-on initialization on the extended device, and read device information of the extended device by using a bus; the device information includes a device identifier ID;
  • Step 104 Determine a device type of the extended device according to the device ID.
  • the embodiment of the present invention may detect the interface pin of the terminal after the terminal is powered on; if the extension device is plug and play, then The embodiment of the present invention can detect the interface pin of the terminal by interrupting.
  • interface pin pins of the terminal may include interface pins for insertion detection, for example: PLUG_DET_UP and PLUG_DET_Down. If the interface pin for insertion detection is at the first level during detection, the terminal may be determined.
  • the interface has an extended device plugin.
  • the first level may be a low level or a high level. For example, detecting an interface pin of the terminal. If both PLUG_DET_UP and PLUG_DET_Down are low, it may be determined that the interface of the terminal has an extended device insertion.
  • the bus is a common communication trunk for transmitting information between various functional components of the computer.
  • various components of the system can be connected by a bus, and the external expansion device can be connected to the bus through a corresponding interface chip, and a bus can be connected.
  • a plurality of expansion devices are connected, and the extension devices can respectively transmit device information to the system of the terminal.
  • the device information of the extended device may include a device type, and the embodiment of the present invention passes through a bus.
  • the device information of the extended device is read in the form, and the device type of the extended device is obtained.
  • the device type is a classification of the device, and the extension device of the type may have a plurality of different devices.
  • the device ID is an ID that uniquely identifies the extended device. In specific implementation, the device ID may be pre-written on the extended device.
  • the terminal after the expansion device is inserted into the terminal, the terminal is hung on the bus, and the terminal determines whether the expansion device is inserted by detecting the interface pin, and the device type of the extended device can be read through the bus after determining that the expansion device is inserted.
  • the insertion and detection of various types of extension devices can be implemented through an interface.
  • one interface of the terminal in the prior art can only be connected to one standard interface device, and the embodiment of the present invention uses the bus form at the same time. It can support the insertion of multiple expansion devices, and has strong scalability. It solves the problems of detecting device types and detecting only standard interface devices by means of high voltage and low voltage in the prior art.
  • the method may further include:
  • the state synchronization with the expansion device is performed.
  • the probe of the extended device may be performed.
  • the device may perform a power-on initialization operation, and then read device information of the extended device by using a bus.
  • the device information may include a device type, load a corresponding driver according to the device type of the extended device, and start a corresponding service and application.
  • the CPU of the terminal needs to start a program related to the driver and the service, and the part of the extension device needs the CPU of the terminal to send the related program to the extension device.
  • the specific startup process may be: initializing the interface bus, sending the related program to the extended device, and the extended device is started, and then the terminal HOST end synchronizes with the state of both ends of the extended device to enter the normal working mode.
  • the state synchronization of the two ends may read the state of the extended device after establishing the connection, and expand the device.
  • the status may include the state when the last extended device was turned off, and the terminal may control the extended device on/off.
  • the program required for the expansion device to be sent to the extension device may be pre-stored for the terminal, or may be downloaded from the cloud to the extension device.
  • the device type of the extension device may be a computer cat (common name of a modem modem) or an application-type device, and the application-type device may specifically be a charging treasure, a heart rate monitor, a projector, or the like.
  • the embodiment of the present invention may load the driver and start the corresponding service and application, and complete the state synchronization through the bus to implement normal use of the extended device.
  • the method may further include:
  • the expansion device is maintained according to the working state.
  • the working state of the extended device may dynamically change, for example, busy busy ⁇ idid idle ⁇ suspend suspend ⁇ hibernate standby ⁇ close down, and an abnormal situation may occur.
  • the embodiment of the present invention can monitor the working state of the extended device and maintain the state of the extended device through a corresponding service program, for example, notifying the terminal CPU when the extended device is normally inserted or not inserted, popping up the prompt message when the abnormality is inserted, or running Status updates and maintenance during the process to ensure the normal use of the expansion device.
  • the bus may be a serial bus I2C bus, and an interface chip of the expansion device is hooked onto the bus, and the I2C interface chip of the extended device may be hooked to the I2C bus.
  • the bus may be an I2C bus or other bus.
  • the I2C interface chip in the expansion device is connected to the I2C bus after the expansion device is inserted into the interface of the terminal, and the interface chip of the expansion device can pass through the I2C bus.
  • the system of the terminal establishes a connection, and the system of the terminal can read the device information of the extended device through the I2C bus.
  • I2C bus read and write usually has a fixed format, the general order can be: address (read / write)
  • the device information of the extended device can be finally obtained.
  • the embodiment of the present invention can preset a set of addresses (for example, 2, 4 or 8). ) as the address of the extension device.
  • the I2C bus and the like are adopted because these methods are relatively common and mainstream, and are easy to be used/understood by those skilled in the art, so the I2C bus is taken as an example here; however, in theory, other methods are also possible, as long as The purpose of attaching the external expansion device can be achieved.
  • the I2C bus is only used to teach the person skilled in the art how to implement the invention, but it does not mean that only the I2C bus can be used. In the implementation process, the corresponding method can be determined in combination with practical needs. .
  • the device information may further include: manufacturer information and/or device version.
  • the device information may further include information such as manufacturer information, device version, and the like.
  • the prior art detects the device type by means of a high-low voltage, and can only detect the device type, and cannot obtain the specific version of the device, the manufacturer, and the like.
  • the embodiment of the present invention reads the device information of the extended device by using a bus.
  • the device information may include information such as a specific version of the device, a manufacturer, and the like, so that comprehensive information of the extended device can be obtained.
  • the interface of the terminal may be a composite interface of 68 pins.
  • the interface of the terminal in the embodiment of the present invention may be a composite interface, and may be a composite interface of 68 pins or other number of pins.
  • the embodiment of the present invention adopts a composite interface. Therefore, the interface can support multiple types of expansion devices, and the terminal in the prior art can only support devices of the standard interface, and the embodiment of the present invention is more scalable.
  • FIG. 2 is a schematic diagram of an interface detection process in an embodiment of the present invention. As shown in the figure, the interface detection process may include the following steps:
  • Step 201 Detect interface pins Plug_DET_UP and Plug_DET_Down;
  • Step 202 Determine whether both pins are low level
  • step 203 If yes, go to step 203;
  • step 207 If not, proceed to step 207;
  • Step 203 Determine an expansion device insertion.
  • Step 204 Start expanding device detection.
  • Step 205 Obtain a device ID by using I2C.
  • Step 206 Report the extended device type, and end
  • Step 207 Determine whether both pins are high level
  • the extension device is prompted to insert a connection problem and ends.
  • the device type may be determined according to the device ID. For example, if the device ID of the extended device is A0123, the device type of the extended device may be A.
  • the pins Plug_DET_UP and Plug_DET_Down of the interface for detecting the detection may be detected. If the two pins are both low, the expansion device insertion may be determined, and then the device detection, the device ID, and the report are obtained through the I2C bus. Operation such as device type; if both pins are high, there is no expansion device insertion; if one pin is high and the other pin is low, it indicates that the expansion device has a problem with the connection and the connection is abnormal. The user is prompted to insert a connection problem, and the detection operation is performed again after the user reinserts.
  • an interface detection apparatus is also provided in the embodiment of the present invention. Since the principle of solving the problem of these devices is similar to an interface detection method, the implementation of these devices can refer to the implementation of the method, and the repetition is no longer Narration.
  • FIG. 3 is a schematic structural diagram 1 of the interface detecting apparatus in the embodiment of the present invention.
  • the interface detecting apparatus may include:
  • the detecting module 301 is configured to detect an interface pin of the terminal
  • the first determining module 302 is configured to: if the interface pin used for the insertion detection is at the first level, determine that the interface of the terminal has an extended device insertion;
  • the hooking module 303 is configured to hang the interface chip of the extended device on the bus;
  • the reading module 304 is configured to perform power-on initialization on the extended device, and read device information of the extended device by using a bus; the device information includes a device identifier ID;
  • the second determining module 305 is configured to determine, according to the device ID, a device type of the extended device.
  • the detecting module may detect the interface pin of the terminal after the terminal is powered on, or may detect the interface pin of the terminal periodically or irregularly by means of an interrupt.
  • the first level may be a low level or a high level, and the first determining module may be specifically configured to: if the interface pin for insert detection is low, determine that the interface of the terminal has an extended device insertion; There may be many interface pin pins, which may include interface pins for insert detection, for example: PLUG_DET_UP and PLUG_DET_Down, and the first determining module may be specifically used if the PLUG_DET_UP and PLUG_DET_Down pins are low, determining The interface of the terminal has an expansion device inserted.
  • the hook module can be used to connect the interface chip of the expansion device to the bus after the expansion device is inserted into the interface of the terminal, and multiple expansion devices can be connected to one bus.
  • the hook module can be used to interface multiple expansion devices.
  • the chips are hooked up to the bus, and these expansion devices can directly transfer data directly to the terminal's system.
  • the expansion device is hung on the bus, and the detection module can detect whether the extension device is inserted by detecting the terminal interface pin, and the read module is determined to have an extension.
  • the device type of the extended device can be read through the bus.
  • insertion and detection of various types of extended devices can be realized through an interface; and, in the prior art, one interface of the terminal can only be connected.
  • a standard interface device, and the embodiment of the present invention can support the insertion of multiple extended devices at the same time, and has strong scalability, and solves the problem of detecting the device type by using a high voltage and low voltage in the prior art. Can detect problems such as standard interface devices.
  • FIG. 4 is a schematic structural diagram 2 of the interface detecting apparatus in the embodiment of the present invention. As shown in the figure, the apparatus may further include:
  • the startup module 306 is configured to load the device driver and start the corresponding service program and application according to the device type of the extended device;
  • a sending module 307 configured to send, to the extended device, a program required for starting the extended device
  • the synchronization module 308 is configured to perform state synchronization with the extended device after the expansion device is started.
  • the sending module may be specifically configured to send a pre-stored program required for starting the extended device to the extended device, and may also be used to download, from the cloud, a program required for starting the extended device and After the download is successful, the program required for the expansion device to be started is sent to the extension device.
  • the startup module loads the driver and starts the corresponding service and application, and the sending module sends the program required for starting the extended device to the extended device, and the synchronization module
  • the state synchronization can be completed through the bus to achieve normal use of the extended device.
  • FIG. 5 is a schematic structural diagram 3 of the interface detecting apparatus in the embodiment of the present invention. As shown in the figure, the apparatus may further include:
  • a monitoring module 309 configured to monitor an operating state of the extended device
  • the maintenance module 310 is configured to perform maintenance on the extended device according to the working state.
  • the monitoring module may be specifically configured to monitor an working state of the extended device, where the working state of the extended device may specifically include busy busy, idle idle, suspended suspend, dormant standby, closed down, and the like. An abnormal situation may occur.
  • the monitoring module can monitor the working state of the extended device through a corresponding service program, and the maintenance module is used to maintain the state of the extended device, for example, notifying the terminal CPU when the extended device is normally inserted or not inserted, when the insertion is abnormal. Pop-up prompts, or status updates and maintenance during the run to ensure the normal use of the expansion device.
  • the bus may be a serial bus I2C bus
  • the hook module may be specifically For hanging the I2C interface chip of the expansion device onto the I2C bus.
  • the bus may be an I2C bus or other bus
  • the hook module may hang the I2C interface chip in the expansion device on the I2C bus after the expansion device is inserted into the interface of the terminal, and the interface chip of the extended device may pass
  • the I2C bus is in contact with the system of the terminal, and the reading module can read the device information of the extended device through the I2C bus.
  • the device information read by the reading module may further include: manufacturer information and/or device version.
  • the device information may further include information such as manufacturer information, device version, and the like.
  • the reading module may be specifically configured to read information such as manufacturer information, device version, device ID, and the like of the extended device.
  • the interface of the terminal may be a composite interface of 68 pins.
  • the interface of the terminal in the embodiment of the present invention may be a composite interface, and may be a composite interface of 68 pins or other number of pins.
  • the embodiment of the present invention adopts a composite interface. Therefore, the interface can support multiple types of expansion devices, and the terminal in the prior art can only support devices of the standard interface, and the embodiment of the present invention is more scalable.
  • FIG. 6 is a schematic structural diagram of a mobile phone insertion expansion device according to an embodiment of the present invention. As shown in the figure, the mobile phone is used as a terminal as an example.
  • the mobile phone in the embodiment of the present invention is provided with an expansion interface for inserting the expansion device.
  • the expansion interface on the mobile phone may be a male port and/or a female port
  • the expansion device to be inserted may include both a male port and a female port
  • the male and female ports of the extended device may be respectively Placed on the outside of the two opposite faces of the expansion device.
  • the expansion interface on the mobile phone is a male port
  • the expansion device is a music player and a projector.
  • the music player has a female port on one outer side and a male port on the outer side of the opposite side.
  • One side of the plane is provided with a female port
  • the other side of the opposite side is provided with a male port.
  • the female port of the music player is docked with the male port of the mobile phone, and the female port of the projector is docked with the male port of the music player, so that two external expansion devices are superimposed on the back of the mobile phone.
  • the embodiment of the present invention can be directly connected to the bus through the form of a bus, and the data can be directly transmitted to the mobile phone.
  • the mobile phone can detect the public port of the mobile phone. If the PLUG_DET_UP and PLUG_DET_Down of the public port of the mobile phone are both low, the expansion interface of the mobile phone has an expansion device inserted; then the mobile phone can send the device information to the corresponding address of the bus.
  • the request, the music player responds to the request, and the response message may carry its own device ID (assumed to be YYBFQ01), the device version number, and the manufacturer, and the mobile device obtains the device ID of the extended device. After that, it can be determined that the extension device is a music player.
  • the mobile phone can continue to detect the public port of the music player. If the PLUG_DET_UP and the PLUG_DET_Down of the male port of the music player are both low, the expansion interface of the music player has an expansion device inserted; The mobile phone may then send a request for acquiring device information to the corresponding address of the bus, and the projector responds to the request, and the response message may carry its own device ID (assumed to be TYY01), the device version number, and the manufacturer. After the mobile phone obtains the device ID of the extended device, it can be determined that the extended device is a projector.
  • the embodiment of the present invention can respectively load the device driver for the music player and the projector and start the corresponding service program and application:
  • Projection after loading the projector driver and starting the corresponding service program and application of the projector The instrument sends the program required for the projector to start, and after the projector is successfully started, the mobile phone and the projector complete the state synchronization.
  • the mobile phone and external expansion device music player, projector can enter the normal working mode, the user can use the mobile phone to open the mp3 while playing the slide show.
  • the intelligent robot in the embodiment of the present invention is provided with an expansion interface, which is used for inserting an expansion device, and the expansion device may specifically be a charging treasure or the like.
  • the expansion interface on the intelligent robot may be a public port, and the interface on the charging treasure may be a female port; or the expansion interface on the intelligent robot may be a female port, and the charging port is The interface may be a male port; or the expansion interface on the intelligent robot includes both a male port and a female port, and the interface on the charging treasure is a male port or a female port, or both a male port and a female port.
  • the charging treasure After the interface of the charging treasure is docked with the expansion interface of the intelligent robot, the charging treasure is directly hung on the I2C bus, and the data can be directly transmitted with the intelligent robot.
  • the intelligent robot can detect the pin of the extended interface of the intelligent robot. If the PLUG_DET_UP and the PLUG_DET_Down of the pin of the extended interface of the intelligent robot are both low, the extended interface of the intelligent robot has an extended device inserted; The intelligent robot may send a request for acquiring device information to a corresponding address of the bus, and the charging treasure may carry its own device ID (assumed to be CDB092), the device version number, and the manufacturer, etc. in response to the request. After the smart robot acquires the device ID of the extended device, it can be determined that the extended device is a charging treasure (abbreviated as CDB).
  • CDB charging treasure
  • the intelligent robot can download the charging program, the application program and the application program required for the charging treasure to start from the cloud, and then load the charging treasure driver and start the charging treasure.
  • Corresponding service program and application send the program required for the charging treasure to start to the charging treasure, and the smart machine is activated after the charging treasure is successfully started.
  • the person reads the state of the charging treasure and completes the state synchronization.
  • the intelligent robot and the charging treasure can enter a normal working mode, and the charging treasure can charge the intelligent robot to ensure the normal use of the intelligent robot while the intelligent robot executes the user instruction.
  • FIG. 7 is a schematic structural diagram of a pad plug-in expansion device according to an embodiment of the present invention. As shown in the figure, the following embodiment of the present invention uses a tablet (pad) as a terminal as an example for description.
  • the pad in the embodiment of the present invention is provided with an extension interface, which can be used to insert an expansion device, and the extension device may specifically be a tablet keyboard, a conference call speaker, a printer, or the like.
  • the expansion interface on the pad may be a public port or a female port
  • the interface on the extended device may include both a public port and a female port.
  • the expansion interface on the pad is a male port.
  • the interface chip of the tablet keyboard is hung on the I2C bus, which can be directly connected to the pad system. transmit information.
  • the pad can detect the pin of the extended interface. If the PLUG_DET_UP and the PLUG_DET_Down of the pin of the extended interface of the pad are both low, the extended interface of the pad has an extended device inserted; then the pad can be connected to the bus.
  • the corresponding address sends a request for acquiring device information, and the tablet keyboard responds to the request, and the response packet may carry its own device ID (assumed to be PBJP008), the device version number, and the manufacturer, and the pad acquires the information. After expanding the device ID of the device, it can be determined that the extended device is a tablet keyboard (abbreviated as PBJP).
  • the pad may pre-store the service program and the application program required for the tablet keyboard to be started in the pad storage space. After determining that the extension device is the tablet keyboard, the pad may load the keyboard driver for the tablet keyboard. And initiating a corresponding service program and an application, and sending the program required for the keyboard to be started to the tablet keyboard. After the tablet keyboard is successfully started, the pad reads the state of the tablet keyboard, and completes state synchronization.
  • the pad and the tablet keyboard can enter the normal working mode, and the user can use the pad.
  • the input operation is realized by the tablet keyboard.
  • the user can plug in a conference call speaker (corresponding to the mother port of the conference call speaker) in the public port of the tablet keyboard.
  • the interface chip of the conference call speaker is also hung on the I2C bus, and can directly transmit information with the pad system.
  • the male port of the pad is inserted into the female port of the tablet keyboard, the male port of the tablet keyboard is equivalent to the male port of the pad, and the extended function is realized.
  • the pad can detect the pin of the public port of the tablet keyboard. If the PLUG_DET_UP and the PLUG_DET_Down of the male pin are both low, the expansion device is inserted; then the pad can be the corresponding address of the bus.
  • Sending a request for acquiring device information, the conference call speaker responding to the request, and the response message may carry its own device ID (assumed to be DHHYYSQ011), a device version number, and a manufacturer, and the pad acquires the extension. After the device ID of the device, it can be determined that the extended device is a conference call speaker (abbreviated as DHHYYSQ).
  • the pad may pre-store the service program and application program required for the startup of the conference call speaker in the pad storage space. After determining that the extension device is a conference call speaker, the pad may be the conference call speaker. Loading a speaker driver and activating a corresponding service program and application, transmitting a program required for the speaker to be activated to the conference call speaker, and after the conference call speaker is successfully started, the pad reads the state of the conference call speaker, Complete state synchronization.
  • the pad and the conference call speaker can enter the normal working mode, and the user can increase the volume of the conference call through the conference speaker while using the pad.
  • a printer (corresponding to the mother port of the printer) can be inserted into the public mouth of the conference speaker, and the interface chip of the printer is also hung on the I2C bus, which can be The pad's system transfers information directly.
  • the male mouth of the pad is connected to the female port of the tablet keyboard, the male port of the tablet keyboard is inserted into the female port of the conference call speaker, and the male mouth of the conference call speaker is equivalent to the pad.
  • the public port to achieve extended functions.
  • the pad can detect the pin of the public port of the conference call speaker. If the PLUG_DET_UP and the PLUG_DET_Down of the male pin are both low, the expansion device is inserted; then the pad can be corresponding to the bus.
  • the address sends a request for acquiring device information, and the printer responds to the request, and the response message may carry its own device ID (assumed to be DYJ080), the device version number, and the manufacturer, and the pad acquires the extended device. After the device ID, it can be determined that the extended device is a printer (abbreviated as DYJ).
  • the pad may download a service program and an application program required for starting the printer from the network, and the pad may load the printer driver for the printer and start the corresponding service program and application.
  • the program sends the program required for the printer to start to the printer.
  • the pad reads the state of the printer and completes the state synchronization.
  • the pad and the printer can enter the normal working mode, and the user can implement the document printing function through the printer while using the pad.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Telephone Function (AREA)

Abstract

一种接口检测方法及装置,所述方法包括:检测终端的接口管脚(101);如果用于插入检测的接口管脚为第一电平,确定终端的扩展接口有扩展设备插入;所述扩展设备的接口芯片被挂到总线上(102);对所述扩展设备进行上电初始化,通过总线读取所述扩展设备的设备信息;所述设备信息包括设备ID(103);根据所述设备ID确定所述扩展设备的设备类型(104)。所述方法将插入的扩展设备挂到总线上,在用于插入检测的接口管脚为第一电平时,通过总线读取所述扩展设备的设备类型,适用于各种类型的接口检测,扩展性较强。

Description

一种接口检测方法及装置 技术领域
本发明涉及终端技术领域,特别涉及一种接口检测方法及装置。
背景技术
云端机器人是将认知系统放在云里,身体、驱动、传感器放在机器人本体上,通过移动通信将二者连接起来的智能机器人;云端机器人是智能仿人机器人发展的方向。
随着终端技术的不断发展,终端产品愈发种类繁多,例如:智能手机、电脑、pad等。目前终端大多包括一个或多个接口,用于将USB、耳机或数据线等插入这些相应的接口从而与终端建立连接实现相应的功能。
现有技术中,USB接口对应只能插入USB设备、耳机接口对应只能插入耳机设备等等,当将USB设备插入USB接口、耳机设备插入耳机接口后,终端通常是采用硬件中断的方式告知系统,根据相应接口的引脚的电压来确定该接口是否插入设备。
现有技术不足在于:
通过电压高低检测设备类型的方式,由于电压分级难以控制,因此只能支持极少数的简单设备,例如:USB、耳机等,扩展性不强。
发明内容
本发明实施例提出了一种接口检测方法及装置,用于解决现有技术中通过电压高低检测设备类型的方式,由于电压分级难以控制,只能支持极少数的简单设备、扩展性不强的技术问题。
在一个方面,本发明实施例提供了一种接口检测方法,包括如下步骤:
检测终端的接口管脚;
如果用于插入检测的接口管脚为第一电平,确定终端的接口有扩展设备 插入;所述扩展设备的接口芯片被挂到总线上;
对所述扩展设备进行上电初始化,通过总线读取所述扩展设备的设备信息;所述设备信息包括设备标识ID;
根据所述设备ID确定所述扩展设备的设备类型。
在另一个方面,本发明实施例提供了一种接口检测装置,包括:
检测模块,用于检测终端的接口管脚;
第一确定模块,用于如果用于插入检测的接口管脚为第一电平,确定终端的接口有扩展设备插入;
挂接模块,用于将所述扩展设备的接口芯片挂到总线上;
读取模块,用于对所述扩展设备进行上电初始化,通过总线读取所述扩展设备的设备信息;所述设备信息包括设备ID;
第二确定模块,用于根据所述设备ID确定所述扩展设备的设备类型。
有益效果如下:
当前通过电压高低检测设备类型的方式,由于电压分级难以控制,只能支持极少数的简单设备、扩展性不强的问题,由于本发明实施例所提供的技术方案,可以通过检测终端的接口管脚,在用于插入检测的接口管脚为第一电平时确定终端的接口有扩展设备插入,所述扩展设备被挂到总线上,在对所述扩展设备上电初始化之后,可以通过总线读取得到所述扩展设备的设备类型,本发明实施例可以支持较多类型的扩展设备插入,扩展性较好,解决了现有技术中通过电压高低来检测设备类型的方式由于电压分级难以控制、只能检测非常少数的接口设备、扩展性不强的技术问题。
附图说明
下面将参照附图描述本发明的具体实施例,其中:
图1为本发明实施例中接口检测方法实施的流程示意图;
图2为本发明实施例中接口检测过程示意图;
图3为本发明实施例中接口检测装置的结构示意图一;
图4为本发明实施例中接口检测装置的结构示意图二;
图5为本发明实施例中接口检测装置的结构示意图三;
图6为本发明实施例中手机插入扩展设备的结构示意图;
图7示出了本发明实施例中pad插接扩展设备的结构示意图。
具体实施方式
为了使本发明的技术方案及优点更加清楚明白,以下结合附图对本发明的示例性实施例进行进一步详细的说明,显然,所描述的实施例仅是本发明的一部分实施例,而不是所有实施例的穷举。并且在不冲突的情况下,本说明中的实施例及实施例中的特征可以互相结合。
发明人在发明过程中注意到:
现有技术中,手机、电脑等终端只能通过硬件中断的方式告知系统,然后系统通过硬件状态的切换和判断来检测设备的具体类型。当检测到中断时,获取该手机或电脑上具有的标准接口的引脚电压,根据引脚电压与预设电压比较来确定该标准接口是否插入了该接口对应的设备。
系统通过电压高低的方式检测,只能简单的检测设备类型,无法得到设备的具体版本和制造商等信息;而且,现有的设备检测由于电压的分级比较难以控制,所以只能支持极少数的简单设备,例如:USB、UART等标准接口设备,这些设备通常只有很少的管脚(例如:3pin),而且只能通过获取该管脚的电压并根据电压的值来确定是否插入相应设备(例如:VBUS达到5v表示插入了USB等),使用场景受限、扩展性不强,无法适用于具有复杂功能的复合接口设备(例如:68pin)。
针对上述不足,本发明实施例提出了一种接口检测方法及装置,通过预置设备ID、利用总线技术读取扩展设备的类型来加载相应的驱动程序并启动相应的服务和应用,从而使得终端无需中断即可检测出接口状态,并且可以适用于具有复杂功能的复合接口设备,扩展性极强、应用广泛。
为了便于本申请的实施,下面结合具体实施例对本申请所提出的接口检 测方法及装置进行说明。
实施例一、
图1示出了本发明实施例一中接口检测方法实施的流程示意图,如图所示,所述接口检测方法可以包括如下步骤:
步骤101、检测终端的接口管脚;
步骤102、如果用于插入检测的接口管脚为第一电平,确定终端的接口有扩展设备插入;所述扩展设备的接口芯片被挂到总线上;
步骤103、对所述扩展设备进行上电初始化,通过总线读取所述扩展设备的设备信息;所述设备信息包括设备标识ID;
步骤104、根据所述设备ID确定所述扩展设备的设备类型。
具体实施时,如果所述扩展设备是在终端下电的情况下安装,那么,本发明实施例可以在终端上电以后检测终端的接口管脚;如果所述扩展设备为即插即用,那么,本发明实施例可以通过中断检测终端的接口管脚。
终端的接口管脚pins可以有很多,其中可以包括用于插入检测的接口管脚,例如:PLUG_DET_UP和PLUG_DET_Down,在检测时如果用于插入检测的接口管脚为第一电平,则可以确定终端的接口有扩展设备插入。其中,所述第一电平可以为低电平或者高电平,例如:检测对终端的接口管脚,如果PLUG_DET_UP和PLUG_DET_Down均为低电平,则可以确定终端的接口有扩展设备插入。
所述扩展设备插入终端的接口后,所述扩展设备的接口芯片即被挂到总线上,终端的系统即可通过总线读取所述扩展设备的设备信息。总线(Bus)是计算机各种功能部件之间传送信息的公共通信干线,本发明实施例中系统的各个部件可以通过总线相连,外部扩展设备可以通过相应的接口芯片与总线相连,一条总线上可以连接多个扩展设备,且这些扩展设备分别可以传送设备信息至终端的系统。
所述扩展设备的设备信息可以包括设备类型,本发明实施例通过总线的 形式读取扩展设备的设备信息,即可获得所述扩展设备的设备类型。其中,设备类型是设备的分类,一个类型的扩展设备可以有多种不同的设备,设备ID则是唯一标识所述扩展设备的ID,具体实施时,所述扩展设备上可以预先写有设备ID,通过设备ID可以确定出所述扩展设备的设备类型。例如:充电宝这一类型的扩展设备可以有很多,ID=A01则是一具体的充电宝设备。
本发明实施例通过将扩展设备插入终端后即挂到总线上,终端通过检测接口管脚来确定是否有扩展设备插入,在确定有扩展设备插入后通过总线即可读取到扩展设备的设备类型,通过一个接口即可实现各种类型的扩展设备的插入、检测;并且,现有技术中终端的一个接口只能连接一个标准接口设备,而本发明实施例由于采用的是总线形式,同一时刻可以支持多个扩展设备的插入,扩展性较强,解决了现有技术中通过电压高低的方式来检测设备类型、只能检测标准接口设备等问题。
实施中,所述方法可以进一步包括:
根据所述扩展设备的设备类型,加载设备驱动并启动相应的服务程序和应用程序;
向所述扩展设备发送所述扩展设备启动所需要的程序;
待所述扩展设备启动后,与所述扩展设备执行状态同步。
具体实施时,如果确定终端的接口有扩展设备插入,可以进行扩展设备的探测(probe),具体可以为:对扩展设备进行上电初始化操作,然后通过总线读取所述扩展设备的设备信息。所述设备信息中可以包括设备类型,根据所述扩展设备的设备类型加载相应的驱动程序,并启动相应的服务和应用。
具体实施时,任何情况下,终端的CPU都需要启动相关驱动和服务等程序,部分扩展设备需要终端的CPU将相关的程序发送给所述扩展设备。具体的启动过程可以为:初始化接口总线,发送相关的程序给扩展设备,所述扩展设备启动,然后终端HOST端与扩展设备两端状态同步,进入正常工作模式。其中,两端状态同步可以为建立连接后读取扩展设备的状态,扩展设备 的状态可以包括上次扩展设备关机时的状态,所述终端可以控制扩展设备开/关机。
所述向所述扩展设备发送的所述扩展设备启动所需要的程序,可以为终端预先存储,也可以为终端从云端下载后再传输至扩展设备。
所述扩展设备的设备类型可以为电脑猫(调制解调器modem的俗称)、或者应用类设备,所述应用类设备具体可以为充电宝、心率计、投影仪等。
本发明实施例可以在确定所述扩展设备的设备类型后,加载驱动并启动相应的服务和应用,可以通过总线完成状态同步,实现扩展设备的正常使用。
实施中,所述方法可以进一步包括:
监测所述扩展设备的工作状态;
根据所述工作状态对所述扩展设备进行维护。
具体实施时,在完成初始化正常工作之后,所述扩展设备的工作状态可能会发生动态变化,例如:繁忙busy→空闲idle→挂起suspend→休眠standby→关闭down等,还有可能发生异常情况。
本发明实施例可以通过相应的服务程序来监测扩展设备的工作状态、维护扩展设备的状态,例如:在正常插入或未插入扩展设备时通知终端CPU、在插入异常时弹出提示信息、或者在运行过程中进行状态更新和维护等,以确保扩展设备的正常使用。
实施中,所述总线具体可以为串行总线I2C总线,所述扩展设备的接口芯片被挂到总线上具体可以为所述扩展设备的I2C接口芯片被挂到I2C总线上。
具体实施时,所述总线可以为I2C总线或其他总线,扩展设备中的I2C接口芯片在扩展设备插入终端的接口后即被挂到I2C总线上,所述扩展设备的接口芯片可以通过I2C总线与终端的系统建立联系,所述终端的系统可以通过I2C总线读取所述扩展设备的设备信息。
I2C总线的读写通常具有固定的格式,一般顺序可以为:地址(读/写) →寄存器地址→数据,本发明实施例可以采用这一顺序来最终获取到所述扩展设备的设备信息,具体实施时,本发明实施例可以预先设置一组地址(例如:2、4或者8个)作为扩展设备的地址。
在实施中采用I2C总线等方式是由于这些方式比较常用、主流,易于本领域技术人员使用/理解,所以这里以I2C总线为例;但是,从理论上来说,用其他的方式也是可以的,只要能够实现挂接外部扩展设备的目的即可,I2C总线仅用于教导本领域技术人员具体如何实施本发明,但并不意味仅能使用I2C总线,实施过程中可以结合实践需要来确定相应的方式。
实施中,所述设备信息还可以包括:制造商信息和/或设备版本。
具体实施时,所述设备信息还可以包括制造商信息、设备版本等信息。
现有技术通过电压高低的方式检测,只能简单的检测出设备类型,无法得到设备的具体版本、制造商等信息,而本发明实施例通过总线的方式读取扩展设备的设备信息,所述设备信息可以包括设备的具体版本、制造商等信息,从而可以获取扩展设备的全面信息。
实施中,所述终端的接口可以为68pin的复合接口。
具体实施时,本发明实施例中终端的接口可以为复合接口,具体可以为68pin或者其他数量管脚的复合接口。
由于本发明实施例采用的是复合接口,因此,该接口可以支持多种类型的扩展设备,而现有技术中的终端只能支持标准接口的设备,本发明实施例的扩展性更强。
实施例二、
本发明实施例以一具体实例进行说明。
图2示出了本发明实施例中接口检测过程的示意图,如图所示,所述接口检测过程可以包括如下步骤:
步骤201、检测接口管脚Plug_DET_UP和Plug_DET_Down;
步骤202、判断两个pin是否均为低电平;
如果是,则执行步骤203;
如果不是,则执行步骤207;
步骤203、确定扩展设备插入;
步骤204、开始扩展设备检测;
步骤205、通过I2C获取设备ID;
步骤206、上报扩展设备类型,结束;
步骤207、判断两个pin是否均为高电平;
如果是,则确定无扩展设备插入,结束;
如果不是,则提示扩展设备插入连接问题,结束。
具体实施中,可以根据设备ID确定设备类型,例如:假设扩展设备的设备ID为A0123,那么扩展设备的设备类型则可以为A。
本发明实施例可以检测接口的用于插入检测的管脚Plug_DET_UP和Plug_DET_Down,如果这两个pin均为低电平,则可以确定扩展设备插入,然后进行设备检测、通过I2C总线获取设备ID、上报设备类型等操作;如果两个pin均为高电平,则说明没有扩展设备插入;如果一个pin为高电平、另一个pin为低电平,则说明扩展设备插入有问题、连接异常,可以提示用户插入连接问题,待用户重新插入后再次进行检测操作。
实施例三、
基于同一发明构思,本发明实施例中还提供了一种接口检测装置,由于这些设备解决问题的原理与一种接口检测方法相似,因此这些设备的实施可以参见方法的实施,重复之处不再赘述。
图3示出了本发明实施例中接口检测装置的结构示意图一,如图所示,所述接口检测装置可以包括:
检测模块301,用于检测终端的接口管脚;
第一确定模块302,用于如果用于插入检测的接口管脚为第一电平,确定终端的接口有扩展设备插入;
挂接模块303,用于将所述扩展设备的接口芯片挂到总线上;
读取模块304,用于对所述扩展设备进行上电初始化,通过总线读取所述扩展设备的设备信息;所述设备信息包括设备标识ID;
第二确定模块305,用于根据所述设备ID确定所述扩展设备的设备类型。
具体实施时,所述检测模块可以在终端上电以后检测终端的接口管脚,也可以通过中断的方式定时或不定时的检测终端的接口管脚。
所述第一电平可以为低电平或者高电平,所述第一确定模块具体可以用于如果用于插入检测的接口管脚为低电平,确定终端的接口有扩展设备插入;终端的接口管脚pins可以有很多,其中可以包括用于插入检测的接口管脚,例如:PLUG_DET_UP和PLUG_DET_Down,所述第一确定模块具体可以用于如果PLUG_DET_UP和PLUG_DET_Down管脚均为低电平,确定终端的接口有扩展设备插入。
挂接模块具体可以用于在扩展设备插入终端的接口后,将扩展设备的接口芯片挂到总线上,一条总线上可以连接多个扩展设备,挂接模块可以用于将多个扩展设备的接口芯片分别挂到总线上,这些扩展设备均可以直接与终端的系统直接传递数据。
本发明实施例中挂接模块在扩展设备插入终端接口后即将所述扩展设备挂到总线上,检测模块可以通过检测终端接口管脚来确定是否有扩展设备插入,读取模块在在确定有扩展设备插入后通过总线即可读取到扩展设备的设备类型,本发明实施例通过一个接口即可实现各种类型的扩展设备的插入、检测;并且,现有技术中终端的一个接口只能连接一个标准接口设备,而本发明实施例由于采用的是总线形式,同一时刻可以支持多个扩展设备的插入,扩展性较强,解决了现有技术中通过电压高低的方式来检测设备类型、只能检测标准接口设备等问题。
图4示出了本发明实施例中接口检测装置的结构示意图二,如图所示,所述装置可以进一步包括:
启动模块306,用于根据所述扩展设备的设备类型,加载设备驱动并启动相应的服务程序和应用程序;
发送模块307,用于向所述扩展设备发送所述扩展设备启动所需要的程序;
同步模块308,用于待所述扩展设备启动后,与所述扩展设备执行状态同步。
具体实施时,所述发送模块具体可以用于将预先存储的所述扩展设备启动所需要的程序发送给所述扩展设备,还可以用于从云端下载所述扩展设备启动所需要的程序并在下载成功后将所述扩展设备启动所需要的程序发送给所述扩展设备。
本发明实施例中可以在确定所述扩展设备的设备类型后,由启动模块加载驱动并启动相应的服务和应用,发送模块将所述扩展设备启动所需要的程序发送给扩展设备之后,同步模块可以通过总线完成状态同步,实现扩展设备的正常使用。
图5示出了本发明实施例中接口检测装置的结构示意图三,如图所示,所述装置可以进一步包括:
监测模块309,用于监测所述扩展设备的工作状态;
维护模块310,用于根据所述工作状态对所述扩展设备进行维护。
具体实施时,所述监测模块具体可以用于监测所述扩展设备的工作状态,所述扩展设备的工作状态具体可以包括繁忙busy、空闲idle、挂起suspend、休眠standby、关闭down等,还有可能发生异常情况。
本发明实施例中监测模块可以通过相应的服务程序来监测扩展设备的工作状态,维护模块用于维护扩展设备的状态,例如:在正常插入或未插入扩展设备时通知终端CPU、在插入异常时弹出提示信息、或者在运行过程中进行状态更新和维护等,以确保扩展设备的正常使用。
实施中,所述总线具体可以为串行总线I2C总线,所述挂接模块具体可 以用于将所述扩展设备的I2C接口芯片挂到I2C总线上。
具体实施时,所述总线可以为I2C总线或其他总线,挂接模块可以在扩展设备插入终端的接口后将扩展设备中的I2C接口芯片挂到I2C总线上,所述扩展设备的接口芯片可以通过I2C总线与终端的系统建立联系,所述读取模块可以通过I2C总线读取所述扩展设备的设备信息。
实施中,所述读取模块读取的设备信息还可以包括:制造商信息和/或设备版本。
具体实施时,所述设备信息还可以包括制造商信息、设备版本等信息。所述读取模块具体可以用于读取所述扩展设备的制造商信息、设备版本、设备ID等信息。
实施中,所述终端的接口可以为68pin的复合接口。
具体实施时,本发明实施例中终端的接口可以为复合接口,具体可以为68pin或者其他数量管脚的复合接口。
由于本发明实施例采用的是复合接口,因此,该接口可以支持多种类型的扩展设备,而现有技术中的终端只能支持标准接口的设备,本发明实施例的扩展性更强。
为了描述的方便,以上所述装置的各部分以功能分为各种模块或单元分别描述。当然,在实施本发明时可以把各模块或单元的功能在同一个或多个软件或硬件中实现。
实施例四、
图6示出了本发明实施例中手机插入扩展设备的结构示意图,如图所示,本发明实施例以手机作为终端为例进行如下说明。
本发明实施例中的手机设置有扩展接口,用于插入扩展设备。具体实施时,所述手机上的扩展接口可以为公口和/或母口,所述待插入的扩展设备可以既包括公口又包括母口,所述扩展设备的公口和母口可以分别置于所述扩展设备的两个对立面的外侧。
假设手机上的扩展接口为公口,所述扩展设备为音乐播放器、投影仪,所述音乐播放器的一个平面外侧设置有母口、另一个对立面外侧设置有公口,所述投影仪的一个平面外侧设置有母口、另一对立面外侧设置有公口。
所述音乐播放器的母口与手机的公口对接,所述投影仪的母口与所述音乐播放器的公口对接,即可实现在手机的背面叠加两个外部扩展设备。所述外部的扩展设备在插入手机后,本发明实施例通过总线的形式,所有外部扩展设备都可以直接挂在总线上,可以分别与手机直接传输数据。
手机可以检测手机的公口管脚,如果手机的公口管脚的PLUG_DET_UP和PLUG_DET_Down均为低电平,则说明手机的扩展接口有扩展设备插入;然后手机可以向总线的相应地址发送获取设备信息的请求,所述音乐播放器响应所述请求,响应报文中可以携带自身的设备ID(假设为YYBFQ01)、设备版本号和制造厂家等信息,所述手机获取到所述扩展设备的设备ID后,即可确定所述扩展设备为音乐播放器。
手机还可以继续检测所述音乐播放器的公口,如果所述音乐播放器的公口管脚的PLUG_DET_UP和PLUG_DET_Down均为低电平,则说明所述音乐播放器的扩展接口有扩展设备插入;然后手机可以向总线的相应地址发送获取设备信息的请求,所述投影仪响应所述请求,响应报文中可以携带自身的设备ID(假设为TYY01)、设备版本号和制造厂家等信息,所述手机获取到所述扩展设备的设备ID后,即可确定所述扩展设备为投影仪。
本发明实施例在确定扩展设备分别为音乐播放器和投影仪之后,可以分别为音乐播放器和投影仪加载设备驱动以及启动相应的服务程序和应用程序:
加载音乐播放器驱动并启动音乐播放器相应的服务程序和应用程序之后,向音乐播放器发送所述音乐播放器启动所需要的程序,待音乐播放器成功启动后,手机与音乐播放器完成状态同步;
加载投影仪驱动并启动投影仪相应的服务程序和应用程序之后,向投影 仪发送所述投影仪启动所需要的程序,待投影仪成功启动后,手机与投影仪完成状态同步。
至此,手机和外部扩展设备音乐播放器、投影仪即可进入正常工作模式,用户可以通过手机实现开着mp3的同时播放幻灯片的目的。
实施例五、
下面本发明实施例以智能机器人作为终端为例进行说明。
本发明实施例中的智能机器人设置有扩展接口,用于插入扩展设备,所述扩展设备具体可以为充电宝等。
具体实施时,所述智能机器人上的扩展接口可以为公口,所述充电宝上的接口可以为母口;或者,所述智能机器人上的扩展接口可以为母口,所述充电宝上的接口可以为公口;又或者,所述智能机器人上的扩展接口既包括公口又包括母口,所述充电宝上的接口为公口或者母口、或者既包括公口又包括母口。
当所述充电宝的接口与所述智能机器人的扩展接口对接后,所述充电宝直接挂在I2C总线上,可以与所述智能机器人直接传输数据。
所述智能机器人可以检测智能机器人的扩展接口的管脚,如果所述智能机器人的扩展接口的管脚的PLUG_DET_UP和PLUG_DET_Down均为低电平,则说明智能机器人的扩展接口有扩展设备插入;然后所述智能机器人可以向总线的相应地址发送获取设备信息的请求,所述充电宝响应所述请求,响应报文中可以携带自身的设备ID(假设为CDB092)、设备版本号和制造厂家等信息,所述智能机器人获取到所述扩展设备的设备ID后,即可确定所述扩展设备为充电宝(缩写为CDB)。
本发明实施例在确定扩展设备为充电宝之后,所述智能机器人可以从云端下载充电宝驱动、充电宝启动所需要的服务程序和应用程序等,然后为所述充电宝加载充电宝驱动以及启动相应的服务程序和应用程序,向所述充电宝发送所述充电宝启动所需要的程序,待充电宝成功启动后,所述智能机器 人读取充电宝的状态,完成状态同步。
至此,所述智能机器人与充电宝即可进入正常工作模式,在所述智能机器人执行用户指令的同时,所述充电宝可以为所述智能机器人充电,以确保智能机器人的正常使用。
实施例六、
图7示出了本发明实施例中pad插接扩展设备的结构示意图,如图所示,下面本发明实施例以平板电脑(pad)作为终端为例进行说明。
本发明实施例中的pad设置有扩展接口,可以用于插入扩展设备,所述扩展设备具体可以为平板键盘、电话会议扬声器、打印机等。
具体实施时,所述pad上的扩展接口可以为公口或母口,所述扩展设备上的接口可以既包括公口又包括母口。
假设所述pad上的扩展接口为公口,当平板键盘的母口与所述pad的公口插接后,所述平板键盘的接口芯片即被挂在I2C总线上,可以与pad的系统直接传输信息。
所述pad可以检测扩展接口的管脚,如果所述pad的扩展接口的管脚的PLUG_DET_UP和PLUG_DET_Down均为低电平,则说明pad的扩展接口有扩展设备插入;然后所述pad可以向总线的相应地址发送获取设备信息的请求,所述平板键盘响应所述请求,响应报文中可以携带自身的设备ID(假设为PBJP008)、设备版本号和制造厂家等信息,所述pad获取到所述扩展设备的设备ID后,即可确定所述扩展设备为平板键盘(缩写为PBJP)。
所述pad可以预先在pad存储空间内存储有平板键盘启动所需要的服务程序和应用程序等,本发明实施例在确定扩展设备为平板键盘之后,所述pad可以为所述平板键盘加载键盘驱动以及启动相应的服务程序和应用程序,向所述平板键盘发送所述键盘启动所需要的程序,待所述平板键盘成功启动后,所述pad读取平板键盘的状态,完成状态同步。
至此,所述pad与平板键盘即可进入正常工作模式,用户可以在使用pad 的同时,通过所述平板键盘实现输入操作。
当用户需要进行电话会议时,为了使旁边的其他人也能参与进来、听清会议内容,用户可以在平板键盘的公口插接一个电话会议扬声器(对应电话会议扬声器的母口),所述电话会议扬声器的接口芯片同样被挂在I2C总线上,可以与pad的系统直接传输信息。
由于所述pad的公口与平板键盘的母口插接,所述平板键盘的公口即相当于所述pad的公口,实现扩展功能。所述pad可以检测所述平板键盘的公口的管脚,如果所述公口管脚的PLUG_DET_UP和PLUG_DET_Down均为低电平,则说明有扩展设备插入;然后所述pad可以向总线的相应地址发送获取设备信息的请求,所述电话会议扬声器响应所述请求,响应报文中可以携带自身的设备ID(假设为DHHYYSQ011)、设备版本号和制造厂家等信息,所述pad获取到所述扩展设备的设备ID后,即可确定所述扩展设备为电话会议扬声器(缩写为DHHYYSQ)。
所述pad可以预先在pad存储空间内存储有电话会议扬声器启动所需要的服务程序和应用程序等,本发明实施例在确定扩展设备为电话会议扬声器之后,所述pad可以为所述电话会议扬声器加载扬声器驱动以及启动相应的服务程序和应用程序,向所述电话会议扬声器发送所述扬声器启动所需要的程序,待所述电话会议扬声器成功启动后,所述pad读取电话会议扬声器的状态,完成状态同步。
至此,所述pad与电话会议扬声器即可进入正常工作模式,用户可以在使用pad的同时,通过所述电话会议扬声器提高电话会议的音量。
当用户在会议过程中需要打印文档供大家阅读时,可以在电话会议扬声器的公口插接一个打印机(对应打印机的母口),所述打印机的接口芯片同样被挂在I2C总线上,可以与pad的系统直接传输信息。
由于所述pad的公口与平板键盘的母口插接、所述平板键盘的公口与电话会议扬声器的母口插接,所述电话会议扬声器的公口即相当于所述pad的 公口,实现扩展功能。所述pad可以检测所述电话会议扬声器的公口的管脚,如果所述公口管脚的PLUG_DET_UP和PLUG_DET_Down均为低电平,则说明有扩展设备插入;然后所述pad可以向总线的相应地址发送获取设备信息的请求,所述打印机响应所述请求,响应报文中可以携带自身的设备ID(假设为DYJ080)、设备版本号和制造厂家等信息,所述pad获取到所述扩展设备的设备ID后,即可确定所述扩展设备为打印机(缩写为DYJ)。
本发明实施例在确定扩展设备为打印机之后,所述pad可以从网络下载打印机启动所需要的服务程序和应用程序等,所述pad可以为所述打印机加载打印机驱动以及启动相应的服务程序和应用程序,向所述打印机发送所述打印机启动所需要的程序,待所述打印机成功启动后,所述pad读取打印机的状态,完成状态同步。
至此,所述pad与打印机即可进入正常工作模式,用户可以在使用pad的同时,通过所述打印机实现文档打印功能。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。

Claims (12)

  1. 一种接口检测方法,其特征在于,包括如下步骤:
    检测终端的接口管脚;
    如果用于插入检测的接口管脚为第一电平,确定终端的接口有扩展设备插入;所述扩展设备的接口芯片被挂到总线上;
    对所述扩展设备进行上电初始化,通过总线读取所述扩展设备的设备信息;所述设备信息包括设备标识ID;
    根据所述设备ID确定所述扩展设备的设备类型。
  2. 如权利要求1所述的方法,其特征在于,进一步包括:
    根据所述扩展设备的设备类型,加载设备驱动并启动相应的服务程序和应用程序;
    向所述扩展设备发送所述扩展设备启动所需要的程序;
    待所述扩展设备启动后,与所述扩展设备执行状态同步。
  3. 如权利要求2所述的方法,其特征在于,进一步包括:
    监测所述扩展设备的工作状态;
    根据所述工作状态对所述扩展设备进行维护。
  4. 如权利要求1所述的方法,其特征在于,所述总线具体为串行总线I2C总线,所述扩展设备的接口芯片被挂到总线上具体为所述扩展设备的I2C接口芯片被挂到I2C总线上。
  5. 如权利要求1所述的方法,其特征在于,所述设备信息还包括制造商信息和/或设备版本。
  6. 如权利要求1所述的方法,其特征在于,所述终端的接口为68pin的复合接口。
  7. 一种接口检测装置,其特征在于,包括:
    检测模块,用于检测终端的接口管脚;
    第一确定模块,用于如果用于插入检测的接口管脚为第一电平,确定终 端的接口有扩展设备插入;
    挂接模块,用于将所述扩展设备的接口芯片挂到总线上;
    读取模块,用于对所述扩展设备进行上电初始化,通过总线读取所述扩展设备的设备信息;所述设备信息包括设备标识ID;
    第二确定模块,用于根据所述设备ID确定所述扩展设备的设备类型。
  8. 如权利要求7所述的装置,其特征在于,进一步包括:
    启动模块,用于根据所述扩展设备的设备类型,加载设备驱动并启动相应的服务程序和应用程序;
    发送模块,用于向所述扩展设备发送所述扩展设备启动所需要的程序;
    同步模块,用于待所述扩展设备启动后,与所述扩展设备执行状态同步。
  9. 如权利要求8所述的装置,其特征在于,进一步包括:
    监测模块,用于监测所述扩展设备的工作状态;
    维护模块,用于根据所述工作状态对所述扩展设备进行维护。
  10. 如权利要求7所述的装置,其特征在于,所述总线具体为串行总线I2C总线,所述挂接模块具体用于将所述扩展设备的I2C接口芯片挂到I2C总线上。
  11. 如权利要求7所述的装置,其特征在于,所述设备信息还包括制造商信息和/或设备版本。
  12. 如权利要求7所述的装置,其特征在于,所述终端的接口为68pin的复合接口。
PCT/CN2016/084657 2016-06-03 2016-06-03 一种接口检测方法及装置 WO2017206161A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201680002678.0A CN107003974B (zh) 2016-06-03 2016-06-03 一种接口检测方法及装置
PCT/CN2016/084657 WO2017206161A1 (zh) 2016-06-03 2016-06-03 一种接口检测方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/084657 WO2017206161A1 (zh) 2016-06-03 2016-06-03 一种接口检测方法及装置

Publications (1)

Publication Number Publication Date
WO2017206161A1 true WO2017206161A1 (zh) 2017-12-07

Family

ID=59431637

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/084657 WO2017206161A1 (zh) 2016-06-03 2016-06-03 一种接口检测方法及装置

Country Status (2)

Country Link
CN (1) CN107003974B (zh)
WO (1) WO2017206161A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110212619A (zh) * 2019-07-02 2019-09-06 深圳市云充吧科技有限公司 一种具有票据打印单元的移动电源充电终端
CN111385320A (zh) * 2018-12-28 2020-07-07 深圳市云海物联科技有限公司 一种扩充物联系统的方法及装置

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108550253A (zh) * 2018-03-28 2018-09-18 宁波三星医疗电气股份有限公司 一种表计和数传模块的交互控制方法
CN109164874B (zh) * 2018-08-03 2021-09-14 联想(北京)有限公司 一种信息处理方法及电子设备
CN109270342B (zh) * 2018-11-13 2024-03-26 江苏斯菲尔电气股份有限公司 一种具备功能扩展模块自识别技术的多功能电表
CN111897760A (zh) * 2020-07-30 2020-11-06 普联技术有限公司 电子产品及其扩展装置、控制方法与控制装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1964452A (zh) * 2005-11-09 2007-05-16 南靖万利达科技有限公司 电视机自动识别扩展功能模块的方法
CN101017464A (zh) * 2007-02-16 2007-08-15 北京飞天诚信科技有限公司 多接口和可自动安装的信息安全设备及其控制方法
US20080265838A1 (en) * 2007-04-24 2008-10-30 Saurabh Garg Battery charging using a USB-ID pin of a USB interface
CN103678237A (zh) * 2013-12-19 2014-03-26 华为技术有限公司 传输设备辅助接口的对接方法和装置
CN104081368A (zh) * 2011-04-11 2014-10-01 快捷半导体公司 移动设备自动检测装置和方法

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100383544C (zh) * 2005-01-26 2008-04-23 华为技术有限公司 一种电平信号的实时监测方法及装置
CN102546869B (zh) * 2012-01-06 2014-09-17 海能达通信股份有限公司 一种usb接口复用的对讲机及其控制方法
CN103544122B (zh) * 2013-10-29 2017-09-05 华东师范大学 一种接口自适应匹配的协同系统及其协同方法
CN104506939B (zh) * 2014-12-15 2018-09-25 四川长虹电器股份有限公司 一种信息上报方法及电视终端
CN110851387B (zh) * 2015-09-30 2022-08-19 联想(北京)有限公司 一种接口功能配置方法和电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1964452A (zh) * 2005-11-09 2007-05-16 南靖万利达科技有限公司 电视机自动识别扩展功能模块的方法
CN101017464A (zh) * 2007-02-16 2007-08-15 北京飞天诚信科技有限公司 多接口和可自动安装的信息安全设备及其控制方法
US20080265838A1 (en) * 2007-04-24 2008-10-30 Saurabh Garg Battery charging using a USB-ID pin of a USB interface
CN104081368A (zh) * 2011-04-11 2014-10-01 快捷半导体公司 移动设备自动检测装置和方法
CN103678237A (zh) * 2013-12-19 2014-03-26 华为技术有限公司 传输设备辅助接口的对接方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111385320A (zh) * 2018-12-28 2020-07-07 深圳市云海物联科技有限公司 一种扩充物联系统的方法及装置
CN110212619A (zh) * 2019-07-02 2019-09-06 深圳市云充吧科技有限公司 一种具有票据打印单元的移动电源充电终端

Also Published As

Publication number Publication date
CN107003974B (zh) 2020-07-14
CN107003974A (zh) 2017-08-01

Similar Documents

Publication Publication Date Title
WO2017206161A1 (zh) 一种接口检测方法及装置
TWI733752B (zh) 用於旁波帶通訊之系統及方法、以及實體非暫時性計算機可讀媒體
US11068041B2 (en) Method to enhance device policy management (DPM) power sharing for USB Type-C (USB-C) only devices
KR102511514B1 (ko) 다양한 충전 방식을 이용한 고속 충전 방법 및 장치
CN107409056B (zh) 用于促进数据通信的装置、系统、方法和设备
US10268616B2 (en) Systems and methods for selective disablement of protocols on a USB type-C port
AU2015271399B2 (en) Super hub system and method thereof
US10860522B2 (en) Method and apparatus for controlling USB-C connectors on system with multiple host controllers
US8832345B2 (en) System for communicating between two electrical devices and method therefore
TW201606518A (zh) 用於通用串列匯流排(usb)集線器之連接埠斷開充電功能
CN109478176B (zh) 一种USB Type-C端口设备识别对端设备的方法、装置和系统
US10733115B2 (en) Information handling system automated wireless pairing of peripheral devices
TW201544960A (zh) 通用序列匯流排擴充座及其對一便攜式裝置進行充電的方法
WO2019203797A1 (en) Firmware setup menu options for docking stations
CN112955879A (zh) 用于收发控制信号的电子装置和方法
KR20210034431A (ko) 외부 장치와의 연결을 지원하는 전자 장치 및 그 외부 장치와 연결하여 사용할 때 소모 전류를 감소시키는 방법
WO2013075501A1 (zh) 节点热插拔的方法及装置
KR101504654B1 (ko) 외부 디바이스와 이에 도킹되는 휴대 단말 사이의 연결 수립 방법
TW201337577A (zh) 資料傳輸方法、系統及使用該方法的電子裝置
KR20210101553A (ko) 전자 장치 및 이를 이용한 usb 타입 c 커넥터에 연결된 오디오 출력 장치 인식 방법
US9774712B2 (en) Modular control interface
KR101485156B1 (ko) 외부 디바이스와 도킹되는 휴대 단말 및 그 제어 방법
US10515025B2 (en) Communication protocol adapter
KR101485154B1 (ko) 외부 디바이스와 이에 도킹되는 휴대 단말의 웨이크 업 모드 전환 방법
WO2017177448A1 (zh) 一种通信方法、装置及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16903546

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16903546

Country of ref document: EP

Kind code of ref document: A1