CN105846223A - USB interface plug and USB interface plug control method and device - Google Patents

USB interface plug and USB interface plug control method and device Download PDF

Info

Publication number
CN105846223A
CN105846223A CN201610256808.5A CN201610256808A CN105846223A CN 105846223 A CN105846223 A CN 105846223A CN 201610256808 A CN201610256808 A CN 201610256808A CN 105846223 A CN105846223 A CN 105846223A
Authority
CN
China
Prior art keywords
control
usb
terminal
usb interface
interface plug
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610256808.5A
Other languages
Chinese (zh)
Other versions
CN105846223B (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]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Computer Hardware Design (AREA)
  • Telephone Function (AREA)
  • Information Transfer Systems (AREA)

Abstract

The present invention provides a USB interface plug, and a USB interface plug control method and device, belonging to the field of the intelligent terminal. The USB interface plug comprises a button, a USB plug and a control chip; the button includes a push portion and an output terminal; the USB plug includes a power supply terminal, a data plus terminal, a data minus terminal and an earth terminal; and the output terminal of the control chip is connected with the output terminal of the button, and the control chip is connected with the power supply terminal, the data plus terminal, the data minus terminal and the earth terminal of the USB plug. The problems are solved that an interface plug used in the prior art is made of plastic materials and is configured to only prevent foreign matters from entering the USB interface of the USB device and the utilization rate is low. According to the invention, the USB interface plug comprises a control chip and a circuit connection structure, when the USB interface plug accesses the USB device, the USB interface plug is able to prevent foreign matters form entering the USB interface of the USB device and receive control signals generated by the operation of the button for controlling the USB device, and therefore the utilization of the USB interface plug is improved.

Description

USB interface plug, control method and device
Technical Field
The disclosure relates to the field of intelligent terminal accessories, in particular to a USB interface plug, a control method and a device.
Background
The terminal devices such as the mobile phone and the tablet computer are all provided with a Universal Serial Bus (USB) interface, and the USB interface can be used as a charging interface of the terminal device and a data transmission interface, and has a very important role.
Because the current USB interface is directly exposed outside the terminal equipment, dust, liquid or other foreign matters can easily enter the USB interface in a non-use state, so that the USB interface is short-circuited, blocked and corroded to influence normal use.
Disclosure of Invention
In order to solve the problem of low utilization rate of the USB interface plug, the disclosure provides the USB interface plug, a control method and a device. The technical scheme is as follows:
according to a first aspect of embodiments of the present disclosure, there is provided a USB (Universal Serial Bus) interface plug, including:
the key comprises a pressing part and an output terminal;
the USB plug comprises a power supply terminal, a data adding terminal, a data subtracting terminal and a grounding terminal;
and the control chip is connected with the output terminal of the key and is also connected with a power supply terminal, a data adding terminal, a data subtracting terminal and a grounding terminal of the USB plug respectively.
Optionally, the button is used for outputting a pressing signal through the output terminal when the pressing part is touched;
and the control chip is used for generating a control signal according to the pressing signal and outputting the control signal through the data adding terminal and the data subtracting terminal when receiving the pressing signal.
Optionally, the control chip is configured to generate a control signal corresponding to the pressing signal each time the pressing signal is received;
or the control chip is used for counting the number of the received pressing signals in the preset time length in which the pressing signals are received for the first time, and generating the control signals corresponding to the number of the pressing signals.
Optionally, the USB plug is configured to supply power to the control chip through the power terminal and the ground terminal when the USB device is plugged in.
According to a second aspect of embodiments of the present disclosure, there is provided a control method for use in a USB device plugged with a USB interface plug as in the first aspect, the method including:
receiving a control signal sent by a USB interface plug;
generating a control instruction according to the control signal;
and executing the control instruction.
Optionally, generating a control instruction according to the control signal includes:
and counting the number of the received control signals in the preset time length in which the control signals are received for the first time, and generating control instructions corresponding to the number of the control signals.
Optionally, generating a control instruction according to the control signal includes:
and when the control signal is received, generating a control instruction corresponding to the type of the control signal.
Optionally, the method further includes:
when detecting that the USB interface plug is inserted, enumerating the USB interface plug as HID (Human interface device).
Optionally, the control instruction includes: at least one of screen capture, photographing, camera shooting, application program opening, volume adjustment, Bluetooth opening/closing, network connection opening/closing and flashlight opening/closing.
According to a third aspect of the embodiments of the present disclosure, there is provided a control apparatus that may be implemented to be part or all of a USB device plugged with a USB interface plug as in the first aspect, the apparatus including:
the receiving module is configured to receive a control signal sent by the USB interface plug;
a generating module configured to generate a control instruction according to the control signal;
an execution module configured to execute the control instructions.
Optionally, the generating module is configured to count the number of the received control signals within a predetermined time period during which the control signals are received for the first time, and generate the control instruction corresponding to the number of the control signals.
Optionally, the generating module is configured to generate a control instruction corresponding to the type of the control signal when the control signal is received.
Optionally, the apparatus further comprises:
a processing module configured to enumerate the USB interface plug as HID upon detecting insertion of the USB interface plug.
Optionally, the control instruction includes: at least one of screen capture, photographing, camera shooting, application program opening, volume adjustment, Bluetooth opening/closing, network connection opening/closing and flashlight opening/closing.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a control apparatus that can be implemented to be part or all of a USB device into which a USB interface plug as in the first aspect is plugged, the apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
receiving a control signal sent by a USB interface plug;
generating a control instruction according to the control signal;
and executing the control instruction.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
the USB interface plug comprises a key, a USB plug and a control chip, wherein the key comprises a pressing part and an output terminal, the USB plug comprises a power terminal, a data adding terminal, a data subtracting terminal and a grounding terminal, the control chip is connected with the output terminal of the key, and the control chip is also connected with the power terminal, the data adding terminal, the data subtracting terminal and the grounding terminal of the USB plug respectively; the problem that the currently used interface plug is made of plastic materials, can only prevent foreign matters from being used for a USB interface of USB equipment, and is low in utilization rate is solved; the USB interface plug comprises the control chip and the circuit connection structure, when the USB equipment is inserted, foreign matters can be prevented from entering the USB interface of the USB equipment, the USB equipment can be controlled by receiving a key operation generation control signal, and the effect of improving the utilization rate of the USB interface plug is improved
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a schematic diagram illustrating a USB interface plug according to an exemplary embodiment;
FIG. 2 is a schematic diagram illustrating a connection of a USB interface plug to a USB device in accordance with an exemplary embodiment;
FIG. 3 is a flow chart illustrating a control method according to an exemplary embodiment;
FIG. 4 is a flow chart illustrating a control method according to another exemplary embodiment;
FIG. 5 is a block diagram illustrating a control device according to an exemplary embodiment;
FIG. 6 is a block diagram illustrating a control device according to another exemplary embodiment;
fig. 7 is a block diagram illustrating a control device according to another exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a schematic structural diagram illustrating a USB (Universal Serial Bus) interface plug according to an exemplary embodiment, where the USB interface plug includes: keys 120, a USB plug 140, and a control chip 160.
The key 120 includes a pressing portion 121 and an output terminal 122.
The USB plug 140 includes a power terminal 141, a data plus terminal 142, a data minus terminal 143, and a ground terminal 144.
Alternatively, the power supply terminal 141, the data plus terminal 142, the data minus terminal 143, and the ground terminal 144 are conductive metal poles.
The USB plug 140 may be a USB type a interface or a USB type B interface.
Optionally, the USB plug 140 further includes other terminals (not shown in fig. 1), the USB plug 140 is a Mini USB a Type interface, a Mini USB B Type interface, a Mini USB AB Type interface, a Micro USB ba Type interface, a Micro USB B Type interface, or a USB Type-C interface, different USB interface types include different other terminals, the present embodiment does not limit the types of the other terminals included in the USB plug 140, and does not limit the types of the USB interface of the USB plug 140.
It should be noted that the USB interface plug may further include a housing, the key 120 and the control chip 160 are thermoplastic molded in the housing through plastic, the pressing portion 121 of the key 120 is outside the housing and is configured to receive a touch operation, and the USB plug 140 is outside the housing and is configured to be inserted into a USB device.
The USB plug 140 is used to supply power to the control chip 160 through the power terminal 141 and the ground terminal 144 when the USB device is inserted.
Optionally, the USB device is an electronic device including a USB interface, such as a mobile phone, a tablet computer, or a notebook computer.
As shown in fig. 2, which schematically illustrates a connection diagram of the USB device 170 and the USB interface plug, the USB device 170 includes a USB socket 180 therein, and the USB socket 180 includes a power terminal 181, a data adding terminal 182, a data subtracting terminal 183, and a ground terminal 184.
The USB plug 140 has the same USB interface type as the USB interface type of the USB socket 180 in the USB device, and when the USB plug 140 is inserted into the USB socket 180 of the USB device, the power terminal 141 of the USB plug 140 is connected to the power terminal 181 of the USB socket 180, the data adding terminal 142 of the USB plug 140 is connected to the data adding terminal 182 of the USB socket 180, the data subtracting terminal 143 of the USB plug 140 is connected to the data subtracting terminal 183 of the USB socket 180, and the ground terminal 144 of the USB plug 140 is connected to the ground terminal 184 of the USB socket 180.
When detecting that the USB Interface plug is inserted, the USB Device 170 enumerates the USB Interface plug as an HID (Human Interface Device), which includes the following steps:
1. when detecting that the USB interface plug is inserted, the USB device resets the USB interface plug, the address of the USB interface plug is 0 after the USB interface plug is reset, and the USB device sends a device descriptor acquisition request to the USB interface plug through the address 0 and an endpoint 0 of the USB interface plug to request to acquire the device descriptor of the USB interface plug; after receiving the device descriptor acquisition request, the USB interface plug returns the device descriptor to the USB device; after the USB equipment determines that the received equipment descriptor is correct, a confirmation data packet with the length of 0 is returned to the USB interface plug, and the confirmation data packet with the length of 0 does not include data information and is used for confirming that the equipment descriptor is correct.
In this step, the device descriptor acquired by the USB device may not be a complete device descriptor, but only a part of the device descriptor.
2. After resetting the USB interface plug again, the USB equipment sends an address setting request to the USB interface plug and allocates a unique address to the USB interface plug, after receiving the address, the USB interface plug returns a 0-length status packet to the USB equipment, and the 0-length status packet does not include data information and is used for indicating that the address setting is successful; after receiving the status packet with 0 length returned by the USB interface plug, the USB device returns an ACK (Acknowledgement) packet to the USB interface plug, where the ACK packet is used to confirm that the address setting has been successful. When the USB interface plug receives the ACK data packet returned by the USB equipment, the USB interface plug can use the address to carry out data communication with the USB equipment.
3. The USB device obtains descriptors such as a device descriptor, a configuration descriptor, an interface descriptor, an endpoint descriptor, and a string descriptor of the USB interface plug through an address allocated to the USB interface plug, and determines related information such as an interface, an endpoint, a configuration, a device name, and a serial number of the USB interface plug according to at least the descriptors.
The USB device completes enumeration of the USB interface plug by using the steps, and performs data communication with the USB interface plug according to the acquired related information of the USB interface plug and the address allocated to the USB interface plug.
The push button 120 outputs a push signal through the output terminal 122 when the push portion 121 is touched.
Optionally, the touch operation received by the pressing portion 121 is a single click, a long press, or a plurality of single clicks within a predetermined time period, where the long press is a touch operation in which the time that the pressing portion 121 is touched exceeds a predetermined threshold, and the predetermined threshold and the predetermined time period are preset by a system or customized by a user.
Optionally, when the pressing portion 121 is touched, the pressing signal output by the key 120 through the output terminal 122 is a level signal, and the pressing signal output by the output terminal includes a single pressing signal and a continuous pressing signal, for example, when the pressing portion 121 is clicked, a high level signal, that is, a single pressing signal, is output; when the pressing portion 121 is pressed for a long time, a continuous high level signal is output, that is, a continuous pressing signal is output; when the pressing portion 121 is clicked a plurality of times, each click outputs a high level signal, that is, outputs a plurality of single-press signals.
And the control chip 160 is used for generating a control signal according to the pressing signal when receiving the pressing signal.
Optionally, the control signal is a binary character.
And a control chip 160 for generating a control signal corresponding to the pressing signal every time the pressing signal is received.
Different pressing signals correspond to different control signals, the corresponding relation between the pressing signals and the control signals is preset, when a plurality of single pressing signals are received, a plurality of control signals are generated, for example, one-bit binary characters are used for representing the control signals, the control signal corresponding to a continuous pressing signal is preset to be 0, the control signal corresponding to a single pressing signal is 1, when the pressing part is pressed for a long time, the control signal 0 is generated, when the pressing part is clicked, the control signal 1 is generated, and when the pressing part is clicked twice in a preset time, the two control signals 1 and 1 are generated.
Or, the control chip 160 is configured to count the number of the received pressing signals within a predetermined time period during which the pressing signals are received for the first time, and generate the control signals corresponding to the number of the pressing signals.
The number of the pressing signals received in the predetermined time period corresponds to different types of control signals, the correspondence between the number of the pressing signals received in the predetermined time period and the types of the control signals is preset, for example, a two-bit binary character is used to represent the control signals, the control signal corresponding to 1 single pressing signal received in the predetermined time period is 00, the control signal corresponding to 2 single pressing signals received is 01, the control signal corresponding to 3 single pressing signals received is 10, the control signal corresponding to 4 single pressing signals received is 11, and when the pressing part receives 3 clicks in the predetermined time period, the control signal generated by the control chip is 10.
For example, in the above example, the control signal corresponding to receiving one continuous pressing signal within the preset predetermined time period is 00, the control signal corresponding to receiving 1 single pressing signal is 01, the control signal corresponding to receiving 2 single pressing signals is 10, and the control signal corresponding to receiving 3 single pressing signals is 11.
And a control chip 160 for outputting a control signal through the data adding terminal 142 and the data subtracting terminal 143.
The control chip outputs a voltage through the data adding terminal 142 and the data subtracting terminal 143, outputs a high level 1 and a low level 0 in the control signal in the form of binary characters through a voltage difference between the control data adding terminal 142 and the data subtracting terminal 143, and indicates a high level 1 in the control signal when the voltage difference between the data adding terminal 142 and the data subtracting terminal 143 is greater than or equal to a voltage threshold; when the voltage difference between the data adding terminal 142 and the data subtracting terminal 143 is smaller than the voltage threshold, it represents a low level 0 in the control signal, and the voltage threshold is preset by the system or customized by the user.
The control chip carries out bit-by-bit serial transmission on binary characters of the control signals from low-order characters to high-order characters, for example, the voltage threshold is 0.5V, the control signals are 01, the control chip outputs 2.7V through the control data adding terminal, the control data subtracting terminal outputs 2.0V, the voltage difference value between the data adding terminal and the data subtracting terminal is 0.7V and is larger than the voltage threshold of 0.5V, and the low-order character 1 is output; the control chip controls the data adding terminal to output 2.3V voltage, controls the data subtracting terminal to output 2.0V voltage, and controls the voltage difference value between the data adding terminal and the data subtracting terminal to be 0.3V and less than the voltage threshold value to be 0.5V, namely, the output of the high-order character 0 is realized.
To sum up, the USB interface plug provided in the embodiment of the present disclosure includes a key, a USB plug, and a control chip, where the key includes a pressing portion and an output terminal, the USB plug includes a power terminal, a data adding terminal, a data subtracting terminal, and a ground terminal, the control chip is connected to the output terminal of the key, and the control chip is further connected to the power terminal, the data adding terminal, the data subtracting terminal, and the ground terminal of the USB plug, respectively; the problem that the currently used interface plug is made of plastic materials, can only prevent foreign matters from being used for a USB interface of USB equipment, and is low in utilization rate is solved; the USB interface plug comprises the control chip and the circuit connection structure, when the USB equipment is inserted, foreign matters can be prevented from entering the USB interface of the USB equipment, the control signal generated by key operation can be received to control the USB equipment, and the utilization rate of the USB interface plug is improved.
Fig. 3 is a flowchart illustrating a control method according to an exemplary embodiment, which is applied to a USB device plugged with the USB interface plug shown in fig. 1, and includes the following steps:
in step 301, the USB device receives a control signal sent by the USB interface plug.
In step 302, the USB device generates a control command according to the control signal.
In step 303, the USB device executes the control instructions.
In summary, according to the control method provided by the embodiment of the present disclosure, the USB device receives the control signal sent by the USB interface plug, generates the control instruction according to the control signal, and executes the control instruction, so that the USB device can operate the external USB interface plug without opening the USB device such as a mobile phone or a tablet computer, thereby implementing a fast operation on an application program in the USB device, and enabling the USB device such as the mobile phone or the tablet computer to be operated more conveniently and quickly.
Fig. 4 is a flowchart illustrating a control method according to an exemplary embodiment, which is applied to a USB device plugged with the USB interface plug shown in fig. 1, and includes the following steps:
in step 401, when detecting that the USB interface plug is inserted, the USB device enumerates the USB interface plug as HID.
The USB device comprises a USB socket, the USB socket comprises a power terminal, a data adding terminal, a data subtracting terminal and a grounding terminal, when a USB interface plug is inserted into the USB device, the connection relation between the USB socket of the USB device and a USB plug of the USB interface plug is shown in figure 2, the power terminal of the USB socket is connected with the power terminal of the USB plug in the USB interface plug, the data adding terminal of the USB socket is connected with the data adding terminal of the USB plug, the data subtracting terminal of the USB socket is connected with the data subtracting terminal of the USB plug, and the grounding terminal of the USB socket is connected with the grounding terminal of the USB plug.
The USB interface plug is connected with the USB plug and is used for receiving the voltage signal and supplying power to the control chip.
The method for enumerating the USB interface plug as HID by the USB device may be combined with the foregoing exemplary embodiment, and this implementation is not described again.
In step 402, the USB device receives a control signal sent by the USB interface plug.
Optionally, the USB interface plug sends a control signal to the USB device in an interrupt manner, and the USB device receives the control signal sent by the USB interface plug through the data add terminal and the data subtract terminal of the USB socket, and interrupts the program being processed, and responds to the control signal sent by the USB interface plug. Optionally, the control signal is a binary character.
In step 403, the USB device generates a control command according to the control signal.
Optionally, the control instruction includes: at least one of screen capturing, photographing, shooting, opening an application program, volume adjusting, Bluetooth turning on/off, network connection turning on/off and flashlight turning on/off, wherein the application program is any one of application programs included in the USB device.
Optionally, within the predetermined time period during which the control signal is received for the first time, the number of the received control signals within the predetermined time period is counted, and the control instruction corresponding to the number of the control signals is generated.
The control signals with different numbers correspond to different control instructions, and the corresponding relation between the number of the control signals and the control instructions is preset by a system or preset by a user through USB equipment. For example, the control signal is a one-bit binary character, the control instruction corresponding to receiving one control signal 1 within a preset time period is to take a picture, the control instruction corresponding to receiving two control signals 1 and 1 within the preset time period is to capture a screen, and when the USB device receives two control signals 1 and 1 within the preset time period, the control instruction for capturing the screen is generated.
Optionally, when the control signal is received, a control instruction corresponding to the type of the control signal is generated.
The types of the different control signals correspond to different control instructions, and the corresponding relation between the types of the control signals and the control instructions is preset by a system or preset by a user through USB equipment. For example, the control signal is a two-bit binary character, the control instruction corresponding to the preset setting control signal 00 is to take a picture, the control instruction corresponding to the control signal 01 is to capture a screen, the control instruction corresponding to the control signal 10 is to turn on bluetooth, and the control instruction corresponding to the control signal 11 is to turn on the flashlight, so that the USB device generates a control instruction to turn on bluetooth when receiving the control signal 10.
In step 404, the USB device executes the control instructions.
And after the USB equipment executes the control command, the USB equipment continues to execute the interrupted program.
In summary, according to the control method provided by the embodiment of the present disclosure, the USB device receives the control signal sent by the USB interface plug, generates the control instruction according to the control signal, and executes the control instruction, so that the USB device can operate the external USB interface plug without opening the USB device such as a mobile phone or a tablet computer, thereby implementing a fast operation on an application program in the USB device, and enabling the USB device such as the mobile phone or the tablet computer to be operated more conveniently and quickly.
According to the control method provided by the embodiment of the disclosure, the USB interface plug sends the control signal to the USB device in an interruption mode to control the application program in the USB device, and the USB device does not need to continuously inquire the state of the USB interface plug, so that the power consumption of the USB device is reduced.
In one illustrative example, a USB interface plug is inserted into a USB device, and the USB device completes enumeration of the USB interface plug, with which the USB device is in data communication. Suppose the control signal is a two-bit binary character, and it is preset that the control signal corresponding to the control chip in the USB interface plug receives 1 single-press signal within a predetermined time is 00, the control signal corresponding to the control chip in the USB interface plug receives 2 single-press signals is 01, the control signal corresponding to the control chip in the USB interface plug receives 3 single-press signals is 10, and the control signal corresponding to the control chip in the USB interface plug receives 4 single-press signals is 11.
In addition, it is preset that the control instruction corresponding to the control signal 00 received by the USB device is to take a picture, the control instruction corresponding to the control signal 01 is to capture a screen, the control instruction corresponding to the control signal 10 is to turn on bluetooth, and the control instruction corresponding to the control signal 11 is to turn on the flashlight.
The user touches the pressing part of the USB interface plug key, clicks 3 times within the preset time, the control chip of the USB interface plug generates a control signal 10 and outputs the control signal to the USB equipment, the USB equipment generates a control instruction for opening the Bluetooth according to the control signal 10, and executes the control instruction to open the Bluetooth, namely, the Bluetooth function in the USB equipment is opened by continuously clicking the USB interface plug 3 times by the user.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods. For details not disclosed in the embodiments of the apparatus of the present disclosure, refer to the embodiments of the method of the present disclosure.
FIG. 5 is a block diagram illustrating a control apparatus that may be implemented in hardware, software, or a combination of both, as part or all of a USB device plugged with a USB interface plug as shown in FIG. 1, according to an exemplary embodiment, including but not limited to:
and a receiving module 510 configured to receive the control signal sent by the USB interface plug.
A generating module 520 configured to generate a control instruction according to the control signal.
An execution module 530 configured to execute the control instructions.
To sum up, according to the control device provided by the embodiment of the present disclosure, the USB device receives the control signal sent by the USB interface plug, generates the control instruction according to the control signal, and executes the control instruction, so that the USB device can operate the external USB interface plug without opening the USB device such as a mobile phone or a tablet computer, thereby implementing a fast operation on an application program in the USB device, and enabling the USB device such as the mobile phone or the tablet computer to be operated more conveniently and quickly.
FIG. 6 is a block diagram illustrating a control apparatus that may be implemented in hardware, software, or a combination of both, as part or all of a USB device plugged with a USB interface plug as shown in FIG. 1, according to an exemplary embodiment, including but not limited to:
a processing module 610 configured to enumerate the USB interface plug as HID upon detecting insertion of the USB interface plug.
And a receiving module 620 configured to receive the control signal sent by the USB interface plug.
A generating module 630 configured to generate a control instruction according to the control signal.
The generating module 630 is configured to count the number of the received control signals within a predetermined time period during which the control signals are received for the first time, and generate a control instruction corresponding to the number of the control signals.
A generating module 630 configured to generate a control instruction corresponding to a type of the control signal when the control signal is received.
An execution module 640 configured to execute the control instructions.
To sum up, according to the control device provided by the embodiment of the present disclosure, the USB device receives the control signal sent by the USB interface plug, generates the control instruction according to the control signal, and executes the control instruction, so that the USB device can operate the external USB interface plug without opening the USB device such as a mobile phone or a tablet computer, thereby implementing a fast operation on an application program in the USB device, and enabling the USB device such as the mobile phone or the tablet computer to be operated more conveniently and quickly.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
An exemplary embodiment of the present disclosure provides a control apparatus, which can implement the control method provided by the present disclosure, and the apparatus includes: a processor, a memory for storing processor-executable instructions;
wherein the processor is configured to:
and receiving a control signal sent by the USB interface plug.
And generating a control instruction according to the control signal.
And executing the control instruction.
FIG. 7 is a block diagram illustrating a control device according to an exemplary embodiment. For example, the apparatus 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a personal digital assistant, and the like.
Referring to fig. 7, apparatus 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and a communication component 716.
The processing component 702 generally controls overall operation of the device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 718 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 702 may include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operations at the apparatus 700. Examples of such data include instructions for any application or method operating on device 700, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 704 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 706 provides power to the various components of the device 700. The power components 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 700.
The multimedia component 708 includes a screen that provides an output interface between the device 700 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 700 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 710 is configured to output and/or input audio signals. For example, audio component 710 includes a Microphone (MIC) configured to receive external audio signals when apparatus 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 714 includes one or more sensors for providing status assessment of various aspects of the apparatus 700. For example, sensor assembly 714 may detect an open/closed state of device 700, the relative positioning of components, such as a display and keypad of device 700, the change in position of device 700 or a component of device 700, the presence or absence of user contact with device 700, the orientation or acceleration/deceleration of device 700, and the change in temperature of device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate wired or wireless communication between the apparatus 700 and other devices. The apparatus 700 may access a wireless network based on a communication standard, such as Wi-Fi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 700 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described control methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 704 comprising instructions, executable by the processor 718 of the apparatus 700 to perform the control method described above is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (15)

1. A Universal Serial Bus (USB) interface plug, the interface plug comprising:
the key comprises a pressing part and an output terminal;
a USB plug including a power terminal, a data plus terminal, a data minus terminal, and a ground terminal;
and the control chip is connected with the output terminal of the key and is also connected with the power supply terminal, the data adding terminal, the data subtracting terminal and the grounding terminal of the USB plug respectively.
2. The USB interface plug of claim 1,
the key is used for outputting a pressing signal through the output terminal when the pressing part is touched;
and the control chip is used for generating a control signal according to the pressing signal when receiving the pressing signal and outputting the control signal through the data adding terminal and the data subtracting terminal.
3. The USB interface plug of claim 2,
the control chip is used for generating a control signal corresponding to the pressing signal when receiving the pressing signal every time;
or,
the control chip is used for counting the number of the press signals received in the preset time length when the press signals are received for the first time, and generating control signals corresponding to the number of the press signals.
4. The USB interface plug of claim 1,
the USB plug is used for supplying power to the control chip through the power terminal and the grounding terminal when being inserted into a USB device.
5. A control method for use in a USB device plugged with a USB interface plug according to any one of claims 1 to 4, the method comprising:
receiving a control signal sent by the USB interface plug;
generating a control instruction according to the control signal;
and executing the control instruction.
6. The method of claim 5, wherein generating control instructions based on the control signal comprises:
and counting the number of the control signals received in the preset time length within the preset time length of the control signals received for the first time, and generating control instructions corresponding to the number of the control signals.
7. The method of claim 5, wherein generating control instructions based on the control signal comprises:
and generating a control instruction corresponding to the type of the control signal when the control signal is received.
8. The method of any of claims 5 to 7, further comprising:
when the USB interface plug is detected to be inserted, enumerating the USB interface plug as a Human Interface Device (HID).
9. The method of any of claims 5 to 7, wherein the control instructions comprise: at least one of screen capture, photographing, camera shooting, application program opening, volume adjustment, Bluetooth opening/closing, network connection opening/closing and flashlight opening/closing.
10. A control apparatus, characterized in that the control apparatus can be implemented as part or all of a USB device plugged with a USB plug according to any one of claims 1 to 4, the apparatus comprising:
the receiving module is configured to receive the control signal sent by the USB interface plug;
a generating module configured to generate a control instruction according to the control signal;
an execution module configured to execute the control instruction.
11. The apparatus of claim 10,
the generation module is configured to count the number of the control signals received in the preset time length within the preset time length when the control signals are received for the first time, and generate control instructions corresponding to the number of the control signals.
12. The apparatus of claim 10,
the generation module is configured to generate a control instruction corresponding to the type of the control signal when the control signal is received.
13. The apparatus of any one of claims 10 to 12, further comprising:
a processing module configured to enumerate the USB interface plug as a human interface device HID when detecting that the USB interface plug is inserted.
14. The apparatus of any of claims 10 to 12, wherein the control instructions comprise: at least one of screen capture, photographing, camera shooting, application program opening, volume adjustment, Bluetooth opening/closing, network connection opening/closing and flashlight opening/closing.
15. A control apparatus, characterized in that the control apparatus can be implemented as part or all of a USB device plugged with a USB plug according to any one of claims 1 to 4, the apparatus comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to:
receiving a control signal sent by the USB interface plug;
generating a control instruction according to the control signal;
and executing the control instruction.
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 true CN105846223A (en) 2016-08-10
CN105846223B 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)

Cited By (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
CN111343325A (en) * 2020-03-17 2020-06-26 Tcl移动通信科技(宁波)有限公司 Port detection method and device, mobile terminal and storage medium
CN111338526A (en) * 2020-02-25 2020-06-26 维沃移动通信有限公司 Screenshot method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050249143A1 (en) * 2002-09-24 2005-11-10 Koninklijke Philips Electronics N.V. Interface integrated circuit device for a usb connection
CN201193132Y (en) * 2008-04-18 2009-02-11 周湘峻 Intelligent bottle stopper
CN102097704A (en) * 2010-12-30 2011-06-15 鸿富锦精密工业(深圳)有限公司 Cap and electronic device with same
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
CN203523000U (en) * 2013-10-18 2014-04-02 吴俞青 Intelligent earphone
CN203896410U (en) * 2013-08-06 2014-10-22 保科特姆公司 Selector capable of coupling to port of smartphone
CN104638491A (en) * 2015-02-09 2015-05-20 广东欧珀移动通信有限公司 Sealing method for USB (universal serial bus) interface, USB intelligent key and terminal

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050249143A1 (en) * 2002-09-24 2005-11-10 Koninklijke Philips Electronics N.V. Interface integrated circuit device for a usb connection
CN201193132Y (en) * 2008-04-18 2009-02-11 周湘峻 Intelligent bottle stopper
CN102097704A (en) * 2010-12-30 2011-06-15 鸿富锦精密工业(深圳)有限公司 Cap and electronic device with same
CN103513861A (en) * 2012-06-29 2014-01-15 联想(北京)有限公司 Method for processing information and 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
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

Cited By (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
CN111338526A (en) * 2020-02-25 2020-06-26 维沃移动通信有限公司 Screenshot method and device
CN111343325A (en) * 2020-03-17 2020-06-26 Tcl移动通信科技(宁波)有限公司 Port detection method and device, mobile terminal and storage medium

Also Published As

Publication number Publication date
CN105846223B (en) 2019-04-12

Similar Documents

Publication Publication Date Title
US10750007B2 (en) Method and device for preventing terminal from being inadvertently touched
EP3306441A1 (en) Temperature control method and apparatus
EP3136793A1 (en) Method and apparatus for awakening electronic device
US9362639B2 (en) Audio jack and electronic device including same
US10216976B2 (en) Method, device and medium for fingerprint identification
CN107102772B (en) Touch control method and device
EP3832841A1 (en) Charging circuit, electronic device, charging control method and device
CN106033397B (en) Memory buffer area adjusting method, device and terminal
EP2924552B1 (en) Method and mobile terminal for executing user instructions
EP3232301B1 (en) Mobile terminal and virtual key processing method
KR20170038178A (en) Method, apparatus, and mobile terminal for identificating fingerprint
EP3076745A1 (en) Methods and apparatuses for controlling wireless access point
US10572424B2 (en) Method and apparatus for switching state
CN108121631B (en) Screen abnormal state reminding method and device
CN108091808B (en) Battery, equipment, charging control method and device
CN106371643A (en) Touch chip failure processing method and apparatus
CN106325454B (en) Power supply control device and method and electronic equipment
CN109862169B (en) Electronic equipment control method, device and storage medium
CN112905035B (en) Touch screen control method and device and computer storage medium
CN107329520B (en) USB interface connection method, device and system of mobile terminal
US11205906B2 (en) Charging processing method, terminal device and storage medium
CN105846223A (en) USB interface plug and USB interface plug control method and device
CN106451670B (en) A kind of charge control method, device and terminal device
CN113361305B (en) Fingerprint acquisition method, electronic device and computer readable storage medium
CN107422911B (en) Pressure value detection method and device and computer readable storage medium

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