Background technology
The 3G card of surfing Internet is the widely used online medium of current wireless wide-area communication network.In today of 3G network develop rapidly, the 3G card of surfing Internet is surfed the Net and is also become convenient by router.Router supports that the function of 3G is more and more.It is to realize on the USB interface of the router that is inserted into by a 3G card of surfing Internet that router is used the 3G function.In existing functional module, can not realize the plug and pull function of 3G card of surfing Internet on router.When the 3G card of surfing Internet inserts the router USB interface, system need to be reset.Carry out the conversion of interface modes on USB interface in system initialization, carry out again afterwards the operations such as 3G card of surfing Internet load driver, dialing, connection online.In the normal operational phase of router, while carrying out the plug operation of 3G card of surfing Internet, system can manually be struck order or carry out the replacement of router by setting in advance by the user, then could operate accordingly the 3G card of surfing Internet.Such operating process relatively expends time in, and can cause unnecessary trouble simultaneously.
Chinese patent (CN202043296U) discloses a kind of 3G router, and it relates to the communications field.It is comprised of enclosing cover (1), base (2), indicator light (3), switch (4), USB interface (5), groove (6), interface (7), bonnet (8); Enclosing cover (1) is connected with base (2), one side of base (2) is provided with indicator light (3) and switch (4), be provided with a groove (6) in base (2), groove (6) inwall one side is provided with USB interface (5), the opposite side of base (2) is provided with interface (7), and the bottom of base (2) is provided with bonnet (8).It can identify the 3G card of surfing Internet automatically, without loaded down with trivial details setting, is convenient for carrying, and good looking appearance, diverse in function, applied widely.Technique scheme relates generally to the outward appearance of 3G router, can't solve the technical problem that the 3G card of surfing Internet can not hot plug.
Chinese patent (CN101572958) discloses a kind of mobile wireless router and has comprised: WiMAX Wi-Fi router, 3G wireless communication module, single chip computer AT 89C52 and power supply unit.The present invention combines Wi-Fi technology and TD technology, detect the incoming information of 3G module by single chip computer AT 89C52, and be provided with the standard telephone interface RJ11 of SWR0832 interface circuit, simulation, by the 3G cordless communication network, with wireless, connect the Internet net, dial and receive calls; Be provided with wide area network and lan interfaces and can form local area network (LAN) by local area network (LAN) LAN mouth and Wi-Fi registered user simultaneously.Technique scheme has only related to the related content that 3G gets online without being tethered to a cable, and can not solve the problems of the prior art.
Summary of the invention
According to the defect existed in prior art, a kind of 3G card of surfing Internet hot plug back-up system and method now are provided, specifically comprise:
A kind of 3G card of surfing Internet hot plug back-up system, be applicable in routing device;
Wherein, comprising:
One detection module; Described detection module connects the external interface of described routing device; Described detection module is in order to detect the type of the external equipment that inserts described external interface;
One processing module; Described processing module connects described detection module; Described processing module, according to the testing result of described detection module, is carried out corresponding operating to described external equipment.
Preferably, this 3G card of surfing Internet hot plug back-up system, wherein, described processing module comprises:
One mode switch element; Described mode switch element is for the testing result according to described detection module, the interface modes of the described external interface of corresponding adjustment;
One processing unit; Described processing unit, according to the described interface modes of institute's external interface and the type of described external equipment, carries out the corresponding operation of processing to described external equipment.
Preferably, this 3G card of surfing Internet hot plug back-up system, wherein, described detection module comprises a timing unit; Be provided with the preset time interval in described timing unit.
A kind of 3G card of surfing Internet hot plug support method, be applicable in routing device, wherein,
One detection module is set in described routing device; Described detection module connects the external interface of described routing device; Described external interface is for accessing external equipment;
One processing module be connected with described detection module is set in described routing device;
Described 3G card of surfing Internet hot plug support method specifically comprises:
Step 1, described detection module detects the type of described external equipment with the first preset strategy;
Step 2, described processing module, according to the testing result of described detection module, is processed described external equipment with described the second preset strategy.
Preferably, this 3G card of surfing Internet hot plug support method, wherein, described the first preset strategy comprises:
Described detection module, according to the ID of described external equipment, judges whether described external equipment is the 3G card of surfing Internet.
Preferably, this 3G card of surfing Internet hot plug support method, wherein, described the second preset strategy comprises:
Step 21, if described external equipment is detected as the 3G card of surfing Internet, described processing module is converted to 3G online pattern by the interface modes of described external interface;
Step 22, described detection module continues described external equipment is monitored;
Step 23, if the interface modes of described routing device is 3G online pattern, and described external equipment is detected as described 3G card of surfing Internet, described processing module carries out to described 3G card of surfing Internet the operation of dialling up on the telephone.
Preferably, this 3G card of surfing Internet hot plug support method, wherein, described detection module comprises a timing unit; Be provided with the preset time interval in described timing unit;
If the time interval that described external equipment is plugged does not exceed the described preset time interval, described detection module is not detected the type of described external equipment.
A kind of routing device, wherein, comprise above-mentioned 3G card of surfing Internet hot plug back-up system.
A kind of routing device, wherein, adopt above-mentioned 3G card of surfing Internet hot plug support method.
The beneficial effect of technique scheme is: the 3G card of surfing Internet can be realized hot plug on routing device, and routing device can be used the 3G function of surfing the Net without restarting, easy to operate, saves time, and realizes that cost is lower.
Embodiment
Below in conjunction with the drawings and specific embodiments, the invention will be further described, but not as limiting to the invention.
As shown in Figure 1, in a preferred embodiment of the present invention, a kind of 3G card of surfing Internet hot plug back-up system specifically comprises:
One detection module; In a preferred embodiment of the present invention, this detection module is connected with the external interface (not shown) of routing device, and this external interface is in external equipment (such as USB memory device or 3G card of surfing Internet etc.) access routing device.In a preferred embodiment of the present invention, because needs are supported warm connection function, so this external interface is USB interface.Detection module detects the type of the external equipment of access external interface according to the first preset strategy.
In a preferred embodiment of the present invention, be provided with a timing unit in detection module, be provided with the preset time interval in this timing unit.If the time interval that external equipment is plugged does not exceed this preset time interval, detection module is not detected the type of this external equipment.In a preferred embodiment of the present invention, while being pulled out due to external equipment, system itself has certain time interval from exiting to restarting, when within this time interval, the user inserts external equipment again, system itself not yet completes initialization, can't again carry out the upper net operation of 3G, therefore this timing unit is set.In a preferred embodiment of the present invention, this preset time interval is 11 seconds, but this preset time interval can freely be arranged by the user, above-mentioned preferred embodiment is not in order to limit the scope of the invention.
One processing module; In a preferred embodiment of the present invention, this processing module connection detection module; Processing module, according to the testing result of detection module, operates the 3G card of surfing Internet accordingly with the second preset strategy.
In a preferred embodiment of the present invention, this processing module comprises a mode switch element and a processing unit.Mode switch element is for the testing result according to detection module, with the interface modes of the second preset tactful corresponding switching external interface; Processing unit is for the interface modes according to external interface, and the type of external equipment, with the second preset strategy, external equipment is carried out to corresponding operating.
In a preferred embodiment of the present invention, above-mentioned the first preset strategy comprises:
According to the ID of external equipment, the type of judgement external equipment.
The ID of above-mentioned external equipment, comprised the PID(Product ID of external equipment, product ID) and VID(Vendor ID, supplier's identification code).Generally, main control device (being routing device in embodiments of the invention) has PID and the VID of oneself, external equipment (for example USB device) also has PID and the VID of oneself, in preferred embodiment of the present invention, the main PID of identification external equipment and the type that VID identifies external equipment of adopting.
Above-mentioned the second preset strategy comprises:
If external equipment is detected as the 3G card of surfing Internet, the mode switch element in processing module is adjusted into 3G online pattern by the interface modes of external interface by the USB memory module.
Because interface modes is adjusted, at the detection module end, it can be regarded is that new external equipment access is arranged, and carries out the detection of a new round.
If the interface modes of external interface is 3G online pattern, and external equipment is detected as the 3G card of surfing Internet, and the processing unit in processing module is carried out the operations such as load driver, dialing, connection online to this 3G card of surfing Internet.
On the basis of technique scheme, above-mentioned the first preset strategy and the second preset strategy, the preferred embodiment of only choosing for the ease of those skilled in the art understand technical scheme of the present invention, not for limiting the scope of the invention.
As Figure 2-3, in preferred embodiment of the present invention, a kind of schematic flow sheet of 3G card of surfing Internet hot plug support method.
As shown in Figure 2, in a preferred embodiment of the present invention, adopt the 3G card of surfing Internet hot plug support method of above-mentioned back-up system, totally comprise:
Step 1, detection module detects the type of external equipment with the first preset strategy;
Step 2, processing module, according to the testing result of detection module, is processed external equipment with the second preset strategy.
In a preferred embodiment of the present invention, above-mentioned the first preset strategy comprises:
By the ID of external equipment, detect the type of external equipment.
As shown in Figure 3, in a preferred embodiment of the present invention, above-mentioned the second preset strategy comprises:
Step 21, if external equipment is detected as the 3G card of surfing Internet, processing module is converted to 3G online pattern by the interface modes of external interface;
Step 22, detection module continues external equipment is monitored;
Step 23, if the interface modes of external interface is 3G online pattern, and external equipment is detected as the 3G card of surfing Internet, processing module carries out to the 3G card of surfing Internet operation of dialling up on the telephone.
On the basis of technique scheme, above-mentioned the first preset strategy and the second preset strategy, the preferred embodiment of only choosing for the ease of those skilled in the art understand technical scheme of the present invention, not for limiting the scope of the invention.
In a preferred embodiment of the present invention, the realization of said system and method is carried out to the detailed description of a functional module aspect, so that those skilled in the art have more deep understanding to this technical scheme.The selectively implementation that following description is only carried out in order to realize this technical scheme, not for limiting the scope of the invention.
In a preferred embodiment of the present invention, at first define a hotplug functional module.Include relevant project file and execute file etc. in this functional module.By configuration hotplug functional module, the hot plug event (being that external equipment passes through circumscribed USB interface couple in router) that system kernel occurs can be detected, also can be changed the interface modes of system, this hotplug functional module has had the function of above-mentioned detection module and processing module concurrently by the mode that function code artificially is set simultaneously.
In a preferred embodiment of the present invention, the configuration of hotplug functional module can realize with software mode as described below:
The relevant code file of configuration in the hotplug functional module.System by the Makefile file by the programming of whole hotplug functional module to router, just have so executable hotplug command history in the file system of router, the function reached described in technical scheme of the present invention all can realize by the order in the hotplug command history.
Certainly, in other preferred embodiments of the present invention, can adopt equally hardware configuration to realize the achieved function of above-mentioned hotplug functional module, to reach goal of the invention of the present invention.
When the user uses the online of 3G card of surfing Internet, the problem of interface loose contact or card of surfing Internet itself unavoidably can occur, cause surfing the Net, now the common way of user is that card of surfing Internet is plugged once again, with the initialization system process.But system initialization needs certain hour, therefore, be provided with a preset time interval (in preferred embodiment of the present invention in system, this time interval is 11 seconds), when the time interval that the 3G card of surfing Internet is plugged is less than this preset time interval, now system not yet initialization complete, the hotplug functional module is not detected this 3G card of surfing Internet, therefore avoided system not yet completing in initialized situation the operation that needs to carry out 3G online dialing, thereby the situation that causes process blocking, guaranteed that the whole system operation is unobstructed.
The foregoing is only preferred embodiment of the present invention; not thereby limit embodiments of the present invention and protection range; to those skilled in the art; should recognize that being equal to that all utilizations specification of the present invention and diagramatic content done replace and the resulting scheme of apparent variation, all should be included in protection scope of the present invention.