CN108009059A - The USB function detecting methods and system of a kind of router - Google Patents
The USB function detecting methods and system of a kind of router Download PDFInfo
- Publication number
- CN108009059A CN108009059A CN201711202614.8A CN201711202614A CN108009059A CN 108009059 A CN108009059 A CN 108009059A CN 201711202614 A CN201711202614 A CN 201711202614A CN 108009059 A CN108009059 A CN 108009059A
- Authority
- CN
- China
- Prior art keywords
- usb
- mode
- router
- usb mode
- interface
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2205—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
- G06F11/221—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test buses, lines or interfaces, e.g. stuck-at or open line faults
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The present invention provides the USB function detecting methods and system of a kind of router, its method includes step:USB interface is switched to the second USB mode by S100 from the first USB mode;The USB interface includes the function of first USB mode and the second USB mode;USB device is accessed the USB interface by S200;S300 judges whether the device type of the USB device of access matches with second USB mode;If so, enter step S400;S400 outputs second USB mode is normal, and USB handoff functionalities are normal.The automatic switching for carrying out USB mode of the invention, quickly, accurately detects the USB mode and USB handoff functionalities of router.
Description
Technical field
The present invention relates to router testing field, the USB function detecting methods and system of espespecially a kind of router.
Background technology
Double-frequency wireless router, refers to the wireless router worked at the same time in 2.4GHz and 5.0GHz frequency ranges, compared to single-frequency
Section wireless router, it has the wireless transmission rate of higher, possesses stronger anti-interference, wireless signal is stronger, stability
Higher, it is not easy to go offline.Double-frequency wireless router has become the mainstream development trend of wireless router product.
Intelligent router not only has the route and function of surfing the Net of conventional router, also has USB store functions, often integrates
USB3.0 interfaces.Due to USB3.0 when in use, can be caused in the noise of 2.4G frequency ranges increase about 20dB to 2.4GHz ISM frequencies
The radio frequency interference of section.Thus router needs to have the function of in USB2.0 patterns and USB3.0 pattern switchings.
And USB2.0 patterns, USB3.0 patterns to router, and the detection of USB mode switching is very necessary.
The test of existing USB interface is the artificial switching for carrying out USB mode, can not the handoff functionality of test router whether be normal.
The content of the invention
The object of the present invention is to provide the USB function detecting methods and system of a kind of router, realize fast automatic progress
The switching of USB mode, quickly, accurately detects the USB mode and USB handoff functionalities of router.
Technical solution provided by the invention is as follows:
The present invention provides a kind of USB function detecting methods of router, applied to router, including step:S100 is by USB
Interface is switched to the second USB mode from the first USB mode;The USB interface includes first USB mode and the 2nd USB moulds
The function of formula;USB device is accessed the USB interface by S200;S300 judge access USB device device type whether with institute
State the matching of the second USB mode;If so, enter step S400;S400 outputs second USB mode is normal, and USB handoff functionalities
Normally.
Further, the step S100 includes step:S101 operation control script files, switch the first USB moulds
Formula is second USB mode;Wherein, the control script file includes USB3.0 driving scripts or register value configuration foot
This.
Further, step is further included before the step S200:S110 closes first USB mode, and by described in
USB interface is configured to second USB mode.
Further, the S110 includes step:S111 adjusts the tranmitting frequency of router;After S112 obtains the adjusting
The wireless signal strength of tranmitting frequency;It is corresponding that S113 judges whether the wireless signal strength meets second USB mode
Wireless signal strength scope;If so, perform step S114;S114 closes first USB mode, and the USB interface is matched somebody with somebody
It is set to second USB mode.
Further, the S300 includes step:S310 reads field information;The field information include device type and
USB mode information;S320 compare the field information whether the preset field information matches with second USB mode;If so,
Enter step S400;Otherwise, S330 is entered step;S330 exports test crash, and return to step S200.
The present invention also provides a kind of USB function detecting systems of router, including:Several routers and USB device;Institute
Stating router includes:Control module, AM access module, judgment module and processing module;The judgment module respectively with the control
Module, the AM access module are connected with the processing module;Control module, second is switched to by USB interface from the first USB mode
USB mode;The USB interface includes the function of first USB mode and the second USB mode;AM access module, by USB device
Access the USB interface;Judgment module, judge access USB device device type whether with second USB mode
Match somebody with somebody;Processing module, when judging that the device type of USB device of access is matched with second USB mode, output described second
USB mode is normal, and USB handoff functionalities are normal.
Further, the control module includes:Run switch unit, operation control script file, switching described first
USB mode is second USB mode;Wherein, the control script file includes USB3.0 driving scripts or register value is matched somebody with somebody
Put script.
Further, the control module further includes:Switch unit is closed, closes first USB mode, and by described in
USB interface is configured to second USB mode.
Further, the closing switch unit includes:Regulator unit, adjusts the tranmitting frequency of router;Obtain son
Unit, obtains the wireless signal strength of tranmitting frequency after the adjusting;Whether judgment sub-unit, judge the wireless signal strength
Meet the corresponding wireless signal strength scope of second USB mode;If so, perform step S114;Switching subelement, closes institute
The first USB mode is stated, and the USB interface is configured to second USB mode.
Further, the judgment module includes:Reading unit, reads field information;The field information includes equipment
Type and USB mode information;Comparing unit, compares whether the field information is believed with the preset field of second USB mode
Breath matching;The control module, when the comparing unit compares the preset field of the field information and second USB mode
During information matches, output second USB mode is normal, and USB handoff functionalities are normal;The control module, when the comparison
When the preset field information that unit compares the field information and second USB mode mismatches, test crash is exported, and control
Make the AM access module and USB device is accessed into the USB interface again.
By the USB function detecting methods and system of a kind of router provided by the invention, following at least one can be brought
Kind beneficial effect:
1) USB interface of the invention has the function of two kinds of USB modes, by directly by the first USB mode of USB
It is switched to the second USB mode, it is not necessary to manually carry out the switching of USB mode, frequently manually plug carries out USB due to reducing
Pattern switching, therefore can will quickly, accurately detect whether the USB mode of router is normal, moreover it is possible to detect to route
Whether the USB handoff functionalities of device are normal, lift the detection efficiency of the USB functions of router.
2) present invention controls script file by running, by controlling the USB3.0 in script file to drive script or deposit
Device value configuration script automatically switches the USB mode of USB interface, directly judges USB mode and the USB of insertion after switching
Whether the device type of equipment matches, and it is normal, and road that the USB mode after switching can be directly judged if matching
It is also normal by the USB handoff functionalities of device, it is not necessary to which after carrying out read operation to USB device, speed when comparing read operation is
It is no after standard speed scope, could judge USB device device type whether with corresponding USB mode match.It is not required to very important person
Work carry out USB mode switching, due to reduce frequently manually plug carry out USB mode switching, can quickly,
Accurately detect whether the USB mode of router is normal, moreover it is possible to detect whether the USB handoff functionalities of router are normal, carry
Rise the detection efficiency of the USB functions of router.
3) present invention carries out the USB mode of automatic switchover USB interface by adjusting the tranmitting frequency of router, directly judges
Whether the device type of USB device of the USB mode with being inserted into after switching matches, and can directly judge to switch if matching
USB mode afterwards is normal, and the USB handoff functionalities of router are also normal, it is not necessary to carries out reading behaviour to USB device
After work, speed when comparing read operation whether after standard speed scope, could judge USB device device type whether with it is right
The USB mode matching answered.The present invention carries out information exchange by mobile terminal and router, and adjusts transmission power and switch over
The USB mode of USB interface, due to the display that mobile terminal carries, can more intuitively, the use of the analog subscriber of image
Scene carries out the USB functions of the USB interface of test router so that test more comprehensively, it is reliable.
4) present invention can directly by read field information judge the device type of USB device whether with it is corresponding
USB mode matches, and reduces manual identified, so as to reduce the cost of manual identified, since identification is performed fully automatic, can lift knowledge
Other efficiency, so as to lift the efficiency of USB Function detections.
5) present invention due to closing a kind of USB mode in advance so that in another USB mode of test router, energy
It is enough to reduce test interference, accelerate testing efficiency, lift accuracy and the confidence level of test.
Brief description of the drawings
Below by a manner of clearly understandable, preferred embodiment is described with reference to the drawings, to a kind of USB functions of router
Above-mentioned characteristic, technical characteristic, advantage and its implementation of detection method and system are further described.
Fig. 1 is a kind of flow chart of one embodiment of the USB function detecting methods of router of the present invention;
Fig. 2 is a kind of flow chart of another embodiment of the USB function detecting methods of router of the present invention;
Fig. 3 is a kind of flow chart of another embodiment of the USB function detecting methods of router of the present invention;
Fig. 4 is a kind of flow chart of another embodiment of the USB function detecting methods of router of the present invention;
Fig. 5 is a kind of structure diagram of one embodiment of the USB function detecting systems of router of the present invention;
Fig. 6 is a kind of structure diagram of one embodiment of the USB function detecting methods of router of the present invention;
Fig. 7 is a kind of flow chart of one embodiment of the USB function detecting methods of router of the present invention;
Fig. 8 is a kind of flow chart of one embodiment of the USB function detecting methods of router of the present invention.
Embodiment
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, control is illustrated below
The embodiment of the present invention.It should be evident that drawings in the following description are only some embodiments of the present invention, for
For those of ordinary skill in the art, without creative efforts, other can also be obtained according to these attached drawings
Attached drawing, and obtain other embodiments.
To make simplified form, part related to the present invention is only schematically show in each figure, they are not represented
Its practical structures as product.In addition, so that simplified form readily appreciates, there is identical structure or function in some figures
Component, only symbolically depicts one of those, or has only marked one of those.Herein, "one" is not only represented
" only this ", can also represent the situation of " more than one ".
A kind of one embodiment of the USB function detecting methods of router of the present invention, as shown in Figure 1, including:
USB interface is switched to the second USB mode by S100 from the first USB mode;The USB interface includes described first
The function of USB mode and the second USB mode;
USB device is accessed the USB interface by S200;
S300 judges whether the device type of the USB device of access matches with second USB mode;If so, enter step
Rapid S400;
S400 outputs second USB mode is normal, and USB handoff functionalities are normal.
Specifically, in the present embodiment, USB device includes two kinds of models, corresponding to the first of the first USB mode when distinguishing
USB type number and USB type No. the second corresponding to the second USB mode.When the first USB mode is USB2.0 patterns, the second USB mode
When being USB3.0 patterns, by the USB interface of router it is USB3.0 patterns from USB2.0 pattern switchings by the present invention, that is, route
The operating mode of the USB interface of device at this time is USB3.0 patterns, then any USB device is linked into USB interface, road
The device type that the USB device of access is read by device itself is USB3.0 models corresponding with USB3.0 patterns, if so,
Illustrate that the USB interface of router is normal in the working status of USB3.0 patterns, and because USB interface from USB2.0 pattern switchings
It is working properly after to USB3.0 patterns, then the handoff functionality of router is also normal.Conversely, when the first USB mode is USB3.0
Pattern, when the second USB mode is USB2.0 patterns, is from USB3.0 pattern switchings by the USB interface of router by the present invention
The operating mode of the USB interface of USB2.0 patterns, i.e. router at this time is USB2.0 patterns, then by any USB device
It is linked into USB interface, the device type that router itself reads the USB device of access is corresponding with USB2.0 patterns
USB2.0 models, if so, the USB interface of explanation router is normal in the working status of USB2.0 patterns, and because USB connects
It is working properly after mouthful from USB3.0 pattern switchings to USB2.0 patterns, then the handoff functionality of router is also normal.
The present invention is not required user to the prior art like that when detecting USB2.0 interfaces, by the USB of model USB2.0
Equipment (USB flash disk of such as USB2.0) is inserted on USB20. interfaces, after the test of USB2.0 interfaces is completed, is connect in test USB3.0
During mouth, then the USB device (USB flash disk of such as USB3.0) of model USB3.0 is inserted on USB3.0 interfaces, so repeatedly, frequently
Carry out plug test, not only due to the artificial plug test increase testing time, reduce testing efficiency, also result in USB and set
Standby plug loss, also results in the plug loss of the USB interface of router, improves testing cost.Unlike the prior art
, the present invention is due to work(of the USB interface with the first USB mode and second two kinds of USB modes of USB mode of router
Can, directly the USB mode of the USB of router can be switched over by control chip, avoid test router
During USB functions, manually plug detection is carried out to the USB interface of different USB modes, reduces and is led because of frequent manually plug
The loose contact of cause, excessive wear, and the test error because of the influence of the factors such as loose contact;It is frequent additionally, due to being not required
Manually plugged, realize Automatic Control, save human resources, lifted testing efficiency, reduce testing cost.
A kind of another embodiment of the USB function detecting methods of router of the present invention, the present embodiment is a upper embodiment
Preferred embodiment, as shown in Fig. 2, including:
S101 operation control script files, it is second USB mode to switch first USB mode;
Wherein, the control script file includes USB3.0 driving scripts or register value configuration script.
Specifically, in the present embodiment, it is to control foot by running that router, which switches the first USB mode and the second USB mode,
What this document was realized.Exemplary, have by way of running control script file and switching over following two:
1st, script is driven to realize by the USB3.0 in loading or Unloading Control script file, that is, the control foot run
This document includes USB3.0 driving scripts.
If the 1.1, the first USB mode is USB2.0 patterns, the second USB mode is USB3.0 patterns:
So, router controls script by running, and loading USB3.0 driving scripts, then the USB interface of router can be from
First USB mode is switched to the second USB mode, i.e., from USB2.0 pattern switchings to USB3.0 patterns, router is operated at this time
USB3.0 patterns.
If the 1.2, the first USB mode is USB3.0 patterns, the second USB mode is USB2.0 patterns:
So, router controls script by running, and unloading USB3.0 driving scripts, then the USB interface of router can be from
First USB mode is switched to the second USB mode, i.e., from USB3.0 pattern switchings to USB2.0 patterns, router is operated at this time
USB2.0 patterns.
2nd, realized according to the register value of the USB control registers of register value configuration script configuration router chip,
The control script file run includes register value configuration script.
If the 2.1, the first USB mode is USB2.0 patterns, the second USB mode is USB3.0 patterns:
So, router controls script by running, and change USB control registers are corresponding to default USB2.0 patterns
3.0 register values, then the USB interface of router can be switched to the second USB mode from the first USB mode, i.e., from USB2.0 patterns
USB3.0 patterns are switched to, router is operated in USB3.0 patterns at this time.
If the 2.2, the first USB mode is USB3.0 patterns, the second USB mode is USB2.0 patterns:
So, router controls script by running, and change USB control registers are corresponding to default USB2.0 patterns
2.0 register values, then the USB interface of router can be from USB3.0 pattern switchings to USB2.0 patterns, and router is operated at this time
USB2.0 patterns.
In conclusion the present invention controls script file by running, by controlling the USB3.0 in script file to drive foot
This or register value configuration script to realize automation, the switching of the intelligentized USB mode for carrying out USB interface, by straight
Connect and the first USB mode of USB is switched to the second USB mode, it is not necessary to the switching of USB mode is manually carried out, due to reducing
Frequently manually plug carries out USB mode switching, therefore is by the USB mode that can quickly, accurately detect router
It is no normal, moreover it is possible to detect whether the USB handoff functionalities of router are normal, lift the detection efficiency of the USB functions of router.
USB device is accessed the USB interface by S200;
S310 reads field information;The field information includes device type and USB mode information;
S320 compare the field information whether the preset field information matches with second USB mode;If so, into
Step S400;Otherwise, S330 is entered step;
S330 exports test crash, and return to step S200;
S400 outputs second USB mode is normal, and USB handoff functionalities are normal.
Specifically, in the present embodiment, USB device (such as USB flash disk, card reader have the function of the equipment of USB) is accessed into road
After device, the system on router can be by accessing the associated documents of USB device, so as to read field information.Pass through word
Device type and USB mode information in segment information come compare whether with the preset field information under corresponding second USB mode
Matching, illustrates that the second USB mode of router is normal if matching, and the handoff functionality of USB is also normal.Instead
The second USB mode of router normally whether test is failure, the reason for failure, has a variety of, it may be possible to which router is the
Under two USB modes, the device type of the USB device of access is not consistent with the second USB mode;It is probably the 2nd USB of router
Pattern is abnormal;Be also likely to be router under the second USB mode, the second USB mode of router is abnormal, and is connect
The device type of the USB device entered is not consistent with the second USB mode.
Exemplary, illustrate below by USB device of USB flash disk, after USB flash disk couple in router, the system on router can
To read the USB mode of the device type of USB flash disk and current router.Linux system can be by reading "/sys/kernel/
Debug/usb/devices " files understand the information of equipment.After USB flash disk access, "/sys/kernel/debug/usb/
Devices " files include Ver fields, and Ver fields include the device type of USB flash disk and the USB mode of current router.Such as
Fruit Ver=2.00 represents that USB flash disk is the USB flash disk of USB2.0, and the USB mode of current router is operated under USB2.0 patterns.If
Ver=2.10 represents that USB flash disk is the USB flash disk of USB2.0, but the USB mode of current router is operated under USB3.0 patterns.If
Ver=2.90 represents that USB flash disk is the USB flash disk of USB3.0, but the USB mode of current router is operated under USB2.0 patterns.If
Ver=3.00 represents that USB flash disk is the USB flash disk of USB3.0, and the USB mode of current router is operated under USB3.0 patterns.
A kind of another embodiment of the USB function detecting methods of router of the present invention, as shown in figure 3, including:
S110 closes first USB mode, and the USB interface is configured to second USB mode;
USB device is accessed the USB interface by S200;
S300 judges whether the USB device of access is identified as corresponding to the device type of second USB mode;If so,
Enter step S400;
S400 outputs second USB mode is normal, and USB handoff functionalities are normal.
Specifically, in the present embodiment, unlike the embodiments above, the present embodiment is to be closed the first USB mode
After closing, USB interface is just configured to the second USB mode, so since the first USB mode is closed, the first USB functions cannot make
With during easy to which USB interface being configured to the second USB mode, insertion and the 2nd USB are only carried out on the USB interface of router
During the USB device of the corresponding device type of pattern, the device type for the USB device that ability is quick, judgement at once is accessed
Whether matched with second USB mode.Exemplary, when the first USB mode is USB3.0 patterns, the second USB mode is
During USB2.0, the USB3.0 patterns of USB interface are closed, and USB interface is configured to USB2.0 patterns, at this moment, USB interface
USB3.0 functions are shielded, it is impossible to used, USB interface only has USB2.0 functions to use, therefore in USB2.0 patterns
Under, when USB device (card reader of such as USB2.0) for only accessing USB2.0, can test and pass through, in the USB of access USB3.0
Test crash during equipment (card reader of such as USB3.0).The present invention due to closing a kind of USB mode in advance so that is route in test
During another USB mode of device, test interference can be reduced, accelerates testing efficiency, lifts accuracy and the confidence level of test.
A kind of another embodiment of the USB function detecting methods of router of the present invention, the present embodiment is above-described embodiment
Preferred embodiment, as shown in figure 4, including:
S111 adjusts the tranmitting frequency of router;
S112 obtains the wireless signal strength of tranmitting frequency after the adjusting;
S113 judges whether the wireless signal strength meets the corresponding wireless signal strength model of second USB mode
Enclose;If so, perform step S114;
S114 closes first USB mode, and the USB interface is configured to second USB mode;
Specifically, in the present embodiment, can be handed over by mobile phone, computer etc. between mobile terminal and router into row information
Mutually, so as to obtain the wireless signal strength of router, if the wireless signal that wireless signal strength meets under the second USB mode is strong
Spend scope, then the first USB mode can be closed, and USB interface is configured to the second USB mode.In the present invention, Yong Huneng
Regulating command to router, router is enough sent by mobile terminal the tranmitting frequency of router is adjusted according to regulating command, because
Bigger for the tranmitting frequency of router, the wireless signal strength of router can be bigger, therefore can be according to the hair for adjusting router
Radio frequency rate realizes the USB mode of the USB interface of switched router.
Exemplary, it is assumed that the first USB mode is USB3.0 patterns, and the second USB mode is USB2.0 patterns, router
Current USB mode is USB2.0 patterns, and the tranmitting frequency of router is in 2.4G, therefore user is sent by mobile terminal and adjusted
Section instruction is 5.0G come the tranmitting frequency for adjusting router, is then transmitted between mobile terminal and router into row information, can
The wireless signal strength that router carries out transmitting radio magnetic wave using tranmitting frequency as 5.0G is measured, so as to judge wireless signal
Whether intensity meets the corresponding wireless signal strength scope of the second USB mode, if be shut off the first USB mode, and by USB
Interface is configured to the second USB mode.
The present invention realizes the switching of automation, the intelligentized USB mode for carrying out USB interface, by directly by USB's
First USB mode is switched to the second USB mode, it is not necessary to the switching of USB mode is manually carried out, due to reducing frequently manually
Plug carries out USB mode switching, therefore can will quickly, accurately detect whether the USB mode of router is normal, moreover it is possible to
Detect whether the USB handoff functionalities of router are normal, lift the detection efficiency of the USB functions of router.Also, energy of the present invention
It is enough more intuitively, the usage scenario of the analog subscriber of image carry out the USB functions of the USB interface of test router, test
More comprehensively, it is reliable.
USB device is accessed the USB interface by S200;
S310 reads field information;The field information includes device type and USB mode information;
S320 compare the field information whether the preset field information matches with second USB mode;If so, into
Step S400;Otherwise, S330 is entered step;
S330 exports test crash, and return to step S200;
S400 outputs second USB mode is normal, and USB handoff functionalities are normal.
Specifically, in the present embodiment, USB device (such as USB flash disk, card reader have the function of the equipment of USB) is accessed into road
After device, the system on router can be by accessing the associated documents of USB device, so as to read field information.Pass through word
Device type and USB mode information in segment information come compare whether with the preset field information under corresponding second USB mode
Matching, illustrates that the second USB mode of router is normal if matching, and the handoff functionality of USB is also normal.Instead
The second USB mode of router normally whether test is failure, the reason for failure, has a variety of, it may be possible to which router is the
Under two USB modes, the device type of the USB device of access is not consistent with the second USB mode;It is probably the 2nd USB of router
Pattern is abnormal;Be also likely to be router under the second USB mode, the second USB mode of router is abnormal, and is connect
The device type of the USB device entered is not consistent with the second USB mode.
Exemplary, illustrate below by USB device of USB flash disk, after USB flash disk couple in router, the system on router can
To read the USB mode of the device type of USB flash disk and current router.Linux system can be by reading "/sys/kernel/
Debug/usb/devices " files understand the information of equipment.After USB flash disk access, "/sys/kernel/debug/usb/
Devices " files include Ver fields, and Ver fields include the device type of USB flash disk and the USB mode of current router.Such as
Fruit Ver=2.00 represents that USB flash disk is the USB flash disk of USB2.0, and the USB mode of current router is operated under USB2.0 patterns.If
Ver=2.10 represents that USB flash disk is the USB flash disk of USB2.0, but the USB mode of current router is operated under USB3.0 patterns.If
Ver=2.90 represents that USB flash disk is the USB flash disk of USB3.0, but the USB mode of current router is operated under USB2.0 patterns.If
Ver=3.00 represents that USB flash disk is the USB flash disk of USB3.0, and the USB mode of current router is operated under USB3.0 patterns.
A kind of one embodiment of the USB function detecting systems of router 100 of the present invention, as shown in figure 5, including:
Several routers 100 and USB device 200;
The router 100 includes:Control module 110, AM access module 120, judgment module 130 and processing module 140;Institute
Judgment module 130 is stated to be connected with the control module 110, the AM access module 120 and the processing module 140 respectively;
Control module 110, the second USB mode is switched to by USB interface from the first USB mode;The USB interface includes institute
State the function of the first USB mode and the second USB mode;
AM access module 120, the USB interface is accessed by USB device 200;
Judgment module 130, judges whether the device type of the USB device 200 of access matches with second USB mode;
Processing module 140, when judging that the device type of USB device 200 of access is matched with second USB mode,
It is normal to export second USB mode, and USB handoff functionalities are normal.
Specifically, in the present embodiment, the present invention is not required user to the prior art like that when detecting USB2.0 interfaces, will
The USB device 200 (USB flash disk of such as USB2.0) of model USB2.0 is inserted on USB20. interfaces, completes USB2.0 interfaces
After test, it is inserted into when testing USB3.0 interfaces, then by the USB device 200 (USB flash disk of such as USB3.0) of model USB3.0
On USB3.0 interfaces, so repeatedly, plug test is frequently carried out, increases the testing time not only due to artificial plug test,
Testing efficiency is reduced, also results in the plug loss of USB device 200, also results in the plug damage of the USB interface of router 100
Consumption, improves testing cost.Unlike the prior art, it is of the invention since the USB interface of router 100 has the first USB
The function of pattern and second two kinds of USB modes of USB mode, can be directly by control chip to the USB's of router 100
USB mode switches over, when avoiding the USB functions of test router 100, to the USB interface of different USB modes
Carry out manually plug to detect, reduction loose contact caused by frequent manually plug, excessive wear, and because of loose contact
The test error influenced etc. factor;Additionally, due to frequently need not manually be plugged, Automatic Control is realized, is saved
Human resources, lift testing efficiency, reduce testing cost.
A kind of another embodiment of the USB function detecting systems of router 100 of the present invention, the present embodiment are a upper implementation
The preferred embodiment of example, other parts are identical with a upper embodiment,
In addition, further include:
The control module 110 includes:
Switch unit is run, operation control script file, it is second USB mode to switch first USB mode;
Wherein, the control script file includes USB3.0 driving scripts or register value configuration script.
Specifically, in the present embodiment, router 100, which switches the first USB mode and the second USB mode, to be controlled by running
What script file was realized.Exemplary, have by way of running control script file and switching over following two:
1st, script is driven to realize by the USB3.0 in loading or Unloading Control script file, that is, the control foot run
This document includes USB3.0 driving scripts.
2nd, the register value of the USB control registers of 100 chip of router is configured according to register value configuration script come real
Existing, that is, the control script file run includes register value configuration script.
The present invention controls script file by running, by controlling the USB3.0 in script file to drive script or register
Value configuration script to realize automation, the switching of the intelligentized USB mode for carrying out USB interface, by directly by the of USB
One USB mode is switched to the second USB mode, it is not necessary to manually carries out the switching of USB mode, is frequently manually pulled out due to reducing
The switching of row USB mode is injected, therefore can will quickly, accurately detect whether the USB mode of router 100 is normal, also
It can detect whether the USB handoff functionalities of router 100 are normal, lift the detection efficiency of the USB functions of router 100.
Preferably, the control module 110 further includes:
Switch unit is closed, closes first USB mode, and the USB interface is configured to the 2nd USB moulds
Formula.
Specifically, the present embodiment is that after the first USB mode is closed, USB interface just is configured to the 2nd USB moulds
Formula, so since the first USB mode is closed, the first USB functions cannot use, easy to which USB interface is configured to the second USB mode
When, only carry out being inserted into the USB device 200 of device type corresponding with the second USB mode on the USB interface of router 100
When, could the device type of USB device 200 that is accessed of quick, judgement at once whether with second USB mode
Match somebody with somebody.It is exemplary, when the first USB mode is USB3.0 patterns, when the second USB mode is USB2.0, close USB interface
USB3.0 patterns, and USB interface is configured to USB2.0 patterns, at this moment, the USB3.0 functions of USB interface are shielded, it is impossible into
Exercise and use, USB interface only has USB2.0 functions to use, therefore under USB2.0 patterns, the USB for only accessing USB2.0 is set
It can test and pass through when standby 200 (card reader of such as USB2.0), in (the Card Reader of such as USB3.0 of USB device 200 of access USB3.0
Device) when test crash.The present invention due to closing a kind of USB mode in advance so that in another USB moulds of test router 100
During formula, test interference can be reduced, accelerates testing efficiency.
Preferably, the closing switch unit includes:
Regulator unit, adjusts the tranmitting frequency of router 100;
Subelement is obtained, obtains the wireless signal strength of tranmitting frequency after the adjusting;
Judgment sub-unit, judges whether the wireless signal strength meets the corresponding wireless signal of second USB mode
Strength range;If so, perform step S114;
Switching subelement, closes first USB mode, and the USB interface is configured to second USB mode.
Specifically, in the present embodiment, can by between the mobile terminals such as mobile phone, computer and router 100 into row information
Interaction, so as to obtain the wireless signal strength of router 100, if wireless signal strength meet it is wireless under the second USB mode
Signal strength range, then the first USB mode can be closed, and USB interface is configured to the second USB mode.In the present invention,
User can be sent regulating command to router 100, router 100 by mobile terminal and adjust router according to regulating command
100 tranmitting frequency, because the tranmitting frequency of router 100 is bigger, the wireless signal strength of router 100 can be bigger, therefore
The USB mode of the USB interface of switched router 100 can be realized according to the tranmitting frequency for adjusting router 100.
The present invention realizes the switching of automation, the intelligentized USB mode for carrying out USB interface, by directly by USB's
First USB mode is switched to the second USB mode, it is not necessary to the switching of USB mode is manually carried out, due to reducing frequently manually
Plug carries out USB mode switching, therefore can will quickly, accurately detect whether the USB mode of router 100 is normal,
It can also detect whether the USB handoff functionalities of router 100 are normal, lift the detection efficiency of the USB functions of router 100.And
And the present invention can more intuitively, the usage scenario of the analog subscriber of image carry out the USB interface of test router 100
USB functions, test more comprehensively, it is reliable.
Preferably, the judgment module 130 includes:
Reading unit, reads field information;The field information includes device type and USB mode information;
Comparing unit, compare the field information whether the preset field information matches with second USB mode;
The control module 110, when the comparing unit compares the default of the field information and second USB mode
When field information matches, output second USB mode is normal, and USB handoff functionalities are normal.
The control module 110, when the comparing unit compares the default of the field information and second USB mode
When field information mismatches, test crash is exported, and it is described to control the AM access module 120 again to access USB device 200
USB interface.
Specifically, in the present embodiment, USB device 200 (such as USB flash disk, card reader have the function of the equipment of USB) is accessed
After router 100, the system on router 100 can be by accessing the associated documents of USB device 200, so as to read field
Information.By the device type in field information and USB mode information come compare whether with it is pre- under corresponding second USB mode
If field information matches, the second USB mode that router 100 is illustrated if matching is normal, and the handoff functionality of USB
It is and normal.The reason for otherwise normally whether test is failure for the second USB mode of router 100, failure have it is a variety of,
Be probably router 100 under the second USB mode, the device type of the USB device 200 of access is not consistent with the second USB mode;
It is probably that the second USB mode of router 100 is abnormal;Be also likely to be router 100 under the second USB mode, router
100 the second USB mode is abnormal, and the device type of the USB device 200 accessed is not consistent with the second USB mode.
An a kind of example of the USB function detecting methods of router of the present invention, including:
The invention mainly comprises two parts:The test of router USB2.0 patterns, the test of router USB3.0 patterns.
As shown in fig. 6, production line test personnel 300 can test the handoff functionality of the USB2.0 and USB3.0 patterns of router 100,
Specially USB2.0U disks 200 are tested under USB2.0 patterns first, it is right under USB3.0 patterns to be subsequently handed to
USB3.0U disks 200 are tested.
As shown in fig. 7, router USB2.0 pattern test flow charts, including step:
S11, router are switched to USB2.0 patterns;
S12, prompting user access USB flash disk;
S13, judge whether USB flash disk is identified as USB2.0 equipment;If so, enter step S14;Otherwise, S15 is entered step;
S14, test pass through;
S15, test crash, and return to step S12.
When producing line starts test router USB interface, USB2.0 patterns are first switched to, then prompt production line test personnel
USB flash disk is accessed, router reads whether the USB flash disk accessed is identified as USB2.0 equipment after tester accesses USB flash disk, if so
Test passes through, and is tested if not so prompting tester to access USB2.0U disks again.
As shown in figure 8, router USB3.0 pattern test flow charts, including step:
S21, router are switched to USB3.0 patterns;
S22, prompting user access USB flash disk;
S23, judge whether USB flash disk is identified as USB3.0 equipment;If so, enter step S24;Otherwise, S25 is entered step;
S24, test pass through;
S25, test crash, and return to step S22.
After testing USB2.0 interfaces, router is switched to USB3.0 patterns, and flow is similar to USB2.0 at this time, carries first
Show that production line test personnel access USB flash disk, router reads whether the USB flash disk accessed is identified as USB3.0 after tester accesses USB flash disk
Equipment, if it is test pass through, and are tested if not then prompting tester to access USB3.0U disks again.
The present embodiment is whether the handoff functionality under illustrating from USB2.0 pattern switchings to USB3.0 patterns is normal, such as
Whether the handoff functionality under fruit wants test from USB2.0 pattern switchings to USB3.0 patterns is normal, can exchange testing sequence,
The testing process of the USB3.0 shown in Fig. 8 is first carried out, then carries out the testing process of the USB7.0 shown in Fig. 7, the present invention can
In the USB functions of the USB interface of the production production line test router of router, i.e. test router USB2.0 patterns, USB3.0
Whether pattern, and router USB mode handoff functionality are normal.
Present invention mainly solves production line test router USB functions, USB functions include USB2.0 patterns or USB3.0 moulds
Formula, and the handoff functionality of router USB.Router is switched to USB2.0 patterns by production line test first, and then pop-up carries
Show frame prompting access USB device, the USB device prompting test of the USB2.0 of tester's access at this time passes through, and accesses USB3.0's
USB device prompts test crash;Subsequent router is switched to USB3.0 patterns, prompts access USB device, tester's access
The USB device test of USB3.0 passes through, and accesses the USB device test crash of USB2.0.The function that the present invention realizes is in producing line
The handoff functionality of test router USB2.0 and USB3.0, the USB device of USB2.0 is accessed under USB2.0 patterns to be tested
By accessing the USB device test crash of USB3.0;The USB device test that USB3.0 is accessed under USB3.0 patterns passes through, and connects
Enter the USB device test crash of USB2.0.
It should be noted that above-described embodiment can be freely combined as needed.The above is only the preferred of the present invention
Embodiment, it is noted that for those skilled in the art, do not departing from the premise of the principle of the invention
Under, some improvements and modifications can also be made, these improvements and modifications also should be regarded as protection scope of the present invention.
Claims (10)
1. the USB function detecting methods of a kind of router, it is characterised in that applied to router, including step:
USB interface is switched to the second USB mode by S100 from the first USB mode;The USB interface includes the first USB moulds
The function of formula and the second USB mode;
USB device is accessed the USB interface by S200;
S300 judges whether the device type of the USB device of access matches with second USB mode;If so, enter step
S400;
S400 outputs second USB mode is normal, and USB handoff functionalities are normal.
2. the USB function detecting methods of router according to claim 1, it is characterised in that the step S100 includes
Step:
S101 operation control script files, it is second USB mode to switch first USB mode;
Wherein, the control script file includes USB3.0 driving scripts or register value configuration script.
3. the USB function detecting methods of router according to claim 1, it is characterised in that before the step S200
Further include step:
S110 closes first USB mode, and the USB interface is configured to second USB mode.
4. the USB function detecting methods of router according to claim 3, it is characterised in that the S110 includes step:
S111 adjusts the tranmitting frequency of router;
S112 obtains the wireless signal strength of tranmitting frequency after the adjusting;
S113 judges whether the wireless signal strength meets the corresponding wireless signal strength scope of second USB mode;If
It is to perform step S114;
S114 closes first USB mode, and the USB interface is configured to second USB mode.
5. according to the USB function detecting methods of claim 1-4 any one of them routers, it is characterised in that the S300
Including step:
S310 reads field information;The field information includes device type and USB mode information;
S320 compare the field information whether the preset field information matches with second USB mode;If so, enter step
S400;Otherwise, S330 is entered step;
S330 exports test crash, and return to step S200.
A kind of 6. USB function detecting systems of router, it is characterised in that including:Several routers and USB device;
The router includes:Control module, AM access module, judgment module and processing module;The judgment module respectively with institute
State control module, the AM access module is connected with the processing module;
Control module, the second USB mode is switched to by USB interface from the first USB mode;The USB interface includes described first
The function of USB mode and the second USB mode;
AM access module, the USB interface is accessed by USB device;
Judgment module, judges whether the device type of the USB device of access matches with second USB mode;
Processing module, when the device type of USB device for judging access is matched with second USB mode, exports described the
Two USB modes are normal, and USB handoff functionalities are normal.
7. the USB function detecting systems of router according to claim 6, it is characterised in that the control module includes:
Switch unit is run, operation control script file, it is second USB mode to switch first USB mode;
Wherein, the control script file includes USB3.0 driving scripts or register value configuration script.
8. the USB function detecting systems of router according to claim 6, it is characterised in that the control module is also wrapped
Include:
Switch unit is closed, closes first USB mode, and the USB interface is configured to second USB mode.
9. the USB function detecting systems of router according to claim 3, it is characterised in that the closing switch unit
Including:
Regulator unit, adjusts the tranmitting frequency of router;
Subelement is obtained, obtains the wireless signal strength of tranmitting frequency after the adjusting;
Judgment sub-unit, judges whether the wireless signal strength meets the corresponding wireless signal strength of second USB mode
Scope;If so, perform step S114;
Switching subelement, closes first USB mode, and the USB interface is configured to second USB mode.
10. according to the USB function detecting systems of claim 6-9 any one of them routers, it is characterised in that the judgement
Module includes:
Reading unit, reads field information;The field information includes device type and USB mode information;
Comparing unit, compare the field information whether the preset field information matches with second USB mode;
The control module, the preset field that the field information and second USB mode are compared when the comparing unit are believed
During breath matching, output second USB mode is normal, and USB handoff functionalities are normal;
The control module, the preset field that the field information and second USB mode are compared when the comparing unit are believed
When breath mismatches, test crash is exported, and control the AM access module that USB device is accessed the USB interface again.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711202614.8A CN108009059A (en) | 2017-11-27 | 2017-11-27 | The USB function detecting methods and system of a kind of router |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711202614.8A CN108009059A (en) | 2017-11-27 | 2017-11-27 | The USB function detecting methods and system of a kind of router |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108009059A true CN108009059A (en) | 2018-05-08 |
Family
ID=62053706
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711202614.8A Withdrawn CN108009059A (en) | 2017-11-27 | 2017-11-27 | The USB function detecting methods and system of a kind of router |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108009059A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108768706A (en) * | 2018-05-16 | 2018-11-06 | 四川斐讯信息技术有限公司 | The mode selecting method of storage device interface and selection system on a kind of router |
CN109743141A (en) * | 2019-02-21 | 2019-05-10 | 维沃移动通信有限公司 | A kind of method of adjustment and terminal device of data transmission |
CN110768732A (en) * | 2018-07-26 | 2020-02-07 | 深圳金中熠科技有限公司 | Method for reducing mutual interference of wireless 2.4GHz signal and USB3.0 signal by router |
CN111711460A (en) * | 2020-06-16 | 2020-09-25 | Oppo广东移动通信有限公司 | USB working mode processing method and device, storage medium and electronic equipment |
-
2017
- 2017-11-27 CN CN201711202614.8A patent/CN108009059A/en not_active Withdrawn
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108768706A (en) * | 2018-05-16 | 2018-11-06 | 四川斐讯信息技术有限公司 | The mode selecting method of storage device interface and selection system on a kind of router |
CN110768732A (en) * | 2018-07-26 | 2020-02-07 | 深圳金中熠科技有限公司 | Method for reducing mutual interference of wireless 2.4GHz signal and USB3.0 signal by router |
CN109743141A (en) * | 2019-02-21 | 2019-05-10 | 维沃移动通信有限公司 | A kind of method of adjustment and terminal device of data transmission |
CN109743141B (en) * | 2019-02-21 | 2021-10-22 | 维沃移动通信有限公司 | Data transmission adjusting method and terminal equipment |
CN111711460A (en) * | 2020-06-16 | 2020-09-25 | Oppo广东移动通信有限公司 | USB working mode processing method and device, storage medium and electronic equipment |
CN111711460B (en) * | 2020-06-16 | 2022-03-22 | Oppo广东移动通信有限公司 | USB working mode processing method and device, storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108009059A (en) | The USB function detecting methods and system of a kind of router | |
CN103376435B (en) | Coil measurement device and Coil Detector method thereof | |
US20090177923A1 (en) | Apparatus and method for test and debug of a processor/core having advanced power management | |
CN101656974A (en) | SIM card compatibility automated test method and device | |
CN104834880B (en) | A kind of card test method and system based on NFC mobile terminal | |
CN105891736A (en) | QC2.0 fast charge detection circuit and detection method | |
CN104811524B (en) | A kind of terminal radio frequency performance test methods and its device | |
CN105911451A (en) | Chip test method and chip test device | |
CN106547668A (en) | Computer system fault alarming method, apparatus and system | |
CN107153158A (en) | A kind of chip performance method of testing, apparatus and system | |
CN105701011A (en) | Debugging method, electronic product applying debugging method and debugging card | |
CN1989698B (en) | Wireless communication terminal and control method thereof | |
CN105743602A (en) | Method and system for preventing radio frequency signal from interfering USB (Universal Serial Bus) data transmission | |
CN101084444A (en) | Pin electronics with high voltage functionality | |
CN109462842B (en) | Automatic control method for downloading and testing Bluetooth SIM card | |
CN105975090A (en) | Event-reporting control method and device for proximity sensor and mobile terminal | |
CN101170324B (en) | Testing system and testing method of near-field communication device | |
CN105445604B (en) | A kind of USB3.1 TYPE c-types cable automatic test approach | |
US20050015692A1 (en) | Adjustable voltage boundary scan adapter for emulation and test | |
CN103546927A (en) | Android terminal and method for switching internal and external Wi-Fi (wireless fidelity) | |
CN106708688A (en) | Module testing method and terminal | |
CN208334533U (en) | A kind of multi-core cable on-off decision maker based on Radio Transmission Technology | |
CN112668349A (en) | Test card reader supporting parameter, instruction and encryption of 7816 and 14443 interfaces | |
CN110459260A (en) | Automatic test switching device, method and system | |
CN102436413A (en) | Debugging system and debugging method of board power supply |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20200819 Address after: No. 2-3167, zone a, Nonggang City, No. 2388, Donghuan Avenue, Hongjia street, Jiaojiang District, Taizhou City, Zhejiang Province Applicant after: Taizhou Jiji Intellectual Property Operation Co.,Ltd. Address before: 201616 Shanghai city Songjiang District Sixian Road No. 3666 Applicant before: Phicomm (Shanghai) Co.,Ltd. |
|
TA01 | Transfer of patent application right | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20180508 |
|
WW01 | Invention patent application withdrawn after publication |