Disclosure of Invention
The invention provides a method and a system for switching a USB working mode of a router, which are used for solving the problem that the corresponding USB working mode can not be switched from a master mode according to a wireless mode of a wireless terminal in the prior art.
The invention discloses a USB working mode switching method of a router, which comprises the following steps:
s100, acquiring a wireless mode of a wireless terminal accessed to a router;
s200, acquiring a target USB working mode corresponding to the wireless terminal according to the wireless mode of the wireless terminal;
s300, acquiring the current USB working mode of the router, judging whether the current USB working mode is consistent with the target USB working mode, and if not, entering the step S400;
s400, switching the current USB operating mode to the target USB operating mode.
Compared with the best technology in the prior art, the invention has the advantages that: automatic switching, the balance of performance and anti-interference is better.
Further, the method also comprises the following steps:
s010 starts the router, and configures the USB working mode of the router according to the configuration information of the preset USB working mode.
Further, the step S200 includes the steps of:
s210, judging whether the acquired wireless modes have a first wireless mode, if so, entering the step
S220, otherwise, entering the step S230;
s220, selecting a first USB working mode of the router as a target USB working mode;
s230 selects the second USB operating mode of the router as a target USB operating mode.
Further, the step S210 includes the steps of:
s211 determines whether there is a first wireless mode in the acquired wireless modes, if yes, step S212 is performed, otherwise step S230 is performed;
s212 collects the signal strength of the wireless terminal in the first wireless mode, and determines whether the signal strength is greater than a predetermined reference signal strength, if so, step S220 is performed, otherwise, step S230 is performed.
Further, the method also comprises the following steps:
s020 obtains the terminal type of the access router, judges whether the terminal of the access router is a wireless terminal or not, and if yes, the next step is carried out.
The invention also provides a system for switching the USB working mode of the router, which comprises: the device comprises an acquisition module, a search module, a judgment module and a switching module, wherein the acquisition module is respectively connected with the search module and the judgment module, and the judgment module is connected with the switching module, wherein: the acquisition module acquires a wireless mode of a wireless terminal accessed to the router; the searching module searches a target USB working mode corresponding to the wireless terminal according to the wireless mode of the wireless terminal; the judging module acquires the current USB working mode of the router through the acquiring module, judges whether the current USB working mode is consistent with the target USB working mode, and switches the current USB working mode to the target USB working mode through the switching module if the current USB working mode is not consistent with the target USB working mode.
Further, the system also comprises a starting module and a configuration module, wherein the configuration module is respectively connected with the starting module and the switching module, and the configuration module comprises: the starting module starts the router, and the configuration module configures the USB working mode of the router according to the configuration information of the preset USB working mode.
Further, the device also comprises a selection module connected with the judgment module; wherein: the judging module judges whether a first wireless mode exists in the wireless modes acquired by the acquiring module, if so, the first USB working mode of the router is selected as a target USB working mode through the selecting module; otherwise, the second USB working mode of the router is selected as the target USB working mode through the selection module.
Further, still include with the collection module that the judge module links to each other, wherein: the judging module judges whether the wireless mode acquired by the acquiring module has a first wireless mode; when the judging module judges that the wireless modes acquired by the acquiring module have a first wireless mode, the acquiring module acquires the signal intensity of the wireless terminal in the first wireless mode, the judging module judges whether the signal intensity is greater than the preset reference signal intensity, if so, the selecting module selects the first USB working mode as a target USB working mode, otherwise, the selecting module selects the second USB working mode as the target USB working mode; when the judging module judges that the wireless mode acquired by the acquiring module does not have a first wireless mode, the selecting module selects the second USB working mode as a target USB working mode.
Further, the first USB operating mode is a USB2.0 operating mode; the second USB working mode is a USB3.0 working mode; the first wireless mode is a 2.4G operating frequency mode.
The USB working mode of the router is automatically switched according to the wireless mode of the wireless terminal accessed into the router, the USB working mode of the router is ensured to be USB2.0 when the wireless terminal uses the 2.4G wireless mode, so that the interference of USB3.0 is avoided, the target USB working mode of the router is obtained by analyzing according to the wireless mode condition of the wireless terminal, and the USB working mode of the router is controlled to be the target USB working mode. Therefore, the current USB working mode can obtain better balance in the aspects of performance and interference resistance.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of a method for switching the USB working mode of a router, as shown in FIG. 1, includes the steps of:
s100, acquiring a wireless mode of a wireless terminal accessed to a router;
s200, acquiring a target USB working mode corresponding to the wireless terminal according to the wireless mode of the wireless terminal;
s300, acquiring a current USB working mode of the router, judging whether the current USB working mode is consistent with the target USB working mode, if so, keeping the current USB working mode unchanged, and if not, entering the step S400;
s400, switching the current USB operating mode to the target USB operating mode.
In the step S100, the wireless mode of the wireless terminal refers to the operating frequency of the wireless terminal, for example, the current wireless mode includes a 2.4G wireless mode and a 5G wireless mode; when the USB working mode of the router is USB3.0, the working frequency of the interface is about 2.5G, which is very close to the working frequency of the wireless mode 2.4G, and the USB will interfere with 2.4G during working. And if the USB operating mode is always in the USB2.0 state, the transmission rate of the wireless terminal with the wireless mode of 5G operating frequency is affected. Therefore, how to control switching between USB3.0 and USB2.0 is technically required in the present invention, the embodiment of the present invention solves this problem by determining a wireless connection mode, so that interference of USB3.0 is avoided when the wireless terminal uses a 2.4G wireless mode. For example, if the wireless mode of the wireless terminal that acquires the access router is 5G, according to the wireless mode of the terminal of 5G, the USB working mode corresponding to the wireless mode can be found to be USB3.0, and then it is seen whether the current USB working mode of the router is USB3.0, if so, the current USB working mode is kept unchanged, and if not, the USB working mode of the router is switched to be USB 3.0.
Of course, before the step S100 in the first embodiment is started, the method further includes the steps of:
s010 starts the router, and configures the USB working mode of the router according to the configuration information of the preset USB working mode.
After the router is started, a default USB working mode is enabled, and this working mode may be preset, for example, a more commonly used USB2.0 working mode is preset as the default working mode of the router, so that after the router is started each time, the router is configured according to the configuration information of the preset USB2.0 working mode, so that the router works in the USB2.0 working mode.
A second embodiment of the present invention, as shown in fig. 2, comprises the steps of:
s100, acquiring a wireless mode of a wireless terminal accessed to a router;
s210, judging whether the acquired wireless mode has a first wireless mode, if so, entering step S220, otherwise, entering step S230;
s220, selecting a first USB working mode of the router as a target USB working mode;
s230, selecting a second USB working mode of the router as a target USB working mode;
s300, acquiring the current USB working mode of the router, judging whether the current USB working mode is consistent with the target USB working mode, and if not, entering the step S400;
s400, switching the current USB operating mode to the target USB operating mode.
Since there may be more than one wireless terminal of the access router, a trade-off problem is required in view of the fact that the USB operation mode most closely matched to each of the plurality of wireless terminals of the access router is not always the same, and the router cannot operate in both operation modes at the same time. The present embodiment makes a judgment based on the wireless mode conditions of all the wireless terminals accessing the router. Specifically, for example, assuming that the first wireless mode is a 2.4G wireless mode, the wireless terminal of the current access router has A, B, C, and the respective corresponding wireless modes are: 2.4G wireless mode (terminal a), 5G wireless mode (terminal B), 5G wireless mode (terminal C); obviously, there is a 2.4G wireless mode as the first wireless mode, so in order not to affect the transmission performance of all terminals, the USB2.0 operating mode is selected as the target USB operating mode, because if the USB3.0 operating mode is selected, interference will be generated on the terminal a, which affects the transmission performance of the terminal a. And only when the wireless terminals accessed into the router are in the 5G wireless mode, the USB3.0 working mode is selected as the target USB working mode.
A third embodiment of the present invention, as shown in fig. 3, comprises the steps of:
s010 starts a router, and configures the USB working mode of the router according to the configuration information of the preset USB working mode;
s100, acquiring a wireless mode of a wireless terminal accessed to a router;
s211 determines whether there is a first wireless mode in the acquired wireless modes, if yes, step S212 is performed, otherwise step S230 is performed;
s212 collects the signal strength of the wireless terminal in the first wireless mode, and determines whether the signal strength is greater than a predetermined reference signal strength, if so, step S220 is performed, otherwise, step S230 is performed.
S220, selecting a first USB working mode of the router as a target USB working mode;
s230 selects the second USB operating mode of the router as a target USB operating mode.
S300, acquiring the current USB working mode of the router, judging whether the current USB working mode is consistent with the target USB working mode, and if not, entering the step S400;
s400, switching the current USB operating mode to the target USB operating mode.
Compared with the second embodiment, the scheme is optimized, and it is not determined that the first USB operating mode is selected as the target USB operating mode as long as the wireless terminal in the first wireless mode is connected, but it is also determined that the signal strength of the wireless terminal in the first wireless mode is collected, and it is determined whether the signal strength of all the wireless terminals in the first wireless mode is greater than the preset reference signal strength, if so, the first USB operating mode is selected as the target USB operating mode, otherwise, the wireless terminal in the first wireless mode with the signal strength less than or equal to the preset reference signal strength is far away from the wireless router or has more barriers, and the signal is poor, and the difference influence on the wireless terminal in both USB2.0 and USB3.0 is small because of the weak signal strength. Therefore, the transmission performance of the terminal does not need to be considered, which is equivalent to that the terminal does not access the wireless router. For example, regarding the signal strength of the wireless terminal, for example, if the 2.4G wireless terminal is separated from the wireless router by a wall (if the distance is not far away), the signal strength of the signal transmitted by the 2.4G wireless terminal received by the wireless router is about-35 dBm, if two walls are separated, the signal strength is about-45 dBm, and if three walls are separated, the signal strength is about-55 dBm; generally, when the signal strength is reduced to-55 dBm, the signal strength for reference is preset, for example, a signal strength threshold value is preset to-58 dBm, and a wireless terminal currently acquiring the access router includes a terminal 1(2.4G), a terminal 2(2.4G) and a terminal 3 (5G); then, the signal strength of each of the acquisition terminals 1 and 2 is acquired, and if the signal strength of the acquisition terminal 1 is-35 dBm and the signal strength of the acquisition terminal 2 is-80 dBm, the signal strength-35 dBm of the acquisition terminal 1 is greater than the preset reference signal strength-55 dBm and the signal strength-80 dBm of the acquisition terminal 2 is less than the preset reference signal strength-55 dBm, so that the acquisition terminal 2 does not need to be considered, and the first USB operating mode USB2.0 of the router is selected as the target USB operating mode in consideration that the signal strength of the acquisition terminal 1 is greater than the preset reference signal strength. Of course, if the signal strength of both the terminal 1 and the terminal 2 is lower than the preset reference signal strength, the second USB operating mode USB3.0 is selected as the target USB operating mode.
In order to avoid frequent switching, we can also set a decision step: s076 judges whether the flow used by the wireless terminal with the highest flow use is larger than a preset reference flow value, if so, the step S080 is carried out, otherwise, the flow is kept unchanged. Or setting to keep unchanged for at least 1 minute after each switching.
A fourth embodiment of the present invention, on the basis of any of the above embodiments, further includes the steps of:
s020 obtains the terminal type of the access router, judges whether the terminal of the access router is a wireless terminal or not, and if yes, the subsequent steps are carried out.
Specifically, as shown in fig. 4, assuming that the default USB operating mode after the router device is started is USB3.0, after the first terminal is connected, it is first determined whether the terminal type is wired or wireless, and if the terminal type is wired, the USB operating mode of the router remains the default USB 3.0. If the wireless terminal is the wireless terminal, the wireless mode of the wireless terminal needs to be further judged, and the wireless terminal is 2.4G or 5G, if the wireless terminal is the wireless mode of 2.4G, the USB working mode of the router is switched to USB2.0, and if the wireless terminal is 5G, the wireless mode is kept unchanged.
Based on the same technical concept, a fifth embodiment of the present invention provides a USB operating mode switching system of a router, where the system can execute the above method embodiments. As shown in fig. 5, the switching system of the present invention includes: the device comprises an acquisition module 10, a search module 20, a judgment module 30 and a switching module 40, wherein the acquisition module 10 is respectively connected with the search module 20 and the judgment module 30, the judgment module 30 is connected with the switching module 40, and: the acquiring module 10 acquires a wireless mode of a wireless terminal accessing to a router; the searching module 20 searches a target USB working mode corresponding to the wireless terminal according to the wireless mode of the wireless terminal; the determining module 30 obtains the current USB operating mode of the router through the obtaining module 10, determines whether the current USB operating mode is consistent with the target USB operating mode, and if not, switches the current USB operating mode to the target USB operating mode through the switching module 40.
Preferably, on the basis of the fifth embodiment, the apparatus further includes a starting module 50 and a configuration module 60, and the configuration module 60 is respectively connected to the starting module 50 and the switching module 40, wherein: the starting module 50 starts the router, and the configuration module 60 configures the USB operating mode of the router according to the configuration information of the preset USB operating mode.
As shown in fig. 6, the system for switching USB working modes of a router according to a sixth embodiment of the present invention further includes, on the basis of the foregoing embodiment, a selecting module 70 connected to the determining module 30; wherein: the determining module 30 determines whether there is a first wireless mode in the wireless modes acquired by the acquiring module 70, and if yes, the selecting module 70 selects the first USB operating mode of the router as a target USB operating mode; otherwise, the selection module 70 selects the second USB operating mode of the router as the target USB operating mode.
The router USB operating mode switching system according to embodiment 7 of the present invention, as shown in fig. 7, further includes an acquisition module 80 connected to the determination module 30, where: the determining module 30 determines whether there is a first wireless mode in the wireless modes acquired by the acquiring module 10; when the judging module 30 judges that there is a first wireless mode in the wireless modes acquired by the acquiring module 10, the acquiring module 80 acquires the signal intensity of the wireless terminal in the first wireless mode, the judging module 30 judges whether the signal intensity is greater than a preset reference signal intensity, if so, the selecting module 70 selects the first USB operating mode as a target USB operating mode, otherwise, the selecting module 70 selects the second USB operating mode as a target USB operating mode;
when the determining module 30 determines that there is no first wireless mode in the wireless modes acquired by the acquiring module 70, the selecting module 70 selects the second USB operating mode as the target USB operating mode.
Preferably, in any of the above embodiments, the first USB operating mode is a USB2.0 operating mode; the second USB working mode is a USB3.0 working mode; the first wireless mode is a 2.4G operating frequency mode.
Preferably, the determining module in the system of the present invention may be further configured to determine a wireless terminal type of the access router, specifically, if the terminal type of the access router is wired, the router keeps a previous USB operating mode unchanged, and if the terminal type of the router is wireless, the router enters a subsequent wireless mode determination of the wireless terminal, and determines whether to switch the USB operating mode according to the wireless mode. And the USB mode is autonomously switched according to the terminal type and the wireless mode condition, so that the performance and the interference resistance are optimized.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.