CN113595777A - Network sharing method and system - Google Patents
Network sharing method and system Download PDFInfo
- Publication number
- CN113595777A CN113595777A CN202110835407.6A CN202110835407A CN113595777A CN 113595777 A CN113595777 A CN 113595777A CN 202110835407 A CN202110835407 A CN 202110835407A CN 113595777 A CN113595777 A CN 113595777A
- Authority
- CN
- China
- Prior art keywords
- network
- network sharing
- slave
- sharing
- host
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 86
- 238000004891 communication Methods 0.000 claims abstract description 29
- 230000006855 networking Effects 0.000 claims abstract description 23
- 230000007246 mechanism Effects 0.000 abstract description 3
- 230000006870 function Effects 0.000 description 19
- 230000005540 biological transmission Effects 0.000 description 10
- 230000008569 process Effects 0.000 description 10
- 238000006243 chemical reaction Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000005034 decoration Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a network sharing method and a system, comprising a host and a slave, wherein the host is in communication connection with the slave, and the method comprises the following steps: the master machine and the slave machines receive the network sharing notification; based on a network sharing protocol, the host generates a first virtual network card according to the network sharing notification, and the slave generates a second virtual network card according to the network sharing notification; the host computer carries out networking configuration on the first virtual network card; the host computer carries out network sharing configuration on the first virtual network card, or the slave computer carries out network sharing configuration on the second virtual network card; and the host and the slave share the network according to the network sharing protocol, the first virtual network card and the second virtual network card. The network sharing method provided by the invention ensures that the network sharing function is not limited between the PC and the mobile equipment, and two pieces of equipment of any type can realize network sharing, thereby avoiding the problems of radio frequency interference, poor signal and the like caused by mechanisms such as wifi sharing or Bluetooth sharing and the like, and improving the flexibility of the network sharing function.
Description
Technical Field
The present invention relates to the field of network sharing technologies, and in particular, to a network sharing method and system.
Background
At present, the mobile equipment on the market only supports the sharing of the network of the mobile equipment to the PC equipment through the rndi s protocol, the mobile equipment is connected with the PC equipment through a USB line, the mobile equipment can only serve as the device of the rndi s, the PC serves as the host of the rndi s, and the network of the mobile equipment serving as the device is shared to the PC equipment serving as the host through the rndi s protocol, so that the network of the mobile equipment is "borrowed" to surf the internet under the condition that the PC equipment does not have the network.
The method has two limitations, the first is to only support the network sharing between the mobile device and the PC, the second is to only share the network of the mobile device as the device to the PC device as the host, and there is no way to share the network of the host to the device in the reverse direction. However, as mobile phones become more and more popular, the use scenes of PCs become less and less, and the scenes of "borrowing" the network of the mobile devices to the PCs also become less and less, and instead, the requirement for network sharing among a plurality of mobile devices becomes stronger and stronger. In more and more scenes, sharing of a USB network may be achieved by connecting two mobile devices through a USB cable, so that network sharing of a mobile device as a device to a mobile device as a host (TCP/IP over USB connecting) may be achieved, and network sharing of a mobile device as a host to a mobile device as a device (TCP/IP over USB Reverse connecting) may be supported.
Therefore, a network sharing method is needed at present to solve the problem that the existing network sharing method is only limited to sharing between mobile devices and PC devices, and networks among a plurality of mobile devices cannot be shared with each other.
Disclosure of Invention
In order to solve the above technical problems, the present invention provides a network sharing method and system, and the specific technical solution is as follows:
the invention provides a network sharing method, which comprises a host and a slave, wherein the host is in communication connection with the slave, and the method comprises the following specific steps:
the master and the slave receive a network sharing notification;
based on a network sharing protocol, the host generates a first virtual network card according to the network sharing notification, and the slave generates a second virtual network card according to the network sharing notification;
the host computer carries out networking configuration on the first virtual network card;
the host computer performs network sharing configuration on the first virtual network card, or the slave computer performs the network sharing configuration on the second virtual network card;
and the host and the slave carry out network sharing according to the network sharing protocol, the first virtual network card and the second virtual network card.
The network sharing method provided by the invention is based on a network sharing protocol, and realizes the network sharing between two devices by generating the first virtual network card and the second virtual network card and respectively configuring the two network cards differently. The network sharing function is not limited between the PC and the mobile equipment, and the two pieces of equipment of any type can realize network sharing, thereby improving the flexibility of the network sharing function.
Further, the present invention also provides a network sharing method, where the host generates a first virtual network card according to the network sharing notification and the slave generates a second virtual network card according to the network sharing notification based on the network sharing protocol, specifically including:
the slave computer generates the second virtual network card according to the network sharing notification and the network sharing protocol;
the slave machine sends the network sharing notice to the host machine through the network sharing protocol;
and the host generates the first virtual network card according to the network sharing notification and the network sharing protocol.
The network sharing method provided by the invention introduces a process of respectively generating the first virtual network card and the second virtual network card by the host machine and the slave machine based on a network sharing protocol and a network sharing notice, thereby realizing the network sharing between the two devices and improving the flexibility of the application of the network sharing function.
Further, the present invention also provides a network sharing method:
wherein the network sharing notification comprises a first network sharing notification and a second network sharing notification, the first network sharing notification is used for notifying the host to share the network to the slave, and the second network sharing notification is used for notifying the slave to share the network to the host;
after the host performs networking configuration on the first virtual network card and before the host and the slave perform network sharing according to the network sharing protocol, the first virtual network card and the second virtual network card, the method specifically includes:
when the host and the slave receive the first network sharing notification, the slave performs the network sharing configuration on the second virtual network card, and the network sharing configuration includes configuring a gateway, adding a DNS service, and setting the first virtual network card as a soft route.
The network sharing method provided by the invention divides the network sharing notification into two notification types of a master-slave sharing network and a slave-master sharing network, and introduces the process of network sharing configuration when the master shares the network with the slave, thereby realizing the scheme of sharing the network from the master to the slave.
Further, the present invention provides a network sharing method, where after the host performs networking configuration on the first virtual network card, and before the host and the slave perform network sharing according to the network sharing protocol, the method specifically includes:
and when the host and the slave receive the second network sharing notification, the host performs network sharing configuration on the first virtual network card, wherein the network sharing configuration comprises gateway configuration, DNS service addition and soft routing of the second virtual network card.
The network sharing method provided by the invention introduces the process of network sharing configuration when the slave machine shares the network with the host machine, and realizes the scheme that the network is shared by the slave machine and the host machine, the network sharing function is not limited between a PC and a mobile device, and two devices of any type can realize network sharing.
Further, the present invention provides a network sharing method, before the network sharing is performed between the host and the slave according to the network sharing protocol, the first virtual network card and the second virtual network card, specifically including:
receiving, by the slave, the first network sharing notification;
the slave computer generates a second virtual network card based on the first network sharing notification and the network sharing protocol;
the slave machine sends the first network sharing notice to the host machine through the network sharing protocol;
the host generates the first virtual network card according to the first network sharing notification and the network sharing protocol;
after the host performs networking configuration on the first virtual network card according to the first network sharing notification, the host sends configuration completion information to the slave;
and after receiving the configuration completion information, the slave machine performs the network sharing configuration on the second virtual network card according to the first network sharing notification.
The network sharing method provided by the invention introduces the generation and configuration processes of the first virtual network card and the second virtual network card when the host machine shares the network to the slave machine, and only shares the network to the slave machine through communication connection on the basis of not adding any additional device, thereby realizing the network sharing between two devices.
Further, the present invention provides a network sharing method, before the network sharing is performed between the host and the slave according to the network sharing protocol, the first virtual network card and the second virtual network card, the method specifically includes:
receiving, by the slave, the second network sharing notification;
the slave computer generates a second virtual network card based on the second network sharing notification and the network sharing protocol;
the slave machine sends the second network sharing notice to the host machine through the network sharing protocol;
the host generates the first virtual network card according to the second network sharing notification and the network sharing protocol;
and the host carries out networking configuration and network sharing configuration on the first virtual network card according to the second network sharing notice.
The network sharing method provided by the invention introduces the generation and configuration processes of the first virtual network card and the second virtual network card when the slave machine shares the network to the host machine, and only shares the network to the host machine through communication connection on the basis of not adding any additional device, thereby realizing the network sharing between the two devices.
Further, the present invention provides a network sharing method, including:
a first network sharing mode for the master to share a network to the slave;
a second network sharing mode for the slave to share a network to the master;
and the mode switching switch is used for switching the first network sharing mode and the second network sharing mode through a switch.
The network sharing method provided by the invention introduces two network sharing modes, and sets the switch for switching the two sharing modes, so that the network of the host is flexibly shared to the slave or the network of the slave is shared to the host, and the flexibility of the network sharing function is improved.
Further, the present invention also provides a network sharing method, where the networking configuration specifically includes:
configuring an IP address, adding a data forwarding permission instruction, and a data delivery permission instruction.
Further, the invention also provides a network sharing method, wherein the network sharing protocol comprises RNDIS protocol;
the host computer is in communication connection with the slave computer, and specifically comprises:
the host and the slave are connected through USB communication.
Additionally, the present invention also provides a network sharing system, comprising:
a host;
the slave machine is in communication connection with the host machine;
the first receiving module is connected with the host and used for receiving the network sharing notification by the host;
the second receiving module is connected with the slave machine and used for receiving the network sharing notification from the slave machine;
the first virtual network card generating module is connected with the host and the first receiving module and used for generating a first virtual network card according to a network sharing protocol and the network sharing notification and carrying out networking configuration and network sharing configuration on the first virtual network card;
the second virtual network card generating module is connected with the slave machine and the second receiving module and used for generating a second virtual network card according to the network sharing protocol and the network sharing notification and carrying out the network sharing configuration on the second virtual network card;
the first network sharing module is connected with the host and the first virtual network card generating module and is used for the host to carry out network sharing according to the network sharing protocol, the first virtual network card and the second virtual network card;
and the second network sharing module is connected with the slave machine and the second virtual network card generating module and is used for carrying out network sharing on the slave machine according to the network sharing protocol, the first virtual network card and the second virtual network card.
The network sharing system provided by the invention is based on a network sharing protocol, and realizes the network sharing between two devices by generating the first virtual network card and the second virtual network card and respectively configuring the two network cards differently. The network sharing function is not limited between the PC and the mobile equipment, and the two pieces of equipment of any type can realize network sharing, thereby improving the flexibility of the network sharing function.
The invention provides a network sharing method and a system, which at least have the following beneficial effects:
1) the network sharing function is not limited between the PC and the mobile device, and two devices of any type can realize network sharing, so that the problems of radio frequency interference, poor signal and the like caused by mechanisms such as wifi sharing or Bluetooth sharing and the like are avoided, and the applicable flexibility of the network sharing function is improved;
2) the effect that the host machine shares the network to the slave machine or the slave machine shares the network to the host machine is realized only through communication connection on the basis of not adding any additional device, and the network sharing between the two devices is realized;
3) and two network sharing modes are introduced, and a switch is arranged for switching the two sharing modes, so that the network of the host is flexibly shared to the slave or the network of the slave is shared to the host.
Drawings
The above features, technical features, advantages and modes of implementing a network sharing method and system will be further described in the following detailed description of preferred embodiments in a clearly understandable manner, in conjunction with the accompanying drawings.
FIG. 1 is a flow chart of a network sharing method of the present invention;
FIG. 2 is a flowchart of a method for generating a virtual network card according to the present invention;
FIG. 3 is a flow chart of a master sharing a network with a slave according to a network sharing method of the present invention;
FIG. 4 is a flow chart of a slave sharing a network to a master in a network sharing method according to the present invention;
FIG. 5 is a flow chart of a network sharing method of the present invention;
FIG. 6 is another flow chart of a network sharing method of the present invention
Fig. 7 is a schematic diagram of a network sharing system according to the present invention.
Reference numbers in the figures: 10-host computer, 20-slave computer, 11-first receiving module, 21-second receiving module, 12-first virtual network card generating module, 22-second virtual network card generating module, 13-first network sharing module and 23-second network sharing module.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. However, it will be apparent to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
For the sake of simplicity, the drawings only schematically show the parts relevant to the present invention, and they do not represent the actual structure as a product. In addition, in order to make the drawings concise and understandable, components having the same structure or function in some of the drawings are only schematically illustrated or only labeled. In this document, "one" means not only "only one" but also a case of "more than one".
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
In addition, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not intended to indicate or imply relative importance.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following description will be made with reference to the accompanying drawings. It is obvious that the drawings in the following description are only some examples of the invention, and that for a person skilled in the art, other drawings and embodiments can be derived from them without inventive effort.
Example 1
An embodiment of the present invention, as shown in fig. 1, provides a network sharing method, including a master and a slave, where the master and the slave are in communication connection, including the steps of:
s100, the master and the slave receive the network sharing notification.
S200, based on the network sharing protocol, the host generates a first virtual network card according to the network sharing notification, and the slave generates a second virtual network card according to the network sharing notification.
Specifically, the network sharing notification is used for notifying the host and the slave to generate virtual network cards respectively according to the notification content.
The network sharing protocol is used for implementing a network sharing function between devices, and includes rndis (remote ndis) protocol and the like.
Preferably, the present embodiment may adopt RNDIS protocol, RNDIS refers to Remote NDIS, and implementing RNDIS based on USB is actually TCP/IP over USB thermal, that is, running TCP/IP on USB device, so that USB device looks like a network card.
The TCP/IP transport protocol, i.e., the transmission control/network protocol, is also called the network communication protocol. It is the most basic communication protocol in the use of networks. The TCP/IP transport protocol specifies the standards and methods for communicating between various parts of the internet. In addition, the TCP/IP transmission protocol is two important protocols for ensuring timely and complete transmission of network data information.
Preferably, the master is in communication connection with the slave, and specifically, the master and the slave are in communication connection through a USB.
S300, the host computer conducts networking configuration on the first virtual network card.
Preferably, the networking configuration includes configuring an IP address, adding a data forwarding permission instruction, and a data delivery permission instruction.
S400, the host computer performs network sharing configuration on the first virtual network card, or the slave computer performs network sharing configuration on the second virtual network card.
S500, the host and the slave share the network according to the network sharing protocol, the first virtual network card and the second virtual network card.
The network sharing method provided in this embodiment is based on a network sharing protocol, and implements network sharing between two devices by generating a first virtual network card and a second virtual network card, and performing different configurations on the two network cards, respectively. The network sharing function is not limited between the PC and the mobile device, network sharing can be realized by two devices of any types, the problems of radio frequency interference, poor signals and the like caused by mechanisms such as wifi sharing or Bluetooth sharing are avoided, and the flexibility of the network sharing function is improved.
Example 2
Based on embodiment 1 and as shown in fig. 2, the present invention provides a network sharing method, where step S200 is based on a network sharing protocol, a host generates a first virtual network card according to a network sharing notification, and a slave generates a second virtual network card according to the network sharing notification, and specifically includes:
s210, the slave computer generates a second virtual network card according to the network sharing notification and the network sharing protocol.
Specifically, the slave includes an rdis _ device control module, and the slave creates an rdis 0 network card through the rdis _ device control module.
S220, the slave machine sends a network sharing notice to the host machine through a network sharing protocol.
Specifically, the rndis _ device control module in the slave sends a network sharing notification to the master.
And S230, the host generates a first virtual network card according to the network sharing notification and the network sharing protocol.
Specifically, the rndis _ host control module in the host generates a usb0 network card.
The network sharing method provided by this embodiment introduces a process of generating the first virtual network card and the second virtual network card by the host and the slave, respectively, based on the network sharing protocol and the network sharing notification, so as to implement network sharing between two devices, and improve the flexibility of the network sharing function.
Example 3
Based on any one of embodiments 1 to 2, as shown in fig. 3, the present invention further provides a network sharing method:
the network sharing notification comprises a first network sharing notification and a second network sharing notification, the first network sharing notification is used for notifying the host to share the network to the slave, and the second network sharing notification is used for notifying the slave to share the network to the host. The network sharing method provided by the invention comprises the following steps:
s100, the master and the slave receive the network sharing notification.
S200, based on the network sharing protocol, the host generates a first virtual network card according to the network sharing notification, and the slave generates a second virtual network card according to the network sharing notification.
Specifically, the network sharing notification is used for notifying the host and the slave to generate virtual network cards respectively according to the notification content.
The network sharing protocol is used for implementing a network sharing function between devices, and includes rndis (remote ndis) protocol and the like.
Preferably, the present embodiment may adopt RNDIS protocol, RNDIS refers to Remote NDIS, and implementing RNDIS based on USB is actually TCP/IP over USB thermal, that is, running TCP/IP on USB device, so that USB device looks like a network card.
The TCP/IP transport protocol, i.e., the transmission control/network protocol, is also called the network communication protocol. It is the most basic communication protocol in the use of networks. The TCP/IP transport protocol specifies the standards and methods for communicating between various parts of the internet. In addition, the TCP/IP transmission protocol is two important protocols for ensuring timely and complete transmission of network data information.
Preferably, the master is in communication connection with the slave, and specifically, the master and the slave are in communication connection through a USB.
S300, the host computer conducts networking configuration on the first virtual network card.
Preferably, the networking configuration includes configuring an IP address, adding a data forwarding permission instruction, and a data delivery permission instruction.
S410, when the host and the slave receive the first network sharing notification, the slave performs network sharing configuration on the second virtual network card.
Specifically, the network sharing configuration comprises the steps of configuring a gateway, adding DNS service and setting a first virtual network card as a soft route.
Specifically, the gateway specifically refers to an internetwork connector, a protocol converter, and the like. The gateway realizes network interconnection at a transmission layer and is used for interconnection of two networks with different high-level protocols. The gateway is similar in structure to the router, except for the interconnect layer. The gateway can be used for interconnection of a wide area network and a local area network, and is a computer system or a device serving as a conversion task. Gateways typically connect networks between two systems that are in different communication protocols, data formats or languages, and even completely different architectures.
The dns (domain Name system) is a domain Name system, which is a naming system for computers and network services organized into a domain hierarchy, uses a port number 53 of the UDP protocol, which is used for TCP/IP networks, and provides services for converting host names and domain names into IP addresses.
The soft routing refers to setting a hardware device as a service of a router through network setting, and in this embodiment, a DNS service and an rndis protocol are added to set an rndis0 network card generated by a device as the router through configuring a gateway.
S500, the host and the slave share the network according to the network sharing protocol, the first virtual network card and the second virtual network card.
The network sharing method provided by this embodiment divides the network sharing notification into two notification types, namely, a master-to-slave sharing network and a slave-to-master sharing network, and introduces a network sharing configuration process when the master shares the network with the slave, thereby implementing a scheme of sharing the network from the master to the slave.
Example 4
Based on any one of embodiments 1 to 2, as shown in fig. 4, the present invention further provides a network sharing method, where after configuring the first virtual network card in a networking manner by the host in step S300, and before performing network sharing between the host and the slave according to the network sharing protocol and the first virtual network card and the second virtual network card in step S500, the method specifically includes:
s420, when the host and the slave receive the second network sharing notification, the host performs network sharing configuration on the first virtual network card, wherein the network sharing configuration comprises gateway configuration, DNS service addition and soft routing of the second virtual network card.
Specifically, the gateway specifically refers to an internetwork connector, a protocol converter, and the like. The gateway realizes network interconnection at a transmission layer and is used for interconnection of two networks with different high-level protocols. The gateway is similar in structure to the router, except for the interconnect layer. The gateway can be used for interconnection of a wide area network and a local area network, and is a computer system or a device serving as a conversion task. Gateways typically connect networks between two systems that are in different communication protocols, data formats or languages, and even completely different architectures.
The dns (domain Name system) is a domain Name system, which is a naming system for computers and network services organized into a domain hierarchy, uses a port number 53 of the UDP protocol, which is used for TCP/IP networks, and provides services for converting host names and domain names into IP addresses.
The soft routing refers to setting a hardware device as a service of a router through network setting, and in this embodiment, a DNS service and an rndis protocol are added to set an rndis0 network card generated by a device as the router through configuring a gateway.
The network sharing method provided by this embodiment introduces a process of network sharing configuration when the slave machine shares the network with the host machine, and implements a scheme of sharing the network from the slave machine to the host machine, and the network sharing function is not limited between the PC and the mobile device, and two devices of any type can implement network sharing.
Example 5
Based on embodiment 3, as shown in fig. 5, the present invention further provides a network sharing method, where before the network sharing is performed between the host and the slave according to the network sharing protocol, the method specifically includes:
s110 the slave receives a first tethering notification.
S211, the slave computer generates a second virtual network card based on the first network sharing notification and the network sharing protocol.
Specifically, the slave includes an rdis _ device control module, and the slave creates an rdis 0 network card through the rdis _ device control module.
S221 the slave sends a first tethering notification to the master via the tethering protocol.
Specifically, the rdis _ device control module in the slave sends a first network sharing notification to the master.
S231, the host generates a first virtual network card according to the first network sharing notification and the network sharing protocol.
Specifically, the rndis _ host control module in the host generates a usb0 network card.
S310, after the host machine conducts networking configuration on the first virtual network card according to the first network sharing notice, configuration completion information is sent to the slave machine.
And S411, after receiving the configuration completion information from the slave computer, performing network sharing configuration on the second virtual network card according to the first network sharing notification.
Specifically, the network sharing configuration comprises the steps of configuring a gateway, adding DNS service and setting the second virtual network card as a soft route.
Specifically, the gateway refers to an internetwork connector, a protocol converter, and the like. The gateway realizes network interconnection at a transmission layer and is used for interconnection of two networks with different high-level protocols. The gateway is similar in structure to the router, except for the interconnect layer. The gateway can be used for interconnection of a wide area network and a local area network, and is a computer system or a device serving as a conversion task. Gateways typically connect networks between two systems that are in different communication protocols, data formats or languages, and even completely different architectures.
The dns (domain Name system) is a domain Name system, which is a naming system for computers and network services organized into a domain hierarchy, uses a port number 53 of the UDP protocol, which is used for TCP/IP networks, and provides services for converting host names and domain names into IP addresses.
The soft routing refers to setting a hardware device as a service of a router through network setting, and in this embodiment, a DNS service and an rndis protocol are added to set an rndis0 network card generated by a device as the router through configuring a gateway.
The network sharing method provided by the invention introduces the generation and configuration processes of the first virtual network card and the second virtual network card when the host machine shares the network to the slave machine, and only shares the network to the slave machine through communication connection on the basis of not adding any additional device, thereby realizing the network sharing between two devices.
Example 6
Based on embodiment 4, as shown in fig. 6, the present invention further provides a network sharing method, where before the S500 network sharing is performed between the host and the slave according to the network sharing protocol, the method specifically includes:
s120 the slave receives a second tethering notification.
S212, the slave computer generates a second virtual network card based on the second network sharing notification and the network sharing protocol.
Specifically, the slave includes an rdis _ device control module, and the slave creates an rdis 0 network card through the rdis _ device control module.
S222 the slave sends a second tethering notification to the master via the tethering protocol.
Specifically, the rdis _ device control module in the slave sends the second network sharing notification to the master.
And S232, the host generates a first virtual network card according to the second network sharing notification and the network sharing protocol.
Specifically, the rndis _ host control module in the host generates a usb0 network card.
And S320, the host computer performs networking configuration and network sharing configuration on the first virtual network card according to the first network sharing notification.
Specifically, the network sharing configuration comprises the steps of configuring a gateway, adding DNS service and setting a first virtual network card as a soft route.
Specifically, the gateway refers to an internetwork connector, a protocol converter, and the like. The gateway realizes network interconnection at a transmission layer and is used for interconnection of two networks with different high-level protocols. The gateway is similar in structure to the router, except for the interconnect layer. The gateway can be used for interconnection of a wide area network and a local area network, and is a computer system or a device serving as a conversion task. Gateways typically connect networks between two systems that are in different communication protocols, data formats or languages, and even completely different architectures.
The dns (domain Name system) is a domain Name system, which is a naming system for computers and network services organized into a domain hierarchy, uses a port number 53 of the UDP protocol, which is used for TCP/IP networks, and provides services for converting host names and domain names into IP addresses.
The soft routing refers to setting a hardware device as a service of a router through network setting, and in this embodiment, a DNS service and an rndis protocol are added to set an rndis0 network card generated by a device as the router through configuring a gateway.
The network sharing method provided by this embodiment introduces a generation and configuration process of the first virtual network card and the second virtual network card when the slave shares the network to the host, and shares the network to the host through communication connection only on the basis of not adding any additional device, thereby realizing network sharing between two devices.
Example 7
Based on any one of embodiments 1 to 6, the present invention further provides a network sharing method, further including:
and the first network sharing mode is used for the master to share the network to the slave.
The first network sharing mode and the second network sharing mode are used for the slave machines to share the network to the master machine.
And the mode switching switch is used for switching the first network sharing mode and the second network sharing mode.
The network sharing method provided by the embodiment introduces two network sharing modes, and sets the switch for switching the two sharing modes, so that the network of the master is flexibly shared to the slave or the network of the slave is flexibly shared to the master, and the flexibility of the network sharing function is improved.
Example 8
In addition, the present invention also provides a network sharing system, as shown in fig. 7, including a master 10, a slave 20, a network interface, a network,
Wherein the slave 20 is communicatively connected to the master 10.
And a first receiving module 11 connected to the host 10, configured to receive the network sharing notification by the host 10.
The second receiving module 21 is connected to the slave 20, and is configured to receive the network sharing notification from the slave 20.
The first virtual network card generating module 12 is connected to the host 10 and the first receiving module 11, and configured to generate a first virtual network card according to a network sharing protocol and a network sharing notification, and perform networking configuration and network sharing configuration on the first virtual network card.
The second virtual network card generating module 22 is connected to the slave 20 and the second receiving module 21, and is configured to generate a second virtual network card according to the network sharing protocol and the network sharing notification, and perform network sharing configuration on the second virtual network card.
The first network sharing module 13 is connected to the host 10 and the first virtual network card generating module 12, and is configured to perform network sharing on the host 10 according to a network sharing protocol, the first virtual network card, and the second virtual network card.
The second network sharing module 23 is connected to the slave 20 and the second virtual network card generating module 22, and is configured to perform network sharing on the slave 20 according to a network sharing protocol and the first virtual network card and the second virtual network card.
The network sharing system provided by the invention is based on a network sharing protocol, and realizes the network sharing between two devices by generating the first virtual network card and the second virtual network card and respectively configuring the two network cards differently. The network sharing function is not limited between the PC and the mobile equipment, and the two pieces of equipment of any type can realize network sharing, thereby improving the flexibility of the network sharing function.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or recited in detail in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed network sharing method and system may be implemented in other ways. For example, the network sharing method and system embodiments described above are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units or integrated circuits, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
It should be noted that the above embodiments can be freely combined as necessary. The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (10)
1. A network sharing method, comprising a master and a slave, wherein the master is connected to the slave in communication, the method comprising the steps of:
the master and the slave receive a network sharing notification;
based on a network sharing protocol, the host generates a first virtual network card according to the network sharing notification, and the slave generates a second virtual network card according to the network sharing notification;
the host computer carries out networking configuration on the first virtual network card;
the host computer performs network sharing configuration on the first virtual network card, or the slave computer performs the network sharing configuration on the second virtual network card;
and the host and the slave carry out network sharing according to the network sharing protocol, the first virtual network card and the second virtual network card.
2. The network sharing method according to claim 1, wherein the generating, by the master, a first virtual network card according to the network sharing notification and the generating, by the slave, a second virtual network card according to the network sharing notification, based on the network sharing protocol specifically include:
the slave computer generates the second virtual network card according to the network sharing notification and the network sharing protocol;
the slave machine sends the network sharing notice to the host machine through the network sharing protocol;
and the host generates the first virtual network card according to the network sharing notification and the network sharing protocol.
3. The network sharing method according to claim 1, wherein:
the network sharing notification comprises a first network sharing notification and a second network sharing notification, wherein the first network sharing notification is used for notifying the host to share the network to the slave, and the second network sharing notification is used for notifying the slave to share the network to the host;
after the host performs networking configuration on the first virtual network card and before the host and the slave perform network sharing according to the network sharing protocol, the first virtual network card and the second virtual network card, the method specifically includes:
when the host and the slave receive the first network sharing notification, the slave performs the network sharing configuration on the second virtual network card, and the network sharing configuration includes configuring a gateway, adding a DNS service, and setting the first virtual network card as a soft route.
4. The network sharing method according to claim 3, wherein after the host performs networking configuration on the first virtual network card, and before the host and the slave perform network sharing according to the network sharing protocol, the first virtual network card, and the second virtual network card, the method further comprises:
and when the host and the slave receive the second network sharing notification, the host performs network sharing configuration on the first virtual network card, wherein the network sharing configuration comprises gateway configuration, DNS service addition and soft routing of the second virtual network card.
5. The network sharing method according to claim 3, wherein before the master and the slave perform network sharing according to the network sharing protocol, the first virtual network card and the second virtual network card, the method specifically comprises:
receiving, by the slave, the first network sharing notification;
the slave computer generates a second virtual network card based on the first network sharing notification and the network sharing protocol;
the slave machine sends the first network sharing notice to the host machine through the network sharing protocol;
the host generates the first virtual network card according to the first network sharing notification and the network sharing protocol;
after the host performs networking configuration on the first virtual network card according to the first network sharing notification, the host sends configuration completion information to the slave;
and after receiving the configuration completion information, the slave machine performs the network sharing configuration on the second virtual network card according to the first network sharing notification.
6. The network sharing method according to claim 4, wherein before the master and the slave perform network sharing according to the network sharing protocol, the first virtual network card, and the second virtual network card, the method further comprises:
receiving, by the slave, the second network sharing notification;
the slave computer generates a second virtual network card based on the second network sharing notification and the network sharing protocol;
the slave machine sends the second network sharing notice to the host machine through the network sharing protocol;
the host generates the first virtual network card according to the second network sharing notification and the network sharing protocol;
and the host carries out networking configuration and network sharing configuration on the first virtual network card according to the second network sharing notice.
7. The network sharing method according to any one of claims 1 to 6, further comprising:
a first network sharing mode for the master to share a network to the slave
A second network sharing mode for the slave to share a network to the master;
a mode switch for switching the first network sharing mode and the second network sharing mode.
8. The network sharing method according to claim 7, wherein the networking configuration specifically includes:
configuring an IP address, adding a data forwarding permission instruction, and a data delivery permission instruction.
9. The network sharing method according to any one of claims 1 to 6 and 8, wherein:
the network sharing protocol comprises RNDIS protocol;
the host computer is in communication connection with the slave computer, and specifically comprises:
the host and the slave are connected through USB communication.
10. A network sharing system, comprising:
a host;
the slave machine is in communication connection with the host machine;
the first receiving module is connected with the host and used for receiving the network sharing notification by the host;
the second receiving module is connected with the slave machine and used for receiving the network sharing notification from the slave machine;
the first virtual network card generating module is connected with the host and the first receiving module and used for generating a first virtual network card according to a network sharing protocol and the network sharing notification and carrying out networking configuration and network sharing configuration on the first virtual network card;
the second virtual network card generating module is connected with the slave machine and the second receiving module and used for generating a second virtual network card according to the network sharing protocol and the network sharing notification and carrying out the network sharing configuration on the second virtual network card;
the first network sharing module is connected with the host and the first virtual network card generating module and is used for the host to carry out network sharing according to the network sharing protocol, the first virtual network card and the second virtual network card;
and the second network sharing module is connected with the slave machine and the second virtual network card generating module and is used for carrying out network sharing on the slave machine according to the network sharing protocol, the first virtual network card and the second virtual network card.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110835407.6A CN113595777B (en) | 2021-07-23 | 2021-07-23 | Network sharing method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110835407.6A CN113595777B (en) | 2021-07-23 | 2021-07-23 | Network sharing method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113595777A true CN113595777A (en) | 2021-11-02 |
CN113595777B CN113595777B (en) | 2024-01-23 |
Family
ID=78249231
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110835407.6A Active CN113595777B (en) | 2021-07-23 | 2021-07-23 | Network sharing method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113595777B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114827235A (en) * | 2022-06-28 | 2022-07-29 | 润芯微科技(江苏)有限公司 | Method for realizing network sharing based on UWB |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103532802A (en) * | 2013-10-11 | 2014-01-22 | 小米科技有限责任公司 | Method and device for network sharing, and terminal equipment |
WO2014169859A1 (en) * | 2013-10-10 | 2014-10-23 | 中兴通讯股份有限公司 | Network data processing method, terminal and data card |
CN104333867A (en) * | 2014-12-02 | 2015-02-04 | 上海斐讯数据通信技术有限公司 | Method and device for sharing PC network by virtue of mobile phone |
CN105636176A (en) * | 2016-03-24 | 2016-06-01 | 北京小米移动软件有限公司 | Network sharing method and device |
CN108462701A (en) * | 2018-02-12 | 2018-08-28 | 武汉卡比特信息有限公司 | A kind of shared cell phone network connecting internet system and method for exempting from hot spot |
CN112312378A (en) * | 2019-07-29 | 2021-02-02 | ***通信集团山东有限公司 | Sharing method and device of operator network and core network equipment |
-
2021
- 2021-07-23 CN CN202110835407.6A patent/CN113595777B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2014169859A1 (en) * | 2013-10-10 | 2014-10-23 | 中兴通讯股份有限公司 | Network data processing method, terminal and data card |
CN103532802A (en) * | 2013-10-11 | 2014-01-22 | 小米科技有限责任公司 | Method and device for network sharing, and terminal equipment |
CN104333867A (en) * | 2014-12-02 | 2015-02-04 | 上海斐讯数据通信技术有限公司 | Method and device for sharing PC network by virtue of mobile phone |
CN105636176A (en) * | 2016-03-24 | 2016-06-01 | 北京小米移动软件有限公司 | Network sharing method and device |
CN108462701A (en) * | 2018-02-12 | 2018-08-28 | 武汉卡比特信息有限公司 | A kind of shared cell phone network connecting internet system and method for exempting from hot spot |
CN112312378A (en) * | 2019-07-29 | 2021-02-02 | ***通信集团山东有限公司 | Sharing method and device of operator network and core network equipment |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114827235A (en) * | 2022-06-28 | 2022-07-29 | 润芯微科技(江苏)有限公司 | Method for realizing network sharing based on UWB |
Also Published As
Publication number | Publication date |
---|---|
CN113595777B (en) | 2024-01-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102124449B (en) | Method and system for low-overhead data transfer | |
CN102084625B (en) | Communication module and method for connecting an electrical device to a network | |
US6519290B1 (en) | Integrated radio frequency interface | |
RU2543558C2 (en) | Input/output routing method and device and card | |
US20030086421A1 (en) | Multiple-domain processing system using hierarchically orthogonal switching fabric | |
CN105162858A (en) | General transmission protocol frame aimed at CORBA middleware, communication system and method | |
JP2001356847A (en) | Electronic system | |
CN101228762A (en) | System and method for accessing a web server on a device with a dynamic IP-address residing a firewall | |
CN100484003C (en) | Server | |
CN101848154B (en) | System based on advanced telecom computation architecture | |
AU2009200973B2 (en) | Device with Ethernet switch function and single Ethernet connector | |
CN113595777A (en) | Network sharing method and system | |
KR100257712B1 (en) | Information exchange device between processes using internet | |
JP2017527135A (en) | Systems and methods for multiple network access by mobile computing devices | |
CN112350795B (en) | Data transmission method and device, storage medium and electronic device | |
JP5220871B2 (en) | Techniques for distributed management of wireless devices with shared resources between wireless components | |
US7558257B2 (en) | Information switch | |
Schneidewind | Interconnecting local networks to long-distance networks | |
JPH0827770B2 (en) | Telecommunication packet switching equipment | |
CN102004716A (en) | System and method for realizing device sharing | |
CN114697388B (en) | Data transmission method and device | |
TW582150B (en) | Modular switch system on high-speed serial bus | |
CN110098989A (en) | A kind of multichannel CAN analogue system and test method based on CANFD bus | |
CN106330787B (en) | Data packet transmission method, equipment and system | |
CN103535110A (en) | Wireless communication for point-to-point serial link protocol |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |