Summary of the invention
Based on this, it is necessary in view of the above technical problems, a kind of USB data transmission control method and relevant device are provided,
When be connected by USB with other equipment in mobile terminal carry out data transmission when, when can effectively reduce level change by
The interference of other modules in mobile terminal, so that the efficiency of improve data transfer, promotes the overall performance of mobile terminal.
A kind of USB data transmission control method, comprising:
A, when level switching occurs for the electric signal transmitted in USB transmission line, the electricity of control USB data transmission pin switching output
Level state remains unchanged;
B, processor reads the level of the USB data transmission pin switching output, and real-time perfoming data are transmitted.
Wherein, before the step A further include: setting one is used in USB between USB transmission line and processor in advance
The trigger that the level state of control USB data transmission pin switching output remains unchanged when level switching occurs for transmission line.
Wherein, the step A is specifically included:
A1, when the electric signal transmitted in USB transmission line switches to high level by low level, keep the output end of the trigger
Level remain high level;
When the electric signal transmitted in USB transmission line switches to low level by high level, the output end of the trigger is kept
Level remains low level.
Wherein, the step B is specifically included:
B1, processor read the level of the USB data transmission pin;
Whether B2, to judge the pin at this time be high level, if in current USB transmission line being then the second logical value, otherwise currently
It is the first logical value in USB transmission line;
B3, processor obtain the data of the USB transmission line transmitting.
A kind of USB data transmission control system, comprising: trigger and processor;
The trigger is connected with USB transmission line and processor respectively;
The trigger, for when level switching occurs for the electric signal transmitted in USB transmission line, control USB data transmission to be drawn
The level state of foot switching output remains unchanged;
The processor, for reading the level of the USB data transmission pin switching output, and real-time perfoming data are transmitted.
Wherein, the processor reads the level of the USB data transmission pin switching output, and judges the pin at this time
Whether it is high level, is otherwise the first logic in current USB transmission line in current USB transmission line if being then the second logical value
Value, and obtain the data of the USB transmission line transmitting.
Wherein, the trigger includes the end S and the end R connecting with the contact of USB transmission line, further includes and processor
The output end Q of connection, the R of the trigger terminate pull down resistor R1, and S terminates pull down resistor R2.
Wherein, three endpoints of the USB transmission line, one end is fixed to meet VDD, the another both ends R with the trigger respectively
End is connected with the end S, and when in USB transmission line being the first logical value, the contact of USB transmission line is in contact with the end R, works as USB transmission line
The contact of USB data transmission line is in contact with the end S when upper data are the second logical values.
Wherein, when the contact of the USB transmission line be in the end R go forward side by side line level switching when, contact by the end R turn to the end S, then
The output end Q of trigger remains high level;When the contact of the USB transmission line be in the end S go forward side by side line level switching when, touching
Point turns to the end R by the end S, then the output end Q of trigger remains high level.
A kind of computer equipment, including trigger, memory and processor, the memory are stored with computer program,
The trigger is for eliminating the interference that other modules generate level in USB transmission line on mobile terminal;The processor is held
The step of realizing any one of claims 1 to 4 the method when the row computer program.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor
The step of method described in any one of Claims 1-4 is realized when row.
In conclusion a kind of USB data transmission control method provided by the present invention and relevant device, wherein the side
Method includes: when level switching occurs for the electric signal transmitted in USB transmission line, and control USB data transmission pin switching exports
Level state remains unchanged;Processor reads the level of the USB data transmission pin switching output, and real-time perfoming data pass
It is defeated.When be connected by USB with other equipment in computer equipment carry out data transmission when, usb data is kept by trigger
The level for transmitting pin is stable high level or stable low level, by mobile terminal when can effectively reduce level change
In other modules interference, guarantee each time level switch when output end can export stable waveform, exported according to output end
Stable waveform so that processor be easy for judge the level in USB transmission line be high level or low level, thus
The efficiency of improve data transfer promotes the overall performance of computer equipment.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer and more explicit, right as follows in conjunction with drawings and embodiments
The present invention is further described.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and do not have to
It is of the invention in limiting.
A kind of USB data transmission control method provided by the present application, can be applied in terminal.Wherein, terminal can with but
It is not limited to various personal computers, laptop, mobile phone, tablet computer, vehicle-mounted computer and portable wearable device.This
The terminal of invention uses multi-core processor.Wherein, the processor of terminal can be central processing unit (Central Processing
Unit, CPU), graphics processor (Graphics Processing Unit, GPU), video processing unit (Video
At least one of Processing Unit, VPU) etc..
In one embodiment, as shown in Figure 1, providing a kind of USB data transmission control method, it is applied in this way
It is illustrated for above-mentioned terminal, comprising the following steps:
S100, when level switching occurs for the electric signal that transmits in USB transmission line, control USB data transmission pin switching output
Level state remain unchanged.
Setting one is used to keep the level of USB data transmission pin for high electricity between USB transmission line and processor in advance
Flat or low level trigger, wherein the trigger is rest-set flip-flop.
Specifically, keeping the trigger when the electric signal transmitted in USB transmission line switches to high level by low level
The level of output end remain high level;When the electric signal transmitted in USB transmission line switches to low level by high level, protect
The level for holding the output end of the trigger remains low level.
S200, processor read the level of the USB data transmission pin switching output, and real-time perfoming data are transmitted.
Wherein, the step S200 is specifically included:
S201, processor read the level of the pin of the USB transmission line;
Whether S202, to judge the pin at this time be high level, if in current USB transmission line being then the second logical value, otherwise when
It is the first logical value in preceding USB transmission line, wherein then the second logical value is 1 when the first logical value is 0, when the first logical value is 1
Then the second logical value is 0, for example, high level is exactly to pass a data 1, low level is exactly to pass a data 0;
S203, processor obtain the data of the USB transmission line transmitting.
In the USB data transmission control method of the present embodiment, when being connected by USB with other equipment in computer equipment
When carrying out data transmission, it is stable high level or stable low electricity that the level of USB data transmission pin is kept by trigger
Flat, interference when can effectively reduce level change by other modules in mobile terminal guarantees defeated when level switches each time
Outlet can export stable waveform, according to the stable waveform that output end exports, so that processor is easy for judge
Level in USB transmission line is high level or low level, so that the efficiency of improve data transfer, promotes the entirety of computer equipment
Performance.
It should be understood that although each step in the flow chart of Fig. 1 is successively shown according to the instruction of arrow, this
A little steps are not that the inevitable sequence according to arrow instruction successively executes.Unless expressly state otherwise herein, these steps
It executes there is no the limitation of stringent sequence, these steps can execute in other order.Moreover, at least part in Fig. 1
Step may include that perhaps these sub-steps of multiple stages or stage are executed in synchronization to multiple sub-steps
It completes, but can execute at different times, the execution sequence in these sub-steps or stage, which is also not necessarily, successively to be carried out,
But it can be executed in turn or alternately at least part of the sub-step or stage of other steps or other steps.
In one embodiment, as shown in Fig. 2, providing a kind of USB data transmission control system, which includes: touching
Send out device and processor;
The trigger is connected with USB transmission line and processor respectively;
The trigger, for when level switching occurs for the electric signal transmitted in USB transmission line, control USB data transmission to be drawn
The level state of foot switching output remains unchanged, wherein the trigger is rest-set flip-flop;
The processor, for reading the level of the USB data transmission pin switching output, and real-time perfoming data are transmitted.
Wherein, the processor reads the level of the USB data transmission pin switching output, and judges the pin at this time
Whether it is high level, is otherwise the first logic in current USB transmission line in current USB transmission line if being then the second logical value
Value, and obtain the data of the USB transmission line transmitting.
Wherein, the trigger includes the end S and the end R connecting with the contact of USB transmission line, further includes and processor
The output end Q of connection, the R of the trigger terminate pull down resistor R1, and S terminates pull down resistor R2, R1 and R2 and is used for current limliting.
Wherein, three endpoints of the USB transmission line, one end is fixed to meet VDD, the another both ends R with the trigger respectively
End is connected with the end S, and when in USB transmission line being the first logical value, the contact of USB transmission line is in contact with the end R, works as USB transmission line
The contact of USB data transmission line is in contact with the end S when upper data are the second logical values.
Wherein, when the contact of the USB transmission line be in the end R go forward side by side line level switching when, contact by the end R turn to the end S, to the greatest extent
Pipe contact is interfered at the end S shakes back and forth, as long as the contact does not return to the end R, the output end Q of trigger remains high electricity
It is flat;When the contact of the USB transmission line be in the end S go forward side by side line level switching when, contact by the end S turn to the end R, although contact is in R
End is interfered shakes back and forth, but as long as not returning to the end S, then the output end Q of trigger remains high level.
In one embodiment, a kind of computer equipment is provided, which can be terminal, internal structure
Figure can be as shown in Figure 3.The computer equipment includes being connect by the processor of system bus connection, memory, trigger, network
Mouth, display screen and input unit.Wherein, the processor of the computer equipment is for providing calculating and control ability.The computer
The memory of equipment includes non-volatile memory medium, built-in storage.The non-volatile memory medium be stored with operating system and
Computer program.The built-in storage provides ring for the operation of operating system and computer program in non-volatile memory medium
Border.The network interface of the computer equipment is used to communicate with external terminal by network connection.The computer program is processed
To realize a kind of USB data transmission control method when device executes.The display screen of the computer equipment can be liquid crystal display or
Person's electric ink display screen, the input unit of the computer equipment can be the touch layer covered on display screen, be also possible to count
Key, trace ball or the Trackpad being arranged on machine equipment shell are calculated, can also be external keyboard, Trackpad or mouse etc..
It will be understood by those skilled in the art that structure shown in Fig. 3, only part relevant to application scheme is tied
The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment
It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, a kind of computer equipment, including trigger, memory and processor, the touching are provided
Hair device is for eliminating the interference that other modules generate level in USB transmission line on mobile terminal;Calculating is stored in memory
Machine program, the processor perform the steps of when executing computer program
S100, when level switching occurs for the electric signal that transmits in USB transmission line, control USB data transmission pin switching output
Level state remain unchanged.
Setting one is used to keep the level of USB data transmission pin for high electricity between USB transmission line and processor in advance
Flat or low level trigger, wherein the trigger is rest-set flip-flop.
Specifically, keeping the trigger when the electric signal transmitted in USB transmission line switches to high level by low level
The level of output end remain high level;When the electric signal transmitted in USB transmission line switches to low level by high level, protect
The level for holding the output end of the trigger remains low level.
S200, processor read the level of the USB data transmission pin switching output, and real-time perfoming data are transmitted.
Wherein, the step S200 is specifically included:
S201, processor read the level of the pin of the USB transmission line;
Whether S202, to judge the pin at this time be high level, if in current USB transmission line being then the second logical value, otherwise when
It is the first logical value in preceding USB transmission line;
S203, processor obtain the data of the USB transmission line transmitting.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated
Machine program performs the steps of when being executed by processor
S100, when level switching occurs for the electric signal that transmits in USB transmission line, control USB data transmission pin switching output
Level state remain unchanged.
Setting one is used to keep the level of USB data transmission pin for high electricity between USB transmission line and processor in advance
Flat or low level trigger, wherein the trigger is rest-set flip-flop.
Specifically, keeping the trigger when the electric signal transmitted in USB transmission line switches to high level by low level
The level of output end remain high level;When the electric signal transmitted in USB transmission line switches to low level by high level, protect
The level for holding the output end of the trigger remains low level.
S200, processor read the level of the USB data transmission pin switching output, and real-time perfoming data are transmitted.
Wherein, the step S200 is specifically included:
S201, processor read the level of the pin of the USB transmission line;
Whether S202, to judge the pin at this time be high level, if in current USB transmission line being then the second logical value, otherwise when
It is the first logical value in preceding USB transmission line;
S203, processor obtain the data of the USB transmission line transmitting.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer
In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein,
To any reference of memory, storage, database or other media used in each embodiment provided herein,
Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM
(PROM), electrically programmable ROM(EPROM), electrically erasable ROM(EEPROM) or flash memory.Volatile memory may include
Random-access memory (ram) or external cache.By way of illustration and not limitation, RAM is available in many forms,
Such as static state RAM(SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing
Type SDRAM(ESDRAM), synchronization link (Synchlink) DRAM(SLDRAM), memory bus (Rambus) direct RAM
(RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
Each technical characteristic of above embodiments can be combined arbitrarily, for simplicity of description, not to above-described embodiment
In each technical characteristic it is all possible combination be all described, as long as however, the combination of these technical characteristics be not present lance
Shield all should be considered as described in this specification.
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously
It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art
It says, without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection of the application
Range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.