Summary of the invention
The technical problem to be solved in the present invention is that in view of the above drawbacks of the prior art, providing a kind of touch screen failure
The method that Shi Qiyong USB debugs port, makes mobile terminal increase new function: having and enables USB tune in touch screen failure
The function of port is tried, is provided convenience for mobile phone debugging maintenance.
The technical proposal for solving the technical problem of the invention is as follows:
The method of USB debugging port is enabled when a kind of touch screen failure, wherein include:
A, detection and judge whether mobile terminal passes through USB data line and connect with computer;
B, when detecting that mobile terminal is connect by USB data line with computer, determine whether mobile terminal touch screen loses
Spirit;
C, when determining touch screen failure, judgement detects within a predetermined time mobile terminal locations variation path and pre-
The path of motion that first setting enables USB debugging port is identical, then controls and enable USB debugging port.
The method of USB debugging port is enabled when the described touch screen failure, wherein before the step A further include:
A0, the path of motion for enabling USB debugging port is preset, debugs port for judging that control enables USB.
The method of USB debugging port is enabled when the described touch screen failure, wherein the step B is specifically included:
B1, start first timer, the first timer when detecting that the mobile terminal is connect with the computer
Pre-set for the first predetermined time;
B2, when detecting that mobile terminal has touch screen input within the first predetermined time, determine that touch screen is normal, and close
Close timer;There is touch screen input when the mobile terminal is not detected within the first predetermined time, determines touch screen failure, and
Off Timer.
The method of USB debugging port is enabled when the described touch screen failure, wherein the step C is specifically included:
C1, when determining touch screen failure, start second timer, it is predetermined that the second timer pre-sets second
Time;
C2, judge, detect that mobile terminal locations change within second scheduled time, Off Timer, and obtain
Obtain mobile terminal locations delta data;
C3, current mobile terminal change in location path is obtained by the mobile terminal locations delta data, described in judgement
Mobile terminal locations variation path with whether preset the path of motion that enables USB debugging port identical, when being, control and open
Port is debugged with USB.
The method of USB debugging port is enabled when the described touch screen failure, wherein the step C2 further include:
C21, when there is no variations for mobile terminal locations within second scheduled time, then Off Timer, determines to enable
USB debugs port operation failure.
The method of USB debugging port is enabled when the described touch screen failure, wherein the step C3 further include:
C31, when mobile terminal locations variation path with preset the path of motion not phase for enabling USB and debugging port
Together, then determine to enable USB debugging port operation failure.
The method of USB debugging port is enabled when the described touch screen failure, wherein first predetermined time is 30 seconds;
Second predetermined time is 10 seconds.
The present invention also provides the mobile terminals that USB debugging port is enabled when a kind of touch screen failure, wherein described mobile whole
End includes acceleration transducer, master controller and touch screen.
The mobile terminal of USB debugging port is enabled when the described touch screen failure, wherein the master controller includes:
Module is preset, for presetting the path of motion for enabling USB debugging port, for judging that control enables
USB debugs port;
Connecting detection judgment module is connect for detecting and judging whether mobile terminal passes through USB data line with computer;
Touch screen failure detection module detects that mobile terminal is logical for connecting and working as with the connecting detection judgment module
When crossing USB data line and being connect with computer, determine mobile terminal touch screen whether failure;
Control module, for when determining touch screen failure, judgement to detect the mobile terminal locations within a predetermined time
Variation path is identical as the enabling USB debugging path of motion of port is preset, then controls and enable USB debugging port.
The mobile terminal of USB debugging port is enabled when the described touch screen failure, wherein the touch screen failure detects mould
Block further include:
First timer start unit, it is fixed for starting first when detecting that the mobile terminal is connect with the computer
When device, the first timer pre-set for the first predetermined time;
Touch screen failure judging unit detects that mobile terminal has touch screen input within the first predetermined time for working as
When, determine that touch screen is normal, and Off Timer;There is touch screen when the mobile terminal is not detected within the first predetermined time
Input determines touch screen failure, and Off Timer.
The mobile terminal of USB debugging port is enabled when the described touch screen failure, wherein the control module further include:
Second timer start unit, for when determining touch screen failure, starting second timer, second timing
Device pre-set for the second predetermined time;
Change in location data capture unit, for judging, detecting mobile terminal locations generation within second scheduled time
Variation, Off Timer, and acquire mobile terminal locations delta data;
Judgement and enabling unit, become for obtaining current mobile terminal position by the mobile terminal locations delta data
Change path, judge mobile terminal locations variation path with preset enable USB debug port path of motion whether phase
Together, when be control enable USB debugging port.
The method and mobile terminal that USB debugging port is enabled when touch screen failure provided by the present invention, due to using pre-
The path of motion for enabling USB debugging port is first set, and by judging touch screen failure, will test the movement of mobile terminal
Path then enables USB debugging port when identical, solves compared with pre-setting the path of motion for enabling USB debugging port
In touch screen failure, the problem of maintenance personal can not enable the debugging port USB, be debugging, analysis of the manufacturer to repairing machine
It provides convenience.
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.
Referring to Figure 1, it enables when Fig. 1 is a kind of touch screen failure of the invention and preferably implements in the method for USB debugging port
The flow chart of example.The method of USB debugging port is enabled when a kind of touch screen failure shown in FIG. 1, comprising:
Step S1, detection and judge whether mobile terminal passes through USB data line and connect with computer;
Step S2, when detecting that mobile terminal is connect by USB data line with computer, determine that mobile terminal touch screen is
No failure;
Step S3, when determining touch screen failure, judgement detects that mobile terminal locations change road within a predetermined time
Diameter is identical as the enabling USB debugging path of motion of port is preset, then controls and enable USB debugging port.
It is specifically described separately below for above-mentioned steps:
Step S1 is to be attached mobile terminal and computer by USB data line, mobile terminal in the embodiment of the present invention
Take the mobile phone as an example and be illustrated, and detect judge mobile phone by USB data line whether with computer successful connection, when detection is sold
Machine and computer successful connection, into next step S2.
Further, the mobile terminal presets acceleration transducer or position sensor, mobile eventually with detection
The change in location path at end;It in the present invention, can be with installation settings acceleration transducer, to detect the acceleration of mobile phone in mobile phone
Variation, as shown in Fig. 2, being enabled when Fig. 2 is a kind of touch screen failure of the invention in the preferred embodiment of the method for USB debugging port
The coordinate frame schematic diagram of acceleration transducer detection acceleration information;By defining three-dimensional system of coordinate by acceleration transducer
It indicates the spatial position where mobile terminal, when mobile terminal locations variation, can be acquired by acceleration transducer
Acceleration information includes the variable in tri- directions X, Y, Z, to indicate the change in location data of mobile phone.
Further, six kinds of location status are defined in the three-dimensional system of coordinate for indicating mobile terminal spatial position;Such as
Shown in Fig. 3, Fig. 3 is six kinds that mobile terminal is defined in a kind of preferred embodiment of the operation processing method of mobile terminal of the present invention
Location status schematic diagram;Using the central point O of mobile terminal as origin, using gravity direction as reference direction, A, B, C, D, E, F are defined
Six kinds of location status, the coordinate data of six kinds of location status are as follows:
Position A:z=0, y=- g, z=0;That is A(0 ,-g, 0);
Position B:x=g, y=0, z=0;That is B(g, 0,0);
Position C:x=0, y=g, z=0;That is C(0, g, 0);
Position D:x=- g, y=0, z=0;That is D(-g, 0,0);
Position E, screen upward: x=0, y=0, z=- g;That is E(0,0 ,-g);
Position F, screen downward: x=0, y=0, z=g;That is F(0,0, g).
Wherein, g=9.8m/s2.Certainly, user can define other midpoints of mobile terminal as former according to actual needs
Point can also define other position coordinates states in the three-dimensional system of coordinate for indicating mobile terminal spatial position.
Further, the path of motion for enabling USB debugging port is preset in the mobile terminal, for judging control
System enables USB and debugs port.Specifically, the path of motion for enabling USB debugging port is set in mobile phone in advance, to compare
Judge whether that the USB for enabling mobile phone debugs port.In the embodiment of the present invention, it can be preset in mobile phone one or more of
The path of motion as composed by above-mentioned six kinds of location status, citing are got on very well, such as by the change in location of mobile terminal by position A in place
Set C(and be denoted as A- > C) it is set in advance as the path of motion for enabling USB debugging port, i.e., when the change in location road of mobile terminal
Diameter is identical as above-mentioned pre-set path of motion, then mobile terminal enables USB debugging port automatically.In the embodiment of the present invention
In, setting A- > C is to preset the path of motion for enabling USB debugging port.
Further, when mobile terminal locations change, if six kinds of positions defined above are passed through in mobile terminal locations variation
State is set, then acquires the acceleration coordinate data of six kinds of location status from acceleration transducer, and is being obtained
In the acceleration coordinate data of the six kinds of location status obtained retain first acceleration coordinate data and last
A acceleration coordinate data judges the change in location path of this mobile terminal according to the two acceleration coordinate datas.Citing
Illustrate, a series of acceleration that front and back is sorted in chronological order when mobile phone location variation are such as had recorded by acceleration transducer
Coordinate data is as follows:
(0.9g ,-g, 0.5g);(0.88g, g, 0.33g);(0 ,-g, 0);(0 ,-g, 0);(0.7g, 0,0.3g);(0.2g,
0.7g ,-g);(0, g, 0);(0, g, 0);(0, g, 0);(0.1g, 0.7g, -0.3g);(0.2g, 0.9g, -0.4g).
From mobile phone by acquired from acceleration transducer by six kinds of location status defined above acceleration seat
Data are marked, further, front and back is sorted in chronological order by the acceleration coordinate data of acquisition: A(0 ,-g, 0);A(0 ,-g, 0);
C(0, g, 0);C(0, g, 0);C(0, g, 0).
Retain first acceleration number of coordinates from the acceleration coordinate data of the six kinds of location status acquired
According to and the last one acceleration coordinate data, i.e., reservation A(0 ,-g, 0);C(0, g, 0) the two data, and according to the two
Data judge that the path of this mobile phone location variation is to be denoted as A- > C to position C(by position A).
Step S2 is to determine mobile terminal touch screen when detecting that mobile terminal is connect by USB data line with computer
Whether failure.Specially when detecting that mobile phone is connect with computer by USB data line, determine whether mobile terminal touch screen loses
Spirit.
It is possible to further preset first timer in the terminal, and by the time-out time of first timer
It was set as the first predetermined time, starts first timer when detecting that the mobile terminal is connect with the computer, work as detection
To when mobile terminal has touch screen input within the first predetermined time, judgement touch screen is normal, and Off Timer;When first
The mobile terminal is not detected in predetermined time touch screen input, determines touch screen failure, and Off Timer.Specifically
A timer to be arranged in mobile phone, the time-out time that the timer is arranged is 30 seconds, is detected after mobile phone is connect with computer
When having operation input on touch screen in 30 seconds, then mobile phone determines touch screen normal use automatically, simultaneously closes off timer;When at this
Any touch screen operation input is not detected in 30 seconds, then mobile phone determines touch screen operation failure.
Step S3, when determining touch screen failure, judgement detects that mobile terminal locations change road within a predetermined time
Diameter is identical as the enabling USB debugging path of motion of port is preset, then controls and enable USB debugging port.Specifically, in mobile phone
When determining touch screen failure, judgement, the detection mobile terminal locations within a predetermined time, which change path and preset, enables USB
Whether the path of motion for debugging port is identical, and taking the predetermined time in embodiments of the present invention is 10 seconds, i.e., mobile phone determines to touch
Shield failure after 10 seconds in, by acceleration transducer detect mobile phone change in location path, if acceleration transducer this 10
Detection judges that mobile phone location variation path is identical as enabling USB debugging path of motion A- > C of port is preset in second, then
Mobile phone control enables USB and debugs port.Further, after the mobile terminal, which controls, enables the debugging port USB, then can lead to
USB data line transmission is crossed, command adapted thereto is inputted in computer and carries out debugging, analysis etc. based on order line to the mobile terminal
Operation.
It is possible to further which second timer, and surpassing second timer can be being preset in the terminal
When the time be set as the second predetermined time;When determining touch screen failure, starts second timer, judge, detect second
Mobile terminal locations change in predetermined time, Off Timer, and acquire mobile terminal locations delta data;Pass through
The mobile terminal locations delta data obtains current mobile terminal change in location path, judges the mobile terminal locations variation
Path and preset enable USB debugging port path of motion it is whether identical, when be control enable USB debugging port.
Specifically, taking the time-out time of second timer in embodiments of the present invention is 10 seconds, that is, the second pre- timing is set
Between be 10 seconds, when mobile phone determine touch screen failure after 10 seconds in, if detecting the position of mobile phone by acceleration transducer
It changes, then closes second timer, and acquire mobile phone location delta data, it is such as a series of since mobile phone location changes
Obtained acceleration coordinate data: (0.9g ,-g, 0.5g);(0.88g, g, 0.33g);(0 ,-g, 0);(0 ,-g, 0);(0.7g,
0,0.3g);(0.2g, 0.7g ,-g);(0, g, 0);(0, g, 0);(0, g, 0);(0.1g, 0.7g, -0.3g);(0.2g, 0.9g ,-
0.4g).Then, the acceleration coordinate data that six by definition kinds of location status are acquired from acceleration transducer (is pressed
Sequence before and after time sequencing): A(0 ,-g, 0);A(0 ,-g, 0);C(0, g, 0);C(0, g, 0);C(0, g, 0).Mobile phone is from obtaining
Retain first acceleration coordinate data into the acceleration coordinate data of six kinds of location status of definition and the last one adds
Speed coordinate data, i.e. reservation A(0 ,-g, 0);C(0, g, 0) the two data, and this hand is judged according to the two data
The path of machine change in location is by position A to be denoted as A- > C to position C(), then judge the path of this mobile phone location variation in advance
Path of motion A- > C that first setting enables USB debugging port is identical, then mobile phone control enables USB and debugs port.
Further, when there is no variations for mobile terminal locations within second scheduled time, then Off Timer, determines
Enable USB debugging port operation failure.Specifically, when in 10 seconds after mobile phone determines touch screen failure, if passing through acceleration
The position that mobile phone is not detected in sensor changes, then the second timer is automatically closed in mobile phone, and determines this time to enable
USB debugs port operation failure.
Further, when mobile terminal locations variation path and the movement road for presetting enabling USB debugging port
Diameter is not identical, then determines to enable USB debugging port operation failure.Specifically, if mobile phone determine touch screen failure after 10 seconds in,
It detects that the position of mobile phone changes by acceleration transducer, and acquires mobile phone location delta data, it is such as a series of
The acceleration coordinate data changed due to mobile phone location are as follows: (0.9g ,-g, 0.5g);(0.88g, g, 0.33g);(0.7g,
0,0.3g);(0.2g, 0.7g ,-g);(0, g, 0);(0, g, 0);(0, g, 0);(0.1g, 0.7g, -0.3g);(0.2g, 0.9g ,-
0.4g) or (0.9g ,-g, 0.5g);(0.88g, g, 0.33g);(0.7g, 0,0.3g);(0.2g, 0.7g ,-g);(0.1g,
0.7g, -0.3g);(0.2g, 0.9g, -0.4g) does not have from the acceleration coordinate data acquired in acceleration transducer
The acceleration coordinate data for having six kinds of location status by definition namely the mobile variation of mobile phone location are without six by definition
Kind location status;Or only one passes through the six of definition from the acceleration coordinate data acquired in acceleration transducer
One in six kinds of location status of the mobile variation of acceleration coordinate data namely mobile phone location of kind location status by definition
Kind, change path without forming position;Then mobile phone also determines this time to enable USB debugging port operation failure.
The present invention also provides when a kind of touch screen failure enable USB debugging port method concrete application embodiment,
The stream of the concrete application embodiment of the method for USB debugging port is enabled when with reference to Fig. 4, Fig. 4 being a kind of touch screen failure of the invention
Cheng Tu, as shown in figure 4, the processing method of concrete application embodiment of the present invention includes:
Step S40, mobile terminal and computer are connected by USB data line, and enters next step S41;
Step S41, whether detection mobile terminal connect normally with computer, when being to enter step S42, walks when otherwise entering
Rapid S411;
Step S411, determine to enable USB debugging port operation failure;
Step S42, start first timer, first timer presets 30 seconds the first predetermined times;
Step S43, whether judgement, detection have touch screen input (in i.e. 30 seconds) within the first predetermined time, if then into
Enter step S44, if otherwise entering step S431;
Step S431, determine touch screen normal use, close first timer;
Step S44, judge mobile terminal touch screen failure, close first timer;
Step S45, start second timer, second timer presets 10 seconds the second predetermined times;;
Step S46, judgement, detection whether mobile terminal locations change (in i.e. 10 seconds) within second scheduled time,
If then entering step S47, if otherwise entering step S461;
Step S461, second timer is closed, determines to enable USB debugging port operation failure;
Step S47, second timer is closed, mobile terminal locations delta data is acquired;
Step S48, change in location path is acquired according to mobile terminal locations delta data, and enters next step
S49;
Step S49, the obtained change in location path of judgement with preset enable USB debugging port path of motion whether
It is identical, if then entering step S50, if otherwise entering step S491;
Step S491, determine to enable USB debugging port operation failure;
Step S50, mobile terminal enables USB debugging port automatically.
Based on above method embodiment, the present invention also provides a kind of mobile terminals, as shown in figure 5, Fig. 5 is the present invention one
The structural schematic diagram of the mobile terminal of USB debugging port is enabled when kind touch screen failure, the mobile terminal includes that acceleration passes
Sensor 600, master controller 610 and touch screen 620.
The master controller 610 includes:
Module 6100 is preset, for presetting the path of motion for enabling USB debugging port, for judging that control is opened
Port is debugged with USB;As detailed above.
Connecting detection judgment module 6101, for detecting and judging whether mobile terminal passes through USB data line and computer connects
It connects;As detailed above.
Touch screen failure detection module 6102 detects mobile terminal for connecting and working as with the connecting detection judgment module
When being connect by USB data line with computer, determine mobile terminal touch screen whether failure;As detailed above.
Control module 6103, for when determining touch screen failure, judgement to detect the mobile terminal within a predetermined time
Change in location path is identical as the enabling USB debugging path of motion of port is preset, then controls and enable USB debugging port;Tool
Body is as described above.
The touch screen failure detection module 6102 further include:
First timer start unit, it is fixed for starting first when detecting that the mobile terminal is connect with the computer
When device, the first timer pre-set for the first predetermined time;As detailed above.
Touch screen failure judging unit detects that mobile terminal has touch screen input within the first predetermined time for working as
When, determine that touch screen is normal, and Off Timer;There is touch screen when the mobile terminal is not detected within the first predetermined time
Input determines touch screen failure, and Off Timer;As detailed above.
The control module 6103 further include:
Second timer start unit, for when determining touch screen failure, starting second timer, second timing
Device pre-set for the second predetermined time;As detailed above.
Change in location data capture unit, for judging, detecting mobile terminal locations generation within second scheduled time
Variation, Off Timer, and acquire mobile terminal locations delta data;As detailed above.
Judgement and enabling unit, become for obtaining current mobile terminal position by the mobile terminal locations delta data
Change path, judge mobile terminal locations variation path with preset enable USB debug port path of motion whether phase
Together, when be control enable USB debugging port;As detailed above.
In addition, the first predetermined time of the first timer setting is 30 seconds;The second of the second timer setting
Predetermined time is 10 seconds.
In conclusion the method for enabling USB debugging port when a kind of touch screen failure provided by the present invention and movement are eventually
End presets the path of motion for enabling USB debugging port due to using, and by judging touch screen failure, will test shifting
The movement routine of dynamic terminal then enables USB tune compared with pre-setting the path of motion for enabling USB debugging port when identical
Port is tried, is solved in touch screen failure, maintenance personal can not enable the problem of USB debugs port, be manufacturer to repairing machine
Debugging, analysis provide convenience.
It should be understood that the application of the present invention is not limited to the above for those of ordinary skills can
With improvement or transformation based on the above description, all these modifications and variations all should belong to the guarantor of appended claims of the present invention
Protect range.