CN108494639A - Network access method and mobile terminal - Google Patents
Network access method and mobile terminal Download PDFInfo
- Publication number
- CN108494639A CN108494639A CN201810136765.6A CN201810136765A CN108494639A CN 108494639 A CN108494639 A CN 108494639A CN 201810136765 A CN201810136765 A CN 201810136765A CN 108494639 A CN108494639 A CN 108494639A
- Authority
- CN
- China
- Prior art keywords
- mobile terminal
- virtual network
- network port
- equipment
- virtual
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/2854—Wide area networks, e.g. public data networks
- H04L12/2856—Access arrangements, e.g. Internet access
- H04L12/2869—Operational details of access network equipments
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/2854—Wide area networks, e.g. public data networks
- H04L12/2856—Access arrangements, e.g. Internet access
- H04L12/2869—Operational details of access network equipments
- H04L12/2898—Subscriber equipments
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
An embodiment of the present invention provides a kind of Network Access Method and mobile terminal, wherein method is applied to mobile terminal, including:In the mobile terminal with after the first equipment communication connection with route forwarding function, the first virtual network port is set for the mobile terminal, and the second virtual network port is set for first equipment;Set second virtual network port to the gateway of first virtual network port;Wherein, the mobile terminal carries out network access by the route forwarding function of first equipment.Through the embodiment of the present invention, it can ensure the network access performance and efficiency of mobile terminal, when solving that mobile terminal carries out network access by the network of other electronic equipments in the prior art, the poor problem of the network access performance and efficiency of mobile terminal.
Description
Technical field
The present invention relates to field of mobile terminals more particularly to a kind of Network Access Methods and mobile terminal.
Background technology
Under scene of the mobile terminal (such as smart mobile phone, tablet computer) without connecting network, other electronics can be set
Standby network share is used to mobile terminal, and the network that mobile terminal passes through the electronic equipment is made to carry out network access.For example, will
The network share of computer is used to smart mobile phone, and the network that smart mobile phone passes through computer is made to access webpage etc..
In the prior art by the network share of other electronic equipments to mobile terminal in use, need respectively in mobile terminal
With specific software is installed and run in the electronic equipment, network data is sent to electricity by mobile terminal by the specific software
Sub- equipment, electronic equipment utilize the specific software receiving network data, and the network that will be received by the specific software
Data are forwarded by network interface, so that mobile terminal carries out network access by the network of the electronic equipment.
Inventor has found under study for action, realizes that mobile terminal passes through other electronic equipments by way of running specific software
Network carry out network access when, due to mobile terminal be based on application carry out network access, be easy to bring larger
Overhead, therefore the network access performance and efficiency of mobile terminal are poor, wherein network access performance and efficiency are embodied in net
Network transmission rate, time delay, bandwidth etc..
Invention content
The purpose of the embodiment of the present invention is to provide a kind of Network Access Method and mobile terminal, and solution is moved in the prior art
When terminal carries out network access by the network of other electronic equipments, the network access performance and efficiency of mobile terminal are poor to ask
Topic.
In order to solve the above technical problems, what the embodiment of the present invention was realized in:
In a first aspect, an embodiment of the present invention provides a kind of Network Access Method, it is applied to mobile terminal, the method packet
It includes:
In the mobile terminal with after the first equipment communication connection with route forwarding function, set for the mobile terminal
The first virtual network port is set, and the second virtual network port is set for first equipment;
Set second virtual network port to the gateway of first virtual network port;Wherein, the mobile terminal passes through
The route forwarding function of first equipment carries out network access.
Second aspect, an embodiment of the present invention provides a kind of mobile terminals, including:
Network interface setup module, for, with after the first equipment communication connection with route forwarding function, being in mobile terminal
The first virtual network port is arranged in the mobile terminal, and the second virtual network port is arranged for first equipment;
Gateway setup module, the gateway for setting second virtual network port to first virtual network port;Wherein,
The mobile terminal carries out network access by the route forwarding function of first equipment.
The third aspect, an embodiment of the present invention provides a kind of mobile terminals, including:Memory, processor and it is stored in institute
The computer program that can be run on memory and on the processor is stated, when the computer program is executed by the processor
The step of realizing the Network Access Method as described in above-mentioned first aspect.
Fourth aspect, an embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage
It is stored with computer program on medium, the net as described in above-mentioned first aspect is realized when the computer program is executed by processor
The step of network access method.
It is mobile whole after mobile terminal is communicated to connect with the first equipment with route forwarding function in the present embodiment
The first virtual network port and the second virtual network port is respectively set in end and the first equipment, then sets the second virtual network port to the first void
The gateway of quasi- network interface;Wherein, mobile terminal carries out network access by the route forwarding function of the first equipment.With in the prior art
Application layer based on mobile terminal realizes that the mode that network accesses is compared, and the embodiment of the present invention is based on virtual network port and routing forwarding
Function realizes that mobile terminal carries out network access, namely the bottom based on mobile terminal by the route forwarding function of the first equipment
Layer realizes that network accesses, and can reduce network and access caused overhead, to ensure the network access property of mobile terminal
Energy and efficiency, solve the problems, such as that the network access performance of mobile terminal and efficiency are poor.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments described in invention, for those of ordinary skill in the art, in the premise of not making the creative labor property
Under, other drawings may also be obtained based on these drawings.
Fig. 1 is the application scenarios schematic diagram for the Network Access Method that one embodiment of the invention provides;
Fig. 2 is the flow diagram for the Network Access Method that one embodiment of the invention provides;
Fig. 3 is the network share interface schematic diagram for the mobile terminal that one embodiment of the invention provides;
Fig. 4 is the flow diagram for the Network Access Method that further embodiment of this invention provides;
Fig. 5 is the connection diagram of mobile terminal and the first equipment that one embodiment of the invention provides;
Fig. 6 is the module composition schematic diagram for the mobile terminal that one embodiment of the invention provides;
A kind of hardware architecture diagram of Fig. 7 mobile terminals of each embodiment to realize the present invention.
Specific implementation mode
In order to make those skilled in the art more fully understand the technical solution in the present invention, below in conjunction with of the invention real
The attached drawing in example is applied, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described implementation
Example is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, this field is common
The every other embodiment that technical staff is obtained without creative efforts, should all belong to protection of the present invention
Range.
When for solution, mobile terminal carries out network access by the network of other electronic equipments in the prior art, mobile terminal
Network access performance and the poor problem of efficiency, an embodiment of the present invention provides a kind of Network Access Method, it is a kind of it is mobile eventually
End and a kind of computer readable storage medium.The Network Access Method be applied to mobile terminal side, can by mobile terminal execution,
The mobile terminal that the embodiment of the present invention refers to includes but not limited to the intelligent terminals such as smart mobile phone, tablet computer.
Fig. 1 is the application scenarios schematic diagram for the Network Access Method that one embodiment of the invention provides, as shown in Figure 1, this
Scape includes mobile terminal 100 and the first equipment 200, wherein the first equipment 200 has a route forwarding function, in Fig. 1 with it is mobile eventually
End 100 is smart mobile phone, the first equipment 200 is that computer is illustrated.In Fig. 1, mobile terminal 100 and the communication of the first equipment 200
Connection, communication connection can be USB (Universal Serial Bus, universal serial bus) connections, WIFI (Wireless
Fidelity, Wireless Fidelity) connection or bluetooth (Bluetooth) connection etc..Under the scene of Fig. 1, using the embodiment of the present invention
Network Access Method, mobile terminal 100 can by the network of the first equipment 200 carry out network access, provide a user
Net function.
Fig. 2 is the flow diagram for the Network Access Method that one embodiment of the invention provides, and this method is applied to mobile whole
End side, can be by mobile terminal execution, as shown in Fig. 2, this approach includes the following steps:
Step 202, it is set for mobile terminal with after the first equipment communication connection with route forwarding function in mobile terminal
The first virtual network port is set, and the second virtual network port is set for the first equipment;
Step 204, the second virtual network port is set to the gateway of the first virtual network port;Wherein, mobile terminal passes through first
The route forwarding function of equipment carries out network access.
Through the embodiment of the present invention, after the first equipment accesses internet, mobile terminal can utilize the road of the first equipment
Network access is carried out by forwarding capability.The mode phase that network accesses is realized with the application layer in the prior art based on mobile terminal
Than the embodiment of the present invention is based on virtual network port and route forwarding function, realizes routing forwarding of the mobile terminal by the first equipment
Function carries out network access, namely the bottom layer realization network based on mobile terminal accesses, and can reduce caused by network access
Overhead solves the network access performance and effect of mobile terminal to ensure the network access performance and efficiency of mobile terminal
The poor problem of rate.
Also, compared with the application layer in the prior art based on mobile terminal realizes the mode that network accesses, the present embodiment
The route forwarding function progress network access that mobile terminal can be realized by the first equipment without installing specific software, therefore
Also have realize it is simple and convenient, the advantages of without installing extra software.Also, the application layer based on mobile terminal in the prior art
It realizes in the mode that network accesses, specific software can occupy the larger system resource of mobile terminal, and the present embodiment is without installation
Specific software can be realized mobile terminal and carry out network access by the route forwarding function of the first equipment, therefore can also keep away
Exempt to occupy the larger system resource of mobile terminal.
In the present embodiment, mobile terminal carries out network access specifically, mobile by the route forwarding function of the first equipment
Network data is sent to the first equipment by terminal using the first virtual network port, and first the second virtual network port of equipment utilization receives network
Data, and forwarded network data using route forwarding function, to make mobile terminal carry out network access, carried to user
For function of surfing the Net.Wherein, the first equipment can be the computer with Windows or linux system.
Network share interface is provided in the present embodiment, on mobile terminal, Fig. 3 is the movement that one embodiment of the invention provides
The network share interface schematic diagram of terminal, as shown in figure 3, the button " using network is shared " is provided in the interface, when user's point
Hit the button open corresponding function after, mobile terminal can utilize the first equipment communicatively connected to each other route forwarding function into
Row network accesses, that is, the network using the first equipment carries out network access, provides a user function of surfing the Net.
It, can be after getting user using the request for sharing network online in the present embodiment, the execution above method, one
In embodiment, when mobile terminal receives click action of the user for above-mentioned " using network is shared " button, determination is got
User utilizes the request for sharing network online.In another embodiment, mobile terminal can also receive user about using
When the voice messaging or text information of shared network, determines and get user using the request for sharing network online.This field
Technical staff may be used any of which and realize the request that acquisition for mobile terminal is surfed the Internet to user using network is shared, here
It repeats no more.
In above-mentioned steps 202, the first virtual network port is set for mobile terminal, and the second virtual net is set for the first equipment
Mouthful, specially:
(1) call virtual network port corresponding with above-mentioned communication connection that function is set from the inner nuclear layer of mobile terminal;Its
In, communication connection refers to the communication connection between mobile terminal and the first equipment;
(2) function is arranged in the virtual network port based on calling, the first virtual network port is arranged for mobile terminal, and set for first
The second virtual network port of standby setting.
In one embodiment, the communication connection between mobile terminal and the first equipment is USB connections, with the communication connection phase
Corresponding virtual network port setting function is USB RNDIS (Remote Network Driver Interface
Specification, remote network driver interface specification) function, then, mobile terminal moves after being connect with the first equipment USB
Dynamic terminal calls USB RNDIS functions from the inner nuclear layer of itself, and then, the USB RNDIS functions based on calling set for itself
The first virtual network port is set, and the second virtual network port is set for the first equipment.First equipment can be based on Windows or
The computer of linux system, the computer based on Windows or linux system support mobile terminal after being connect with mobile terminal
USBRNDIS functions are called to create virtual network port for it.
In above-mentioned steps 204, mobile terminal sets the second virtual network port to the gateway of the first virtual network port, specially:
(1) the IP distribution instructions to prestore are called, the first IP address is distributed for the first virtual network port;Wherein, IP refers to
Internet Protocol, Chinese are procotol;
(2) DHCP (Dynamic Host Configuration Protocol, dynamic host configuration protocol) is called to take
Business distributes the second IP address for the second virtual network port;
(3) it is based on the first IP address and the second IP address, calls the gateway to prestore that instruction is set, the second virtual network port is set
It is set to the gateway of the first virtual network port.
Specifically, the IP distribution instruction to prestore can be " ifconfig AB up ", wherein " A " is expressed as the first virtual net
The title of mouthful setting, " B " is expressed as the IP address of the first virtual network port distribution, and mobile terminal calls IP distribution instructions, is the
The first IP address of title and distribution is arranged in one virtual network port.For example, the IP distribution instructions to prestore are " ifconfig rndis0
192.168.42.129up ", mobile terminal calls the instruction, is arranged entitled " rndis0 " of the first virtual network port, and is the
One virtual network port distributes the first IP address " 192.168.42.129 ".
Secondly, mobile terminal also calls DHCP service, and the second IP address is distributed for the second virtual network port.Specifically, work as shifting
Dynamic terminal is that the first equipment is arranged after the completion of the second virtual network port, and the first equipment is able to detect that the second virtual network port, mobile whole
End can also start and call DHCP service, and the second IP address (such as 192.168.42.10) is distributed for the second virtual network port.
Then, mobile terminal is based on the first IP address and the second IP address, calls the gateway to prestore that instruction is arranged, by second
Virtual network port is set as the gateway of the first virtual network port.Prestore gateway setting instruction include routing forwarding rule setting instruction with
Main routing tables (main routing table) setting instruction, mobile terminal call routing forwarding rule setting instruction (such as " ip route
Add "), the routing forwarding that the network data of mobile terminal is arranged is given tacit consent to and is forwarded by main routing tables, and mobile terminal is also
Main routing tables setting instruction (such as " ip route add default via S ") is called, corresponding turn of main routing tables are set
Hair form is, the network data of mobile terminal is forwarded by the network interface that IP is " S ", wherein " S " is the IP of the second virtual network port
Location, such as 192.168.42.10, to set the second virtual network port to the gateway of the first virtual network port so that mobile terminal
Network data by the first equipment send or receive, to realize route forwarding function of the mobile terminal by the first equipment
Carry out network access.In the present embodiment, network data includes network message.
By the method in Fig. 2, can set the second virtual network port of the first equipment to mobile terminal first is virtual
The gateway of network interface provides a user to which the route forwarding function for making mobile terminal pass through the first equipment carries out network access
Net function.
Further, it is contemplated that the application program inside mobile terminal needs to access the first virtual network port of mobile terminal,
To carry out network access by the first virtual network port, Fig. 4 is the flow for the Network Access Method that further embodiment of this invention provides
Schematic diagram, as shown in figure 4, this method further includes on the basis of Fig. 2:
Step 206, judge the identifying whether to be marked in advance of the first virtual network port using the service of monitoring of preset virtual network port
Know;
Step 208, if so, monitoring the corresponding access interface of the first virtual network port of service-creation by virtual network port;Its
In, the application program inside mobile terminal accesses the first virtual network port by access interface.
Specifically, virtual network port is preset inside mobile terminal and monitors service, and after the completion of mobile terminal-opening, this is virtual
The network interface service of monitoring starts, and after being that the first virtual network port is arranged in mobile terminal by step 102, virtual network port monitors service prison
Hear that the first virtual network port generates, the then virtual network port service of monitoring judges the identifying whether to be marked in advance of the first virtual network port
Know, if so, virtual network port monitors the corresponding access interface of the first virtual network port of service-creation;Wherein, inside mobile terminal
Application program accesses the first virtual network port by access interface, so that the application program inside mobile terminal realizes that network accesses.
In one specific embodiment, the virtual network port service of monitoring is USB Ethernet Service services, and movement is eventually
After the completion of the booting of end, USB Ethernet Service services start, and monitor the variation of inner nuclear layer network interface.When passing through step
After 102 are arranged the first virtual network port for mobile terminal, USB Ethernet Service services listen to the life of the first virtual network port
At, the title of USB Ethernet Service service acquisitions to the first virtual network port, and judge whether the title is RNDIS0,
If so, USB Ethernet Service one NetworkInfo object of service-creation, NetworkInfo objects can carry
For accessing all operations of the first virtual network port, application program inside mobile terminal can by NetworkInfo objects come
Network access is carried out using the first virtual network port.
In the embodiment of the present invention, service is monitored by preset virtual network port, can be that the first virtual network port creates access
Interface makes the application program inside mobile terminal pass through the access interface and accesses the first virtual network port, to make in mobile terminal
The application program in portion realizes that network accesses.
Fig. 5 is the connection diagram of mobile terminal and the first equipment that one embodiment of the invention provides, in Fig. 5, it is mobile eventually
End is smart mobile phone, and the first equipment has routing forwarding service, for the computer based on Windows or linux system, and first
Equipment accesses internet, mobile terminal and the first equipment USB connections.In Fig. 5, mobile terminal includes application layer, ccf layer and interior
Stratum nucleare, application layer include each application program and network settings menu, and ccf layer includes network service module and adaptation USB network interfaces
Module, inner nuclear layer include USB network interface, TCP/IP (Transmission Control Protocol/Internet
Protocol, transmission control protocol/Internet Protocol) protocol stack and usb protocol stack.
In Fig. 5, mobile terminal can provide a user the function of the network online using the first equipment, the network of application layer
Setting menu is for providing corresponding button, consequently facilitating user chooses whether after connecting mobile terminal with the first equipment
It is surfed the Internet using the network of the first equipment.
Adaptation USB network interface modules in ccf layer are used to execute the method flow in Fig. 1, including virtual network port is arranged, sets
Set gateway etc. so that the second virtual network port is set as the gateway of the first virtual network port.Network service module in ccf layer is used for
The corresponding access interface of the first virtual network port of service-creation is monitored by virtual network port, so that the application program inside mobile terminal
By the access interface access the first virtual network port, realize mobile terminal inside application program using the first equipment network into
Row network accesses.
Inner nuclear layer includes USB network interface, ICP/IP protocol stack and usb protocol stack.USB network interface provides for inner nuclear layer
To the network interface of ccf layer, ICP/IP protocol stack and usb protocol stack are each responsible for processing network message and USB messages.
In Fig. 5, mobile terminal is connect by USB connecting lines with the first equipment, and the operating system of mobile terminal is provided with logical
The function of the network online of computer is crossed, the display interface of mobile terminal shows the button that the network by computer is surfed the Internet, works as user
After clicking on, mobile terminal carries out network access by above-mentioned Network Access Method, using the network of computer, thus to
User provides function of surfing the Net.
To sum up, through the embodiment of the present invention, can be on the basis of specific software be installed, the bottom based on mobile terminal
Layer realizes that mobile terminal carries out network access by the route forwarding function of the first equipment, has and ensures that the network of mobile terminal is visited
The advantages of asking performance and efficiency.Also, the present embodiment can be realized mobile terminal without installing specific software and be set by first
Standby route forwarding function carries out network access, also have realize it is simple and convenient, the advantages of without installing extra software.Also,
The present embodiment is not necessarily to install the route forwarding function progress network that mobile terminal can be realized by the first equipment in specific software
It accesses, additionally it is possible to avoid occupying the larger system resource of mobile terminal.
Corresponding above-mentioned Network Access Method, the embodiment of the present invention additionally provides a kind of mobile terminal, for realizing above-mentioned
Network Access Method, Fig. 6 is the module composition schematic diagram of mobile terminal that one embodiment of the invention provides, as shown in fig. 6, should
Mobile terminal includes:
Network interface setup module 61 is used for after mobile terminal is communicated to connect with the first equipment with route forwarding function,
The first virtual network port is set for the mobile terminal, and the second virtual network port is set for first equipment;
Gateway setup module 62, the gateway for setting second virtual network port to first virtual network port;Its
In, the mobile terminal carries out network access by the route forwarding function of first equipment.
Optionally, the network interface setup module 61 is specifically used for:
Call virtual network port corresponding with the communication connection that function is set from the inner nuclear layer of the mobile terminal;
Function is arranged in the virtual network port based on calling, and the first virtual network port, Yi Jiwei is arranged for the mobile terminal
The second virtual network port is arranged in first equipment.
Optionally, the gateway setup module 62 is specifically used for:
The procotol IP distribution instructions to prestore are called, the first IP address is distributed for first virtual network port;
Dynamic host configuration protocol DHCP service is called, the second IP address is distributed for second virtual network port;
Based on first IP address and second IP address, call the gateway to prestore that instruction is set, by described second
Virtual network port is set as the gateway of first virtual network port.
Optionally, which further includes:
Judgment module is identified, is used to that the first virtual network port to be arranged for the mobile terminal, and be first equipment
It is arranged after the second virtual network port, judges identifying whether for first virtual network port using the service of monitoring of preset virtual network port
For default mark;
Interface creation module is used for if so, monitoring the first virtual network port described in service-creation by the virtual network port
Corresponding access interface;Wherein, the application program inside the mobile terminal accesses first void by the access interface
Quasi- network interface.
Optionally, the communication connection is that general-purpose serial bus USB connects, virtual net corresponding with the communication connection
Mouth setting function is the remote network driver interface specification USB RNDIS functions of universal serial bus.
Through the embodiment of the present invention, after the first equipment accesses internet, mobile terminal can utilize the road of the first equipment
Network access is carried out by forwarding capability.The mode phase that network accesses is realized with the application layer in the prior art based on mobile terminal
Than the embodiment of the present invention is based on virtual network port and route forwarding function, realizes routing forwarding of the mobile terminal by the first equipment
Function carries out network access, namely the bottom layer realization network based on mobile terminal accesses, and can reduce caused by network access
Overhead solves the network access performance and effect of mobile terminal to ensure the network access performance and efficiency of mobile terminal
The poor problem of rate.
Also, compared with the application layer in the prior art based on mobile terminal realizes the mode that network accesses, the present embodiment
The route forwarding function progress network access that mobile terminal can be realized by the first equipment without installing specific software, therefore
Also have realize it is simple and convenient, the advantages of without installing extra software.Also, the application layer based on mobile terminal in the prior art
It realizes in the mode that network accesses, specific software can occupy the larger system resource of mobile terminal, and the present embodiment is without installation
Specific software can be realized mobile terminal and carry out network access by the route forwarding function of the first equipment, therefore can also keep away
Exempt to occupy the larger system resource of mobile terminal.
The hardware architecture diagram of Fig. 7 a kind of mobile terminals of each embodiment to realize the present invention, as shown in fig. 7, should
Mobile terminal 800 (i.e. mobile terminal 100 in Fig. 1) is including but not limited to:Radio frequency unit 801, network module 802, audio are defeated
Go out unit 803, input unit 804, sensor 805, display unit 806, user input unit 807, interface unit 808, storage
The components such as device 809, processor 810 and power supply 811.It will be understood by those skilled in the art that mobile terminal shown in Fig. 7
Structure does not constitute the restriction to mobile terminal, and mobile terminal may include than illustrating more or fewer components, or combination
Certain components or different components arrangement.In embodiments of the present invention, mobile terminal includes but not limited to smart mobile phone, puts down
Plate computer, palm PC, car-mounted terminal, wearable device and pedometer etc..
Wherein, it is stored with computer program in memory 809, when which is executed by processor 810, Neng Goushi
Existing following below scheme:
In the mobile terminal with after the first equipment communication connection with route forwarding function, set for the mobile terminal
The first virtual network port is set, and the second virtual network port is set for first equipment;
Set second virtual network port to the gateway of first virtual network port;Wherein, the mobile terminal passes through
The route forwarding function of first equipment carries out network access.
Optionally, when which is executed by processor 810, the first virtual network port is set for the mobile terminal,
And the second virtual network port is set for first equipment, including:
Call virtual network port corresponding with the communication connection that function is set from the inner nuclear layer of the mobile terminal;
Function is arranged in the virtual network port based on calling, and the first virtual network port, Yi Jiwei is arranged for the mobile terminal
The second virtual network port is arranged in first equipment.
Optionally, when which is executed by processor 810, second virtual network port is set as described first
The gateway of virtual network port, including:
The procotol IP distribution instructions to prestore are called, the first IP address is distributed for first virtual network port;
Dynamic host configuration protocol DHCP service is called, the second IP address is distributed for second virtual network port;
Based on first IP address and second IP address, call the gateway to prestore that instruction is set, by described second
Virtual network port is set as the gateway of first virtual network port.
Optionally, when which is executed by processor 810, the first virtual net is being set for the mobile terminal
Mouthful, and be that first equipment is arranged after the second virtual network port, further include:
Judge that first virtual network port identifies whether to identify to be default using the service of monitoring of preset virtual network port;
If so, monitoring the corresponding access interface of the first virtual network port described in service-creation by the virtual network port;Its
In, the application program inside the mobile terminal accesses first virtual network port by the access interface.
Optionally, when which is executed by processor 810, the communication connection is that general-purpose serial bus USB connects
It connects, virtual network port setting function corresponding with the communication connection is the remote network driver interface specification of universal serial bus
USB RNDIS functions.
Through the embodiment of the present invention, after the first equipment accesses internet, mobile terminal can utilize the road of the first equipment
Network access is carried out by forwarding capability.The mode phase that network accesses is realized with the application layer in the prior art based on mobile terminal
Than the embodiment of the present invention is based on virtual network port and route forwarding function, realizes routing forwarding of the mobile terminal by the first equipment
Function carries out network access, namely the bottom layer realization network based on mobile terminal accesses, and can reduce caused by network access
Overhead solves the network access performance and effect of mobile terminal to ensure the network access performance and efficiency of mobile terminal
The poor problem of rate.
Also, compared with the application layer in the prior art based on mobile terminal realizes the mode that network accesses, the present embodiment
The route forwarding function progress network access that mobile terminal can be realized by the first equipment without installing specific software, therefore
Also have realize it is simple and convenient, the advantages of without installing extra software.Also, the application layer based on mobile terminal in the prior art
It realizes in the mode that network accesses, specific software can occupy the larger system resource of mobile terminal, and the present embodiment is without installation
Specific software can be realized mobile terminal and carry out network access by the route forwarding function of the first equipment, therefore can also keep away
Exempt to occupy the larger system resource of mobile terminal.
It should be understood that the embodiment of the present invention in, radio frequency unit 801 can be used for receiving and sending messages or communication process in, signal
Send and receive, specifically, by from base station downlink data receive after, to processor 810 handle;In addition, by uplink
Data are sent to base station.In general, radio frequency unit 801 includes but not limited to antenna, at least one amplifier, transceiver, coupling
Device, low-noise amplifier, duplexer etc..In addition, radio frequency unit 801 can also by radio communication system and network and other set
Standby communication.
Mobile terminal has provided wireless broadband internet to the user by network module 802 and has accessed, and such as user is helped to receive
Send e-mails, browse webpage and access streaming video etc..
It is that audio output unit 803 can receive radio frequency unit 801 or network module 802 or in memory 809
The audio data of storage is converted into audio signal and exports to be sound.Moreover, audio output unit 803 can also be provided and be moved
The relevant audio output of specific function that dynamic terminal 800 executes is (for example, call signal receives sound, message sink sound etc.
Deng).Audio output unit 803 includes loud speaker, buzzer and receiver etc..
Input unit 804 is for receiving audio or video signal.Input unit 804 may include graphics processor
(Graphics Processing Unit, GPU) 8041 and microphone 8042, graphics processor 8041 is in video acquisition mode
Or the image data of the static images or video obtained by image capture apparatus (such as camera) in image capture mode carries out
Reason.Treated, and picture frame may be displayed on display unit 806.Through graphics processor 8041, treated that picture frame can be deposited
Storage is sent in memory 809 (or other storage mediums) or via radio frequency unit 801 or network module 802.Mike
Wind 8042 can receive sound, and can be audio data by such acoustic processing.Treated audio data can be
The format output of mobile communication base station can be sent to via radio frequency unit 801 by being converted in the case of telephone calling model.
Mobile terminal 800 further includes at least one sensor 805, such as optical sensor, motion sensor and other biographies
Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment
The light and shade of light adjusts the brightness of display panel 8061, and proximity sensor can close when mobile terminal 800 is moved in one's ear
Display panel 8061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (general
For three axis) size of acceleration, size and the direction of gravity are can detect that when static, can be used to identify mobile terminal posture (ratio
Such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap);It passes
Sensor 805 can also include fingerprint sensor, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, wet
Meter, thermometer, infrared sensor etc. are spent, details are not described herein.
Display unit 806 is for showing information input by user or being supplied to the information of user.Display unit 806 can wrap
Display panel 8061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode may be used
Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 8061.
User input unit 807 can be used for receiving the number or character information of input, and generate the use with mobile terminal
Family is arranged and the related key signals input of function control.Specifically, user input unit 807 include touch panel 8071 and
Other input equipments 8072.Touch panel 8071, also referred to as touch screen collect user on it or neighbouring touch operation
(for example user uses any suitable objects or attachment such as finger, stylus on touch panel 8071 or in touch panel 8071
Neighbouring operation).Touch panel 8071 may include both touch detecting apparatus and touch controller.Wherein, touch detection
Device detects the touch orientation of user, and detects the signal that touch operation is brought, and transmits a signal to touch controller;Touch control
Device processed receives touch information from touch detecting apparatus, and is converted into contact coordinate, then gives processor 810, receiving area
It manages the order that device 810 is sent and is executed.Furthermore, it is possible to more using resistance-type, condenser type, infrared ray and surface acoustic wave etc.
Type realizes touch panel 8071.In addition to touch panel 8071, user input unit 807 can also include other input equipments
8072.Specifically, other input equipments 8072 can include but is not limited to physical keyboard, function key (such as volume control button,
Switch key etc.), trace ball, mouse, operating lever, details are not described herein.
Further, touch panel 8071 can be covered on display panel 8061, when touch panel 8071 is detected at it
On or near touch operation after, send processor 810 to determine the type of touch event, be followed by subsequent processing device 810 according to touch
The type for touching event provides corresponding visual output on display panel 8061.Although touch panel 8071 and display panel
8061 be to realize the function that outputs and inputs of mobile terminal as two independent components, but in certain embodiments, can
The function that outputs and inputs of mobile terminal is realized so that touch panel 8071 and display panel 8061 is integrated, is not done herein specifically
It limits.
Interface unit 808 is the interface that external device (ED) is connect with mobile terminal 800.For example, external device (ED) may include having
Line or wireless head-band earphone port, external power supply (or battery charger) port, wired or wireless data port, storage card end
Mouth, port, the port audio input/output (I/O), video i/o port, earphone end for connecting the device with identification module
Mouthful etc..Interface unit 808 can be used for receiving the input (for example, data information, electric power etc.) from external device (ED) and
By one or more elements that the input received is transferred in mobile terminal 800 or can be used in 800 He of mobile terminal
Transmission data between external device (ED).
Memory 809 can be used for storing software program and various data.Memory 809 can include mainly storing program area
And storage data field, wherein storing program area can storage program area, application program (such as the sound needed at least one function
Sound playing function, image player function etc.) etc.;Storage data field can store according to mobile phone use created data (such as
Audio data, phone directory etc.) etc..In addition, memory 809 may include high-speed random access memory, can also include non-easy
The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 810 is the control centre of mobile terminal, utilizes each of various interfaces and the entire mobile terminal of connection
A part by running or execute the software program and/or module that are stored in memory 809, and calls and is stored in storage
Data in device 809 execute the various functions and processing data of mobile terminal, to carry out integral monitoring to mobile terminal.Place
Reason device 810 may include one or more processing units;Preferably, processor 810 can integrate application processor and modulatedemodulate is mediated
Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main
Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 810.
Mobile terminal 800 can also include the power supply 811 (such as battery) powered to all parts, it is preferred that power supply 811
Can be logically contiguous by power-supply management system and processor 810, to realize management charging by power-supply management system, put
The functions such as electricity and power managed.
In addition, mobile terminal 800 includes some unshowned function modules, details are not described herein.
Preferably, the embodiment of the present invention also provides a kind of mobile terminal, including processor, and memory is stored in memory
Computer program that is upper and can running on the processor, the computer program realize that above-mentioned network is visited when being executed by processor
It asks each process of embodiment of the method, and identical technique effect can be reached, to avoid repeating, which is not described herein again.
Further, the embodiment of the present invention also provides a kind of computer readable storage medium, computer readable storage medium
On be stored with computer program, which realizes each of above-mentioned Network Access Method embodiment when being executed by processor
Process, and identical technique effect can be reached, to avoid repeating, which is not described herein again.Wherein, the computer-readable storage
Medium, such as read-only memory (Read-Only Memory, abbreviation ROM), random access memory (Random Access
Memory, abbreviation RAM), magnetic disc or CD etc..
It should be noted that herein, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that process, method, article or device including a series of elements include not only those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including this
There is also other identical elements in the process of element, method, article or device.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical scheme of the present invention substantially in other words does the prior art
Going out the part of contribution can be expressed in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disc, CD), including some instructions are used so that a station terminal (can be mobile phone, computer, service
Device, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited in above-mentioned specific
Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art
Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much
Form belongs within the protection of the present invention.
Claims (12)
1. a kind of Network Access Method, which is characterized in that it is applied to mobile terminal, the method includes:
The mobile terminal with after the first equipment communication connection with route forwarding function, for mobile terminal setting the
One virtual network port, and the second virtual network port is set for first equipment;
Set second virtual network port to the gateway of first virtual network port;Wherein, the mobile terminal passes through described
The route forwarding function of first equipment carries out network access.
2. according to the method described in claim 1, it is characterized in that, for the mobile terminal be arranged the first virtual network port, and
For first equipment, the second virtual network port is set, including:
Call virtual network port corresponding with the communication connection that function is set from the inner nuclear layer of the mobile terminal;
Function is arranged in the virtual network port based on calling, the first virtual network port is arranged for the mobile terminal, and be described
The second virtual network port is arranged in first equipment.
3. according to the method described in claim 1, it is characterized in that, second virtual network port is set as described first virtually
The gateway of network interface, including:
The procotol IP distribution instructions to prestore are called, the first IP address is distributed for first virtual network port;
Dynamic host configuration protocol DHCP service is called, the second IP address is distributed for second virtual network port;
Based on first IP address and second IP address, call the gateway to prestore that instruction is set, it is virtual by described second
Network interface is set as the gateway of first virtual network port.
4. method according to any one of claims 1 to 3, which is characterized in that empty being arranged first for the mobile terminal
Quasi- network interface, and be that first equipment is arranged after the second virtual network port, further include:
Judge that first virtual network port identifies whether to identify to be default using the service of monitoring of preset virtual network port;
If so, monitoring the corresponding access interface of the first virtual network port described in service-creation by the virtual network port;Wherein, institute
It states the application program inside mobile terminal and first virtual network port is accessed by the access interface.
5. according to the method described in claim 2, it is characterized in that, it is described communication connection be general-purpose serial bus USB connect, with
The corresponding virtual network port setting function of communication connection is the remote network driver interface specification USB of universal serial bus
RNDIS functions.
6. a kind of mobile terminal, which is characterized in that including:
Network interface setup module, for being described after mobile terminal is communicated to connect with the first equipment with route forwarding function
The first virtual network port is arranged in mobile terminal, and the second virtual network port is arranged for first equipment;
Gateway setup module, the gateway for setting second virtual network port to first virtual network port;Wherein, described
Mobile terminal carries out network access by the route forwarding function of first equipment.
7. mobile terminal according to claim 6, which is characterized in that the network interface setup module is specifically used for:
Call virtual network port corresponding with the communication connection that function is set from the inner nuclear layer of the mobile terminal;
Function is arranged in the virtual network port based on calling, the first virtual network port is arranged for the mobile terminal, and be described
The second virtual network port is arranged in first equipment.
8. mobile terminal according to claim 6, which is characterized in that the gateway setup module is specifically used for:
The procotol IP distribution instructions to prestore are called, the first IP address is distributed for first virtual network port;
Dynamic host configuration protocol DHCP service is called, the second IP address is distributed for second virtual network port;
Based on first IP address and second IP address, call the gateway to prestore that instruction is set, it is virtual by described second
Network interface is set as the gateway of first virtual network port.
9. according to claim 6 to 8 any one of them mobile terminal, which is characterized in that further include:
Judgment module is identified, is used to that the first virtual network port to be arranged for the mobile terminal, and for first equipment be arranged
After second virtual network port, the identifying whether to be pre- of first virtual network port is judged using the service of monitoring of preset virtual network port
Bidding is known;
Interface creation module is used to correspond to if so, monitoring the first virtual network port described in service-creation by the virtual network port
Access interface;Wherein, the application program inside the mobile terminal accesses first virtual net by the access interface
Mouthful.
10. mobile terminal according to claim 7, which is characterized in that the communication connection is that general-purpose serial bus USB connects
It connects, virtual network port setting function corresponding with the communication connection is the remote network driver interface specification of universal serial bus
USB RNDIS functions.
11. a kind of mobile terminal, which is characterized in that including:It memory, processor and is stored on the memory and can be in institute
The computer program run on processor is stated, such as claim 1 to 5 is realized when the computer program is executed by the processor
Any one of described in Network Access Method the step of.
12. a kind of computer readable storage medium, which is characterized in that be stored with computer on the computer readable storage medium
Program realizes the Network Access Method as described in any one of claim 1 to 5 when the computer program is executed by processor
The step of.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810136765.6A CN108494639A (en) | 2018-02-09 | 2018-02-09 | Network access method and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810136765.6A CN108494639A (en) | 2018-02-09 | 2018-02-09 | Network access method and mobile terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108494639A true CN108494639A (en) | 2018-09-04 |
Family
ID=63340228
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810136765.6A Pending CN108494639A (en) | 2018-02-09 | 2018-02-09 | Network access method and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108494639A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110784404A (en) * | 2019-10-08 | 2020-02-11 | 烽火通信科技股份有限公司 | Method and device for adjusting multi-network-port equipment application program package sending strategy |
CN112511344A (en) * | 2020-11-18 | 2021-03-16 | 深圳创维-Rgb电子有限公司 | Master-slave equipment network sharing method and device and Internet of things equipment |
CN112888049A (en) * | 2021-01-26 | 2021-06-01 | 展讯半导体(成都)有限公司 | Data transmission control method, function machine and related product |
WO2023000969A1 (en) * | 2021-07-21 | 2023-01-26 | 荣耀终端有限公司 | Method for using cellular communication function, related apparatus, and system |
EP4106285A4 (en) * | 2020-02-18 | 2023-03-29 | Huawei Technologies Co., Ltd. | Information transmission method and related device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103220283A (en) * | 2013-04-08 | 2013-07-24 | 北京小米科技有限责任公司 | Method, equipment and system for network sharing |
CN103608794A (en) * | 2011-06-17 | 2014-02-26 | 阿尔卡特朗讯 | Method and apparatus for remote delivery of managed usb services via a mobile computing device |
CN104333867A (en) * | 2014-12-02 | 2015-02-04 | 上海斐讯数据通信技术有限公司 | Method and device for sharing PC network by virtue of mobile phone |
-
2018
- 2018-02-09 CN CN201810136765.6A patent/CN108494639A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103608794A (en) * | 2011-06-17 | 2014-02-26 | 阿尔卡特朗讯 | Method and apparatus for remote delivery of managed usb services via a mobile computing device |
CN103220283A (en) * | 2013-04-08 | 2013-07-24 | 北京小米科技有限责任公司 | Method, equipment and system for network sharing |
CN104333867A (en) * | 2014-12-02 | 2015-02-04 | 上海斐讯数据通信技术有限公司 | Method and device for sharing PC network by virtue of mobile phone |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110784404A (en) * | 2019-10-08 | 2020-02-11 | 烽火通信科技股份有限公司 | Method and device for adjusting multi-network-port equipment application program package sending strategy |
CN110784404B (en) * | 2019-10-08 | 2022-03-25 | 烽火通信科技股份有限公司 | Method and device for adjusting multi-network-port equipment application program package sending strategy |
EP4106285A4 (en) * | 2020-02-18 | 2023-03-29 | Huawei Technologies Co., Ltd. | Information transmission method and related device |
CN112511344A (en) * | 2020-11-18 | 2021-03-16 | 深圳创维-Rgb电子有限公司 | Master-slave equipment network sharing method and device and Internet of things equipment |
CN112511344B (en) * | 2020-11-18 | 2023-12-08 | 深圳创维-Rgb电子有限公司 | Master-slave equipment network sharing method and device and Internet of things equipment |
CN112888049A (en) * | 2021-01-26 | 2021-06-01 | 展讯半导体(成都)有限公司 | Data transmission control method, function machine and related product |
WO2023000969A1 (en) * | 2021-07-21 | 2023-01-26 | 荣耀终端有限公司 | Method for using cellular communication function, related apparatus, and system |
EP4224981A4 (en) * | 2021-07-21 | 2024-06-12 | Honor Device Co., Ltd. | Method for using cellular communication function, related apparatus, and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107770760B (en) | A kind of method and mobile terminal of the type identifying bluetooth equipment | |
CN108108007B (en) | A kind of processing method and mobile terminal reducing power consumption | |
CN108924817A (en) | A kind of SIM card state switching method and mobile terminal | |
CN108494639A (en) | Network access method and mobile terminal | |
CN109587789A (en) | Accidental access method, mobile terminal and the network equipment | |
CN110062104A (en) | Application program launching method, device and mobile terminal | |
CN107911445A (en) | A kind of information push method, mobile terminal and storage medium | |
CN109639313A (en) | A kind of communication control method, system and circuit | |
CN108762869A (en) | A kind of information processing method and mobile terminal | |
CN110442437A (en) | A kind of application switching method and mobile terminal | |
CN108345425A (en) | A kind of management method and mobile terminal of application | |
CN109558046A (en) | A kind of information display method and terminal device | |
CN109117256A (en) | A kind of management method and terminal of background application | |
CN108282759A (en) | A kind of method for processing business and mobile communication terminal | |
CN109831359A (en) | A kind of detection method and its terminal device of data network connection state | |
CN109889757A (en) | A kind of video call method and terminal device | |
CN108769202A (en) | A kind of information push method and its server and terminal device | |
CN109684825A (en) | A kind of right management method and terminal device | |
CN109101151A (en) | A kind of information display processing method and terminal device | |
CN109831582A (en) | Non- response events processing method and terminal | |
CN109005297A (en) | A kind of display methods and mobile terminal of navigation application | |
CN109445589A (en) | A kind of multimedia file broadcasting control method and terminal device | |
CN109002245A (en) | A kind of operating method and mobile terminal of application interface | |
CN108419283A (en) | A kind of method and mobile terminal of WIFI hot spot scanning | |
CN108289239A (en) | A kind of multimedia file broadcasting control method and mobile terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180904 |