CN105846223B - USB interface plug, control method and device - Google Patents

USB interface plug, control method and device Download PDF

Info

Publication number
CN105846223B
CN105846223B CN201610256808.5A CN201610256808A CN105846223B CN 105846223 B CN105846223 B CN 105846223B CN 201610256808 A CN201610256808 A CN 201610256808A CN 105846223 B CN105846223 B CN 105846223B
Authority
CN
China
Prior art keywords
control
usb
terminal
signal
usb interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610256808.5A
Other languages
Chinese (zh)
Other versions
CN105846223A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610256808.5A priority Critical patent/CN105846223B/en
Publication of CN105846223A publication Critical patent/CN105846223A/en
Application granted granted Critical
Publication of CN105846223B publication Critical patent/CN105846223B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01RELECTRICALLY-CONDUCTIVE CONNECTIONS; STRUCTURAL ASSOCIATIONS OF A PLURALITY OF MUTUALLY-INSULATED ELECTRICAL CONNECTING ELEMENTS; COUPLING DEVICES; CURRENT COLLECTORS
    • H01R13/00Details of coupling devices of the kinds covered by groups H01R12/70 or H01R24/00 - H01R33/00
    • H01R13/46Bases; Cases
    • H01R13/52Dustproof, splashproof, drip-proof, waterproof, or flameproof cases
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/16Sound input; Sound output
    • G06F3/165Management of the audio stream, e.g. setting of volume, audio stream path
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01RELECTRICALLY-CONDUCTIVE CONNECTIONS; STRUCTURAL ASSOCIATIONS OF A PLURALITY OF MUTUALLY-INSULATED ELECTRICAL CONNECTING ELEMENTS; COUPLING DEVICES; CURRENT COLLECTORS
    • H01R13/00Details of coupling devices of the kinds covered by groups H01R12/70 or H01R24/00 - H01R33/00
    • H01R13/66Structural association with built-in electrical component
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Abstract

The disclosure discloses a kind of USB interface plug, control method and device, belongs to intelligent terminal field.The USB interface plug includes key, USB plug and control chip, key includes press section and output terminal, USB plug includes that power supply terminal, data add terminal, data to subtract terminal and ground terminal, control chip is connected with the output terminal of key, controls chip and also adds that terminal, data subtract terminal and ground terminal is connected with the power supply terminal of USB plug, data respectively;Solving interface plug used at present is all plastic cement material, is only capable of the USB interface for preventing foreign matter from carrying out USB device, the lower problem of utilization rate;Having reached USB interface plug includes control chip and circuit connection structure, when grafting enters USB device, it can not only prevent foreign matter from entering the USB interface of USB device, moreover it is possible to receive button operation generation control signal and control USB device, improve the effect of the utilization rate of USB interface plug.

Description

USB interface plug, control method and device
Technical field
This disclosure relates to intelligent terminal accessory field, in particular to a kind of USB interface plug, control method and device.
Background technique
USB (Universal Serial Bus, general serial are provided in the terminal devices such as mobile phone, tablet computer Bus) interface, USB interface both can be used as the charging interface of terminal device, and can also be used as data transmission interface, with very heavy The effect wanted.
Since current USB interface is directly exposed to except terminal device, it has been easy to ash in the non-use state Dirt, liquid or other foreign matters enter, and lead to USB interface short circuit, obstruction and corrosion, influence normal use, ask in order to avoid this Topic, usually loads onto a USB interface plug to USB interface, but USB interface plug used at present is all plastic cement material, is only capable of Prevent foreign matter from entering USB interface, utilization rate is not high.
Summary of the invention
In order to solve the problems, such as that USB interface plug utilization rate is not high, the disclosure provide a kind of USB interface plug, control method and Device.The technical solution is as follows:
According to the first aspect of the embodiments of the present disclosure, a kind of USB (Universal Serial Bus, general serial are provided Bus) interface plug, which includes:
Key, key include press section and output terminal;
USB plug, USB plug include that power supply terminal, data add terminal, data to subtract terminal and ground terminal;
Control chip, control chip be connected with the output terminal of key, control chip also respectively with the power end of USB plug Son, data add terminal, data to subtract terminal and are connected with ground terminal.
Optionally, key, for exporting pressing signal by output terminal when press section is touched;
Chip is controlled, for control signal being generated according to pressing signal, passing through data plus end when receiving pressing signal Son and data subtract terminal output control signal.
Optionally, chip is controlled, is believed for when receiving pressing signal every time, generating control corresponding with pressing signal Number;
Alternatively, control chip, for being received in statistics scheduled duration in the scheduled duration for being initially received pressing signal To the number of pressing signal, control signal corresponding with the pressing number of signal is generated.
Optionally, USB plug, for when being inserted into USB device, by power supply terminal and ground terminal to control chip Power supply.
According to the second aspect of an embodiment of the present disclosure, a kind of control method is provided, this method is for grafting just like first party In the USB device of the USB interface plug in face, this method comprises:
Receive the control signal that USB interface plug is sent;
Control instruction is generated according to control signal;
Execute control instruction.
Optionally, control instruction is generated according to control signal, comprising:
In the scheduled duration for being initially received control signal, the number that control signal is received in scheduled duration is counted, Generate control instruction corresponding with the control number of signal.
Optionally, control instruction is generated according to control signal, comprising:
When receiving control signal, control instruction corresponding with the control type of signal is generated.
Optionally, this method further include:
Detect USB interface plug insertion when, by USB interface plug be enumerated as HID (Human Interface Device, Human interface device).
Optionally, control instruction includes: screenshotss, take pictures, image, opens application program, adjust volume, open/close indigo plant Tooth at least one of opens/closes network connection, opens/closes flashlight.
According to the third aspect of an embodiment of the present disclosure, a kind of control device is provided, which may be implemented to become and be plugged with As the USB interface plug of first aspect USB device it is some or all of, which includes:
Receiving module is configured as receiving the control signal that USB interface plug is sent;
Generation module is configured as generating control instruction according to control signal;
Execution module is configured as executing control instruction.
Optionally, generation module is configured as in the scheduled duration for being initially received control signal, counts scheduled duration The number of control signal is inside received, control instruction corresponding with the control number of signal is generated.
Optionally, generation module is configured as generating corresponding with the control type of signal when receiving control signal Control instruction.
Optionally, the device further include:
Processing module is configured as that USB interface plug is enumerated as HID when detecting the insertion of USB interface plug.
Optionally, control instruction includes: screenshotss, take pictures, image, opens application program, adjust volume, open/close indigo plant Tooth at least one of opens/closes network connection, opens/closes flashlight.
According to a fourth aspect of embodiments of the present disclosure, a kind of control device is provided, which may be implemented to become and insert It is connected to some or all of of the USB device of the USB interface plug such as first aspect, device includes:
Processor;
Memory for storage processor executable instruction;
Wherein, processor is configured as:
Receive the control signal that USB interface plug is sent;
Control instruction is generated according to control signal;
Execute control instruction.
The technical scheme provided by this disclosed embodiment can include the following benefits:
USB interface plug includes key, USB plug and control chip, and key includes press section and output terminal, USB plug Terminal, data is added to subtract terminal and ground terminal including power supply terminal, data, control chip is connected with the output terminal of key, controls Coremaking piece also adds that terminal, data subtract terminal and ground terminal is connected with the power supply terminal of USB plug, data respectively;Solves mesh The preceding interface plug used is all plastic cement material, is only capable of the USB interface for preventing foreign matter from carrying out USB device, the lower problem of utilization rate; Having reached USB interface plug includes that control chip and circuit connection structure can not only prevent foreign matter when grafting enters USB device Into the USB interface of USB device, moreover it is possible to receive button operation generation control signal and control USB device, improve USB The effect of the utilization rate of interface plug
It should be understood that the above general description and the following detailed description are merely exemplary, this can not be limited It is open.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure Example, and consistent with the instructions for explaining the principles of this disclosure.
Fig. 1 is a kind of structural schematic diagram of USB interface plug shown according to an exemplary embodiment;
Fig. 2 is the connection schematic diagram of a kind of USB interface plug and USB device shown according to an exemplary embodiment;
Fig. 3 is a kind of flow chart of control method shown according to an exemplary embodiment;
Fig. 4 is a kind of flow chart of the control method shown according to another exemplary embodiment;
Fig. 5 is a kind of block diagram of control device shown according to an exemplary embodiment;
Fig. 6 is a kind of block diagram of the control device shown according to another exemplary embodiment;
Fig. 7 is a kind of block diagram of the control device shown according to another exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
Fig. 1 is that (Universal Serial Bus, general serial are total by a kind of USB shown according to an exemplary embodiment Line) interface plug structural schematic diagram, the USB interface plug include: key 120, USB plug 140 and control chip 160.
Key 120 includes press section 121 and output terminal 122.
USB plug 140 adds terminal 142, data to subtract terminal 143 and ground terminal 144 including power supply terminal 141, data.
Optionally, it is conductive metal that power supply terminal 141, data, which add terminal 142, data to subtract terminal 143 and ground terminal 144, Pole.
USB plug 140 can be USB A type interface or USB Type B interface.
Optionally, USB plug 140 further includes other terminal (not shown in figure 1)s, and USB plug 140 is Mini USB A type Interface, Mini USB Type B interface, Mini USB AB type interface, Micro USB A type interface, Micro USB Type B interface or USB Type-C interface, includes other different terminals in different usb types, and the present embodiment in USB plug 140 to wrapping The type of other terminals included is not construed as limiting, and is not construed as limiting to the usb type of USB plug 140.
It should be noted that USB interface plug can also include shell, key 120 and control chip 160 pass through plastic cement thermoplastic In the shell, the press section 121 of key 120 is except shell, for receiving touching operation, USB plug 140 except shell, For being inserted into USB device, the present embodiment does not repeat the shape of USB interface plug.
USB plug 140, for when being inserted into USB device, by power supply terminal 141 and ground terminal 144 to control core Piece 160 is powered.
Optionally, USB device is the electronic equipment including USB interface of mobile phone, tablet computer, laptop etc.
As shown in Fig. 2, its connection schematic diagram for illustrating USB device 170 Yu USB interface plug, USB device 170 In include USB jack 180, USB jack 180 includes that power supply terminal 181, data add terminal 182, data to subtract terminal 183 and ground connection Terminal 184.
The usb type of USB plug 140 is identical as the usb type of USB jack 180 in USB device, and USB is inserted First 140 in the USB jack 180 for being inserted into USB device when, the power supply of the power supply terminal 141 of USB plug 140 and USB jack 180 Terminal 181 is connected, the data of USB plug 140 add terminal 142 to add terminal 182 to be connected with the data of USB jack 180, USB plug 140 data subtract terminal 143 and the data of USB jack 180 subtract terminal 183 be connected, the ground terminal 144 of USB plug 140 with The ground terminal 184 of USB jack 180 is connected.
USB interface plug is enumerated as HID (Human when detecting the insertion of USB interface plug by USB device 170 Interface Device, human interface device), it comprises the following steps:
1, USB device fills in capable reset to USB interface, USB interface plug is resetting when detecting the insertion of USB interface plug Address is 0 afterwards, and USB device is asked by the endpoint 0 of address 0 and USB interface plug to USB interface plug sending device descriptor acquiring It asks, the device descriptor of request USB interface plug;After USB interface plug receives device descriptor acquisition request, equipment is retouched It states symbol and returns to USB device;After USB device determines that the device descriptor received is correct, 0 length is returned to USB interface plug Confirm data packet, does not include data information in the confirmation data packet of 0 length, for confirming that device descriptor is correct.
Wherein, device descriptor is used to indicate the information of USB interface plug, and device descriptor includes 18 bytes, for referring to Show maximum data packet length, manufacturing ID, product identifiers, version that descriptor length, descriptor type, endpoint 0 are supported Number etc. information, in this step, the device descriptor that USB device is got can not be complete device descriptor, only set A part in standby descriptor.
2, after USB device fills in row reset to USB interface again, setting Address requests are sent to USB interface plug, and be USB interface plug distributes a unique address, and USB interface plug returns to 0 length after receiving the address, to USB device State packet, do not include data information in the state packet of 0 length, be used to indicate address setting and succeeded;USB device receives After the state packet of 0 length returned to USB interface plug, an ACK (Acknowledgement, confirmation are returned to USB interface plug Character) data packet, the ack msg packet is for confirming that address setting has succeeded.It is returned when USB interface plug receives USB device Ack msg packet after, so that it may carry out data communication using the address and USB device.
3, USB device obtains device descriptor, the configuration description of USB interface plug by the address distributed for USB interface plug The descriptors such as symbol, interface descriptor, endpoint descriptor and character string descriptor, and determine that USB connects according at least these descriptors The relevant informations such as interface, endpoint, configuration, device name and the sequence number of mouth plug, in this step, what USB device obtained again Device descriptor is the device descriptor of 18 whole bytes, and the step is not specifically described in the present embodiment.
USB device enumerates USB interface plug using above-mentioned several step completions, and according to the USB interface plug got Relevant information and for USB interface plug distribution address and USB interface fill in row data communication.
Key 120, for exporting pressing signal by output terminal 122 when press section 121 is touched.
Optionally, press section 121 receives touching operation is to click, long-pressing or repeatedly click in scheduled duration, In, long-pressing is the touching operation for being more than predetermined threshold the touched time of press section 121, and predetermined threshold and scheduled duration are by system Default or user is customized.
Optionally, when press section 121 is touched, key 120 is level by the pressing signal that output terminal 122 exports Signal, the pressing signal of output terminal output includes single depression signal and continuous pressing signal, for example, in 121 quilt of press section When clicking, high level signal, that is, single depression signal is exported;When press section 121 is long pressed, export continuous high level signal, i.e., it is defeated Signal is continuously pressed out;When press section 121 is repeatedly clicked, all one high level signals of output are clicked each time, that is, are exported more A single depression signal.
Chip 160 is controlled, for generating control signal according to pressing signal when receiving pressing signal.
Optionally, control signal is binary-coded character.
Chip 160 is controlled, for generating control signal corresponding with pressing signal when receiving pressing signal every time.
Different pressing signals corresponds to different control signals, and pressing signal and the corresponding relationship for controlling signal are to set in advance It sets, when receiving multiple single depression signals, multiple control signal is generated, for example, using a binary-coded character table Show control signal, presetting the corresponding control signal of continuous pressing signal is 0, and the corresponding control signal of single depression signal is 1, then when press section is long pressed, control signal 0 is generated, when press section is clicked, control signal 1 is generated, when press section exists When being clicked twice in scheduled duration, two control signals 1,1 are generated.
Alternatively, control chip 160, for counting in scheduled duration in the scheduled duration for being initially received pressing signal The number of pressing signal is received, control signal corresponding with the pressing number of signal is generated.
The pressing signal of the different numbers received in scheduled duration corresponds to different types of control signal, in scheduled duration The number of the pressing signal received and the type corresponding relationship of control signal are pre-set, for example, using two two System character representation controls signal, presets corresponding control signal when receiving 1 single depression signal in scheduled duration It is 00, corresponding control signal is 01 when receiving 2 single depression signals, is received corresponding when 3 single depression signals Control signal be 10, corresponding control signal is 11 when receiving 4 single depression signals, then when press section in the given time When receiving 3 times and clicking, the control signal that control chip generates is 10.
It should be noted that the pressing signal received in scheduled duration also may include continuous pressing signal, for example, In the above example, presetting in scheduled duration and receiving the corresponding control signal of one-time continuous pressing signal is 00, is received Corresponding control signal is 01 when to 1 single depression signal, and corresponding control signal is when receiving 2 single depression signals 10, corresponding control signal is 11 when receiving 3 single depression signals.
Chip 160 is controlled, for adding terminal 142 and data to subtract the output control signal of terminal 143 by data.
It controls chip and adds terminal 142 and data to subtract 143 output voltage of terminal by data, add terminal by controlling data 142 and data subtract the voltage difference between terminal 143 to export the high level 1 and low in the control signal of binary-coded character form Level 0 indicates control letter when the voltage difference that data plus terminal 142 and data subtract terminal 143 is greater than or equal to voltage threshold High level 1 in number;When the voltage difference that data plus terminal 142 and data subtract terminal 143 is less than voltage threshold, control is indicated Low level 0 in signal, voltage threshold are customized by systemic presupposition or user.
Binary-coded character from low order character to high-order character by turn serial transmission of the chip to control signal is controlled, for example, Voltage threshold is 0.5V, and control signal is 01, then controls chip by controlling data and add terminal output voltage 2.7V, controls data Subtract terminal output 2.0V, it is that 0.7V is greater than voltage threshold 0.5V that data, which add terminal and data to subtract the voltage difference between terminal, i.e., Realize output low order character 1;Control chip adds terminal output voltage 2.3V by controlling data, and control data subtract terminal output 2.0V, it is 0.3V that data, which add terminal and data to subtract the voltage difference between terminal, is less than voltage threshold 0.5V, that is, realizes output High-order character 0.
In conclusion the USB interface plug that the embodiment of the present disclosure provides includes key, USB plug and control chip, key packet Include press section and output terminal, USB plug includes that power supply terminal, data add terminal, data to subtract terminal and ground terminal, controls core Piece is connected with the output terminal of key, and control chip also adds terminal, data to subtract end with the power supply terminal of USB plug, data respectively Son is connected with ground terminal;Solving interface plug used at present is all plastic cement material, is only capable of preventing foreign matter from carrying out USB device USB interface, the lower problem of utilization rate;Having reached USB interface plug includes control chip and circuit connection structure, is entered in grafting When USB device, it can not only prevent foreign matter from entering the USB interface of USB device, moreover it is possible to receive button operation and generate control signal pair USB device is controlled, and the effect of the utilization rate of USB interface plug is improved.
Fig. 3 is a kind of flow chart of control method shown according to an exemplary embodiment, and this method is applied to be plugged with In the USB device of USB interface plug as shown in Figure 1, comprising the following steps:
In step 301, USB device receives the control signal that USB interface plug is sent.
In step 302, USB device generates control instruction according to control signal.
In step 303, USB device executes control instruction.
In conclusion the control method that the embodiment of the present disclosure provides, USB device receives the control letter that USB interface plug is sent Number, control instruction is generated according to control signal and executes control instruction, has reached and has not needed to open mobile phone, tablet computer etc. In the case where USB device, the quick behaviour to application program in USB device can be realized by operating to external USB interface plug Make, makes the more convenient operations of the USB devices such as mobile phone, tablet computer efficiently effect.
Fig. 4 is a kind of flow chart of control method shown according to an exemplary embodiment, and this method is applied to be plugged with In the USB device of USB interface plug as shown in Figure 1, comprising the following steps:
In step 401, USB interface plug is enumerated as HID when detecting the insertion of USB interface plug by USB device.
It include USB jack in USB device, USB jack includes that power supply terminal, data add terminal, data to subtract terminal and ground connection Terminal, when being inserted into USB interface plug in USB device, the connection relationship of the USB plug of the USB jack and USB interface plug of USB device As shown in Fig. 2, the power supply terminal of USB jack is connected with the power supply terminal of the USB plug in USB interface plug, the data of USB jack Terminal is added to add terminal to be connected with the data of USB plug, the data of USB jack, which subtract terminal and subtract terminal with the data of USB plug, to be connected, The ground terminal of USB jack is connected with the ground terminal of USB plug.
The USB jack of USB device provides voltage signal to USB interface plug by power supply terminal and ground terminal, meets USB Mouth plug receives voltage signal by the power supply terminal and ground terminal of USB plug and is to control chip power supply.
The method that USB interface plug is enumerated as HID by USB device can be in conjunction with the above exemplary embodiments, this implementation is to this It repeats no more.
In step 402, USB device receives the control signal that USB interface plug is sent.
Optionally, USB interface plug sends control signal to USB device by way of interruption, and USB device is inserted by USB The data of mouth add terminal and data to subtract the control signal that terminal receives the transmission of USB interface plug, and interrupt the program handled, right The control signal that USB interface plug is sent is responded.Optionally, control signal is binary-coded character.
In step 403, USB device generates control instruction according to control signal.
Optionally, control instruction includes: screenshotss, take pictures, image, opens application program, adjust volume, open/close indigo plant Tooth at least one of opens/closes network connection, opens/closes flashlight, and application program is include any in USB device A application program.
Optionally, it in the scheduled duration for being initially received control signal, counts in scheduled duration and receives control signal Number, generate and control the corresponding control instruction of the number of signal.
The control signal of different numbers corresponds to different control instructions, controls the number pass corresponding with control instruction of signal System is systemic presupposition or is preset by user by USB device.For example, control signal is a binary-coded character, Being set in advance in scheduled duration and receiving the corresponding control instruction of control signal 1 is to take pictures, and is received in scheduled duration Corresponding control instruction is screenshotss when to two control signal 1,1, then receives two controls in scheduled duration when USB device When signal 1,1, the control instruction of screenshotss is generated.
Optionally, when receiving control signal, control instruction corresponding with the control type of signal is generated.
The type of different control signals corresponds to different control instructions, and the type for controlling signal is corresponding with control instruction Relationship is systemic presupposition or is preset by user by USB device.For example, control signal is two binary words Symbol, it is to take pictures that default settings, which control the corresponding control instruction of signal 00, and the control corresponding control instruction of signal 01 is screenshotss, control The corresponding control instruction of signal 10 is to open bluetooth, and the control corresponding control instruction of signal 11 is to open flashlight, then USB device exists When receiving control signal 10, the control instruction for opening bluetooth is generated.
In step 404, USB device executes control instruction.
After USB device equipment executes control instruction, the program of interruption before continuing to execute.
In conclusion the control method that the embodiment of the present disclosure provides, USB device receives the control letter that USB interface plug is sent Number, control instruction is generated according to control signal and executes control instruction, has reached and has not needed to open mobile phone, tablet computer etc. In the case where USB device, the quick behaviour to application program in USB device can be realized by operating to external USB interface plug Make, makes the more convenient operations of the USB devices such as mobile phone, tablet computer efficiently effect.
The control method that the embodiment of the present disclosure provides, USB interface plug send control letter to USB device by way of interruption Number the application program in USB device is controlled, USB device does not need the state for constantly inquiring USB interface plug, reduces The power consumption of USB device.
In an illustrative example, USB interface plug is inserted into USB device, and USB device is completed to USB interface plug Enumerate, USB device and USB interface fill in row data communication.Assuming that control signal is two binary-coded characters, and preset It is 00 that corresponding control signal when chip receives 1 single depression signal in the given time is controlled in USB interface plug, is received Corresponding control signal is 01 when to 2 single depression signals, and corresponding control signal is when receiving 3 single depression signals 10, corresponding control signal is 11 when receiving 4 single depression signals.
Also, presetting the corresponding control instruction of control signal 00 that USB device receives is to take pictures, and controls signal 01 Corresponding control instruction is screenshotss, and the control corresponding control instruction of signal 10 is to open bluetooth, controls the corresponding control of signal 11 Instruction is to open flashlight.
User touches the press section of USB interface plug key, click 3 times in scheduled duration, then USB interface plug It controls chip to generate control signal 10 and export to USB device, USB device generates the control for opening bluetooth according to control signal 10 Instruction, and execute control instruction and open bluetooth, that is, it realizes by user's adopting consecutive click chemical reaction USB interface plug 3 times, opens USB device In Bluetooth function.
Following is embodiment of the present disclosure, can be used for executing embodiments of the present disclosure.It is real for disclosure device Undisclosed details in example is applied, embodiments of the present disclosure is please referred to.
Fig. 5 is a kind of block diagram of control device shown according to an exemplary embodiment, which can be by hardware, soft Part or both is implemented in combination with some or all of, the dress for becoming the USB device for being plugged with USB interface plug as shown in Figure 1 It sets including but not limited to:
Receiving module 510 is configured as receiving the control signal that USB interface plug is sent.
Generation module 520 is configured as generating control instruction according to control signal.
Execution module 530 is configured as executing control instruction.
In conclusion the control device that the embodiment of the present disclosure provides, USB device receives the control letter that USB interface plug is sent Number, control instruction is generated according to control signal and executes control instruction, has reached and has not needed to open mobile phone, tablet computer etc. In the case where USB device, the quick behaviour to application program in USB device can be realized by operating to external USB interface plug Make, makes the more convenient operations of the USB devices such as mobile phone, tablet computer efficiently effect.
Fig. 6 is a kind of block diagram of control device shown according to an exemplary embodiment, which can be by hardware, soft Part or both is implemented in combination with some or all of, the dress for becoming the USB device for being plugged with USB interface plug as shown in Figure 1 It sets including but not limited to:
Processing module 610 is configured as that USB interface plug is enumerated as HID when detecting the insertion of USB interface plug.
Receiving module 620 is configured as receiving the control signal that USB interface plug is sent.
Generation module 630 is configured as generating control instruction according to control signal.
Generation module 630 is configured as in the scheduled duration for being initially received control signal, and statistics scheduled duration is inscribed The number of control signal is received, control instruction corresponding with the control number of signal is generated.
Generation module 630 is configured as generating control corresponding with the control type of signal when receiving control signal Instruction.
Execution module 640 is configured as executing control instruction.
In conclusion the control device that the embodiment of the present disclosure provides, USB device receives the control letter that USB interface plug is sent Number, control instruction is generated according to control signal and executes control instruction, has reached and has not needed to open mobile phone, tablet computer etc. In the case where USB device, the quick behaviour to application program in USB device can be realized by operating to external USB interface plug Make, makes the more convenient operations of the USB devices such as mobile phone, tablet computer efficiently effect.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this method Embodiment in be described in detail, no detailed explanation will be given here.
An exemplary embodiment of the present disclosure provides a kind of control devices, can be realized the control method of disclosure offer, The device includes: processor, for the memory of storage processor executable instruction;
Wherein, processor is configured as:
Receive the control signal that USB interface plug is sent.
Control instruction is generated according to control signal.
Execute control instruction.
Fig. 7 is a kind of block diagram of control device shown according to an exemplary embodiment.For example, device 700 can be shifting Mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, personal digital assistant etc..
Referring to Fig. 7, device 700 may include following one or more components: processing component 702, memory 704, power supply Component 706, multimedia component 708, audio component 710, input/output (I/O) interface 712, sensor module 714, Yi Jitong Believe component 716.
The integrated operation of the usual control device 700 of processing component 702, such as with display, telephone call, data communication, phase Machine operation and record operate associated operation.Processing component 702 may include that one or more processors 718 refer to execute It enables, to perform all or part of the steps of the methods described above.In addition, processing component 702 may include one or more modules, just Interaction between processing component 702 and other assemblies.For example, processing component 702 may include multi-media module, it is more to facilitate Interaction between media component 708 and processing component 702.
Memory 704 is configured as storing various types of data to support the operation in device 700.These data are shown Example includes the instruction of any application or method for operating on device 700, contact data, and telephone book data disappears Breath, picture, video etc..Memory 704 can be by any kind of volatibility or non-volatile memory device or their group It closes and realizes, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM) is erasable to compile Journey read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash Device, disk or CD.
Power supply module 706 provides electric power for the various assemblies of device 700.Power supply module 706 may include power management system System, one or more power supplys and other with for device 700 generate, manage, and distribute the associated component of electric power.
Multimedia component 708 includes the screen of one output interface of offer between device 700 and user.In some realities It applies in example, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen can To be implemented as touch screen, to receive input signal from the user.Touch panel include one or more touch sensors with Sense the gesture on touch, slide, and touch panel.Touch sensor can not only sense the boundary of a touch or slide action, and And also detect duration and pressure relevant to touch or slide.In some embodiments, multimedia component 708 includes One front camera and/or rear camera.It is such as in a shooting mode or a video mode, preceding when device 700 is in operation mode It sets camera and/or rear camera can receive external multi-medium data.Each front camera and rear camera can Be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 710 is configured as output and/or input audio signal.For example, audio component 710 includes a Mike Wind (MIC), when device 700 is in operation mode, when such as call mode, recording mode, and voice recognition mode, microphone is matched It is set to reception external audio signal.The received audio signal can be further stored in memory 704 or via communication set Part 716 is sent.In some embodiments, audio component 710 further includes a loudspeaker, is used for output audio signal.
I/O interface 712 provides interface between processing component 702 and peripheral interface module, and above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and lock Determine button.
Sensor module 714 includes one or more sensors, and the state for providing various aspects for device 700 is commented Estimate.For example, sensor module 714 can detecte the state that opens/closes of device 700, the relative positioning of component, such as component For the display and keypad of device 700, sensor module 714 can be with the position of 700 1 components of detection device 700 or device Set change, the existence or non-existence that user contacts with device 700, the temperature in 700 orientation of device or acceleration/deceleration and device 700 Variation.Sensor module 714 may include proximity sensor, be configured to detect without any physical contact near The presence of object.Sensor module 714 can also include optical sensor, such as CMOS or ccd image sensor, for answering in imaging With middle use.In some embodiments, which can also include acceleration transducer, gyro sensor, magnetic Sensor, pressure sensor or temperature sensor.
Communication component 716 is configured to facilitate the communication of wired or wireless way between device 700 and other equipment.Device 700 can access the wireless network based on communication standard, such as Wi-Fi, 2G or 3G or their combination.In an exemplary reality It applies in example, communication component 716 receives broadcast singal or the related letter of broadcast from external broadcasting management system via broadcast channel Breath.In one exemplary embodiment, communication component 716 further includes near-field communication (NFC) module, to promote short range communication.Example Such as, NFC module can be based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band (UWB) technology, Bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, device 700 can be believed by one or more application specific integrated circuit (ASIC), number Number processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing above-mentioned control method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided It such as include the memory 704 of instruction, above-metioned instruction can be executed by the processor 718 of device 700 to complete above-mentioned control method.Example Such as, non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk and Optical data storage devices etc..
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to its of the disclosure Its embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or Person's adaptive change follows the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following Claim is pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.

Claims (10)

1. a kind of general-purpose serial bus USB interface plug, which is characterized in that the interface plug includes key, USB plug and control core Piece, in which:
The key includes press section and output terminal, is used for when the press section is touched, defeated by the output terminal Signal is pressed out;
The USB plug includes that power supply terminal, data add terminal, data to subtract terminal and ground terminal, for setting being inserted into USB When standby, powered by the power supply terminal and the ground terminal to the control chip;
The control chip is connected with the output terminal of the key, the control chip also respectively with the institute of the USB plug State power supply terminal, the data add terminal, the data subtract terminal and are connected with the ground terminal, for receiving institute every time When stating pressing signal, control signal corresponding with the pressing signal is generated, adds terminal and the data to subtract by the data Terminal exports the control signal, alternatively, counting described pre- in the scheduled duration for being initially received the pressing signal The number that the pressing signal is received in timing is long, generates control signal corresponding with the pressing number of signal, passes through The data add terminal and the data to subtract the terminal output control signal.
2. a kind of control method, which is characterized in that for being plugged with general-purpose serial bus USB interface plug described in claim 1 USB device in, which comprises
Receive the control signal that the USB interface plug is sent;
Control instruction is generated according to the control signal;
Execute the control instruction;
Wherein, the control instruction include: screenshotss, take pictures, image, open application program, adjust volume, open/close bluetooth, At least one of open/close network connection, open/close flashlight.
3. according to the method described in claim 2, it is characterized in that, described generate control instruction, packet according to the control signal It includes:
In the scheduled duration for being initially received the control signal, counts and receive the control signal in the scheduled duration Number, generate corresponding with the control number of signal control instruction.
4. according to the method described in claim 2, it is characterized in that, described generate control instruction, packet according to the control signal It includes:
When receiving the control signal, control instruction corresponding with the control type of signal is generated.
5. according to any method of claim 2 to 4, which is characterized in that the method also includes:
When detecting USB interface plug insertion, the USB interface plug is enumerated as human interface device HID.
6. a kind of control device, which is characterized in that the control device, which may be implemented to become, is plugged with described in claim 1 lead to Some or all of with the USB device of serial bus USB interface plug, the control device includes:
Receiving module is configured as receiving the control signal that the USB interface plug is sent;
Generation module is configured as generating control instruction according to the control signal;
Execution module is configured as executing the control instruction;
Wherein, the control instruction include: screenshotss, take pictures, image, open application program, adjust volume, open/close bluetooth, At least one of open/close network connection, open/close flashlight.
7. control device according to claim 6, which is characterized in that
The generation module is configured as in the scheduled duration for being initially received the control signal, counts the pre- timing The number that the control signal is received in length, generates control instruction corresponding with the control number of signal.
8. control device according to claim 6, which is characterized in that
The generation module is configured as when receiving the control signal, is generated corresponding with the control type of signal Control instruction.
9. according to any control device of claim 6 to 8, which is characterized in that the control device further include:
Processing module is configured as that the USB interface plug is enumerated as human-machine interface when detecting USB interface plug insertion Jaws equipment HID.
10. a kind of control device, which is characterized in that the control device may be implemented described in claim 1 as being plugged with The USB device of general-purpose serial bus USB interface plug it is some or all of, the control device includes:
Processor;
For storing the memory of the processor-executable instruction;
Wherein, the processor is configured to:
Receive the control signal that the USB interface plug is sent;
Control instruction is generated according to the control signal;
Execute the control instruction;
Wherein, the control instruction include: screenshotss, take pictures, image, open application program, adjust volume, open/close bluetooth, At least one of open/close network connection, open/close flashlight.
CN201610256808.5A 2016-04-22 2016-04-22 USB interface plug, control method and device Active CN105846223B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610256808.5A CN105846223B (en) 2016-04-22 2016-04-22 USB interface plug, control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610256808.5A CN105846223B (en) 2016-04-22 2016-04-22 USB interface plug, control method and device

Publications (2)

Publication Number Publication Date
CN105846223A CN105846223A (en) 2016-08-10
CN105846223B true CN105846223B (en) 2019-04-12

Family

ID=56588934

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610256808.5A Active CN105846223B (en) 2016-04-22 2016-04-22 USB interface plug, control method and device

Country Status (1)

Country Link
CN (1) CN105846223B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106299861A (en) * 2016-08-11 2017-01-04 合肥阿格德信息科技有限公司 A kind of bus module
CN111338526B (en) * 2020-02-25 2021-09-21 维沃移动通信有限公司 Screenshot method and device
CN111343325B (en) * 2020-03-17 2021-04-09 Tcl移动通信科技(宁波)有限公司 Port detection method and device, mobile terminal and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103513861A (en) * 2012-06-29 2014-01-15 联想(北京)有限公司 Method for processing information and electronic device
CN103595874A (en) * 2013-11-29 2014-02-19 惠州Tcl移动通信有限公司 Control method for mobile-phone applications, mobile phone protective cover and mobile-phone protective cover set
CN104638491A (en) * 2015-02-09 2015-05-20 广东欧珀移动通信有限公司 Sealing method for USB (universal serial bus) interface, USB intelligent key and terminal

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE60336738D1 (en) * 2002-09-24 2011-05-26 Nxp Bv INTERFACE SIGNAL CIRCUIT ARRANGEMENT FOR A USB CONNECTION
CN201193132Y (en) * 2008-04-18 2009-02-11 周湘峻 Intelligent bottle stopper
CN102097704B (en) * 2010-12-30 2012-12-19 鸿富锦精密工业(深圳)有限公司 Electronic device
CN203896410U (en) * 2013-08-06 2014-10-22 保科特姆公司 Selector capable of coupling to port of smartphone
CN203523000U (en) * 2013-10-18 2014-04-02 吴俞青 Intelligent earphone

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103513861A (en) * 2012-06-29 2014-01-15 联想(北京)有限公司 Method for processing information and electronic device
CN103595874A (en) * 2013-11-29 2014-02-19 惠州Tcl移动通信有限公司 Control method for mobile-phone applications, mobile phone protective cover and mobile-phone protective cover set
CN104638491A (en) * 2015-02-09 2015-05-20 广东欧珀移动通信有限公司 Sealing method for USB (universal serial bus) interface, USB intelligent key and terminal

Also Published As

Publication number Publication date
CN105846223A (en) 2016-08-10

Similar Documents

Publication Publication Date Title
CN105068958B (en) Method for handover control and device
CN105071473B (en) USB charging methods and device
CN105468152A (en) Terminal operation control method and device based on wearable equipment, and equipment
CN105049923A (en) Method and apparatus for waking up electronic device
CN104219388A (en) Voice control method and device
CN105373464A (en) Charging warning method and device of wearable equipment
CN105426200A (en) Communication module firmware and plug-in generation method and apparatus
CN104898505A (en) Smart scene configuration method and device
CN104301877A (en) Short message prompting method and device
JP2017506403A (en) Apparatus, method, terminal device, program, and recording medium for realizing touch button and fingerprint authentication
CN109525881A (en) Sound draws synchronous method, device and equipment
CN104978200A (en) Application program display method and device
CN105162193A (en) Charging method and charging apparatus for terminal, and terminal
CN104837154A (en) Wireless access point control method and device
CN104394137A (en) Voice call reminding method and device
CN105846223B (en) USB interface plug, control method and device
CN104812020A (en) Method, device and system for controlling intelligent equipment to access network
CN106453032B (en) Information-pushing method and device, system
CN105554631B (en) Audio switching method, device and electronic equipment
CN105224171A (en) icon display method, device and terminal
CN105183309B (en) Method for handover control and device
CN105468281A (en) Setup interface display method and device
CN105516469A (en) Clock control method and device
CN105577523A (en) Message sending methods and apparatuses
CN105159709A (en) Application starting method and apparatus, and intelligent terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant