Network connection method and device, electronic equipment and storage medium
By using a point-to-point network card to create group clients and establish a point-to-point connection in the device network sharing, problems such as the inability to share directional traffic and display mobile network signals in the prior art are solved, and the first terminal is able to connect to the Internet through the mobile communication network of the second terminal, and the scope of use and user experience of the network connection are improved.
Patent Information
- Application Number
- CN202311403258.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-26
- Publication Date
- 2025-04-29
AI Technical Summary
The prior art cannot effectively share the directional traffic of the terminal that provides mobile communication network capabilities in device network sharing, and cannot display information such as mobile network signals or traffic usage prompts, and there are limitations such as system video caching mechanism.
Create a group client through a point-to-point network card, and establish a point-to-point connection with the wireless access point of the second terminal, connect to the Internet using the mobile communication network of the second terminal, and register the network type of the point-to-point network card as a mobile communication network, and configure the routing address and DNS server address to realize the virtualization of the network type and display of prompt information.
The first terminal connects to the Internet through the mobile communication network of the second terminal, improves the scope of network connection, and supports displaying mobile network signals and traffic usage prompts, improves user experience, and realizes multi-device sharing of the mobile communication network.
Smart Images

Figure CN119907138A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to a network connection method, device, electronic device and storage medium. Background Art
[0002] Device network sharing is the current trend. In the device network sharing state, one terminal device can use the mobile communication network of another terminal device to connect to the Internet.
[0003] In the network sharing method of the related art, the terminal device side that provides the mobile communication network capability needs to turn on the hotspot, virtualize itself into a wireless access point device, and use the terminal device side of the mobile communication network to enable the WLAN (Wireless Local Area Network) network card to connect in WLAN mode. Summary of the invention
[0004] In order to overcome the problems existing in the related art, the present disclosure provides a network connection method, device, electronic device and storage medium.
[0005] According to a first aspect of an embodiment of the present disclosure, a network connection method is provided, which is applied to a first terminal, and the method includes:
[0006] Create group clients via peer-to-peer network cards;
[0007] A point-to-point connection with a wireless access point of a second terminal is established through the group client, and the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
[0008] In some embodiments, the method further comprises:
[0009] Sending a request for acquiring wireless access point parameters to the second terminal;
[0010] In response to receiving the wireless access point parameters sent by the second terminal, enabling the point-to-point network card, wherein the wireless access point parameters are sent when the second terminal determines to create the wireless access point.
[0011] In some implementations, the sending a request for acquiring wireless access point parameters to the second terminal includes:
[0012] Obtaining identity authentication information of the second terminal;
[0013] In response to the identity authentication of the second terminal being successful according to the identity authentication information, a request for acquiring the wireless access point parameters is sent to the second terminal.
[0014] In some implementations, the obtaining the identity authentication information of the second terminal includes:
[0015] The broadcast information is received through the Bluetooth protocol, where the broadcast information includes the identity authentication information.
[0016] In some embodiments, the method further comprises:
[0017] The network type of the peer-to-peer network card is registered as a mobile communication network, and a routing address and a DNS server address are configured for the mobile communication network.
[0018] In some implementations, after establishing the point-to-point connection with the second terminal, the method further includes:
[0019] Prompt information is displayed, wherein the prompt information includes at least one of the following: first prompt information for prompting that the network currently in use is the mobile communication network, and second prompt information for prompting a frequency band of the mobile communication network currently in use.
[0020] According to a second aspect of an embodiment of the present disclosure, a network connection method is provided, which is applied to a second terminal, and the method includes:
[0021] Receiving a point-to-point connection request sent by a group client created by the first terminal;
[0022] In response to the point-to-point connection request, a point-to-point connection is established between the group of clients through the created wireless access point, and the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
[0023] In some embodiments, the method further comprises:
[0024] receiving a request sent by the first terminal for acquiring wireless access point parameters;
[0025] In response to the request for acquiring the wireless access point parameters, the wireless access point parameters are sent to the first terminal, and the wireless access point parameters are used by the group client of the first terminal to send the point-to-point connection request.
[0026] In some implementations, in response to the request for acquiring the wireless access point parameters, sending the wireless access point parameters to the first terminal includes:
[0027] In response to the request for acquiring the wireless access point parameters, if it is determined that the wireless access point has not been created, creating the wireless access point and sending the wireless access point parameters to the first terminal;
[0028] In response to the request for acquiring the wireless access point parameters, if it is determined to create the wireless access point, the wireless access point parameters are sent to the first terminal.
[0029] In some implementations, before receiving the request sent by the first terminal for acquiring wireless access point parameters, the method further includes:
[0030] Sending identity authentication information to the first terminal, where the identity authentication information is used by the first terminal to authenticate the second terminal, wherein the request for obtaining wireless access point parameters is sent by the first terminal when the identity authentication of the second terminal is successful.
[0031] In some implementations, the sending identity authentication information to the first terminal includes:
[0032] The broadcast information is periodically sent through the Bluetooth protocol, and the broadcast information includes identity authentication information.
[0033] According to a third aspect of an embodiment of the present disclosure, a network connection method is provided, the method comprising:
[0034] The first terminal creates a group client through a point-to-point network card;
[0035] The first terminal sends a point-to-point connection request to the second terminal through the created group of clients;
[0036] The second terminal establishes a point-to-point connection with the group of clients through the created wireless access point in response to the point-to-point connection request, wherein the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
[0037] In some implementations, according to a fourth aspect of an embodiment of the present disclosure, a network connection device is provided, the device comprising:
[0038] A creation module configured to create a group client via a peer-to-peer network card;
[0039] The first establishing module is configured to establish a point-to-point connection with the wireless access point of the second terminal through the group client, and the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
[0040] In some implementations, according to a fifth aspect of an embodiment of the present disclosure, a network connection device is provided, the device comprising:
[0041] A first receiving module is configured to receive a point-to-point connection request sent by a group client created by the first terminal;
[0042] The second establishing module is configured to establish a point-to-point connection with the group of clients through the created wireless access point in response to the point-to-point connection request, wherein the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
[0043] According to a sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the network connection method provided in the first aspect or the second aspect of the present disclosure are implemented.
[0044] According to the seventh aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a memory on which a computer program is stored; and a processor for executing the computer program in the memory to implement the steps of the network connection method mentioned in the first aspect or the second aspect of the present disclosure.
[0045] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0046] After the first terminal creates a group client through a point-to-point network card, it can establish a point-to-point connection with the wireless access point of the second terminal through the group client, so that when the second terminal accesses the mobile communication network, the first terminal can connect to the Internet through the mobile communication network of the second terminal. It can be seen that the embodiment of the present disclosure proposes a new method for realizing the connection of the first terminal to the Internet. In addition, in the network connection method of the embodiment of the present disclosure, since the first terminal uses the mobile communication network of the second terminal to connect to the Internet through a point-to-point connection, and does not use the WLAN method, based on the data sharing characteristics of the point-to-point connection, the first terminal can use the network capabilities of the second terminal including directional traffic, thereby improving the scope of use of the network connection. In addition, in the embodiment of the present disclosure, since the second terminal is used as the group owner in the point-to-point connection, the first terminal uses the mobile communication network of the second terminal as a group client to connect to the Internet, so that the mobile communication network of the second terminal can be shared on multiple first terminal devices.
[0047] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0049] Figure 1 It is a schematic diagram showing an application scenario according to an exemplary embodiment of the present disclosure.
[0050] Figure 2 The figure is a flow chart of a network connection method according to an exemplary embodiment of the present disclosure.
[0051] Figure 3 It is a software architecture diagram of a first terminal and a second terminal according to an exemplary embodiment of the present disclosure.
[0052] Figure 4 The figure is a flowchart of another network connection method according to an exemplary embodiment of the present disclosure.
[0053] Figure 5 The figure is a flowchart of another network connection method according to an exemplary embodiment of the present disclosure.
[0054] Figure 6 The diagram is an interaction diagram showing a network connection method according to an exemplary embodiment of the present disclosure.
[0055] Figure 7 The figure is a structural block diagram of a network connection device according to an exemplary embodiment of the present disclosure.
[0056] Figure 8 It is a structural block diagram of another network connection device according to an exemplary embodiment of the present disclosure.
[0057] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0058] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0059] In the description of the present disclosure and the appended claims, the terms “first”, “second”, etc. are merely used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0060] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.
[0061] As described in the background technology, in the network sharing method of the related technology, the terminal device side that provides mobile communication network capabilities needs to turn on the hotspot, virtualize itself into a wireless access point device, and use the terminal device side of the mobile communication network to enable the WLAN network card to connect in WLAN mode. The applicant has found in long-term research that this network sharing method has certain limitations. For example, it is impossible to share the directional traffic of the terminal that provides mobile communication network capabilities, such as the King Card traffic. For example, it is impossible to display mobile network signals, or traffic usage prompts and other information. For example, the system has no video caching mechanism and other limitations.
[0062] Therefore, an embodiment of the present disclosure provides a network connection method to at least partially solve the above technical problems.
[0063] Before describing the embodiments of the present disclosure, the scenarios of the embodiments of the present disclosure are described first.
[0064] like Figure 1 As shown, the first terminal 11 establishes a point-to-point connection with the wireless access point of the second terminal 12 through the created group client. Then, when the second terminal 12 turns on the mobile communication network use switch, the first terminal 11 can use the mobile communication network of the second terminal 12 to connect to the Internet through the established point-to-point connection.
[0065] Among them, the full name of peer to peer (P2P) connection is WIFI peer to peer connection, also known as WIFI direct connection (Wi-Fi Direct).
[0066] Among them, after establishing a point-to-point connection, according to the Wi-Fi Direct technical specification, it is necessary to establish a group owner (Group Owner, GO) and a group client (Group Client, GC). In the embodiment of the present disclosure, the wireless access point serves as the group owner in the point-to-point connection.
[0067] In the embodiment of the present disclosure, the first terminal 11 may be a terminal with mobile communication network capability, or a terminal without mobile communication network capability, such as a terminal that only supports WIFI communication, i.e., a WIFI only terminal. The second terminal 12 may be a terminal with mobile communication network capability. Among them, having mobile communication network capability can be understood as being able to use a mobile communication network to connect to the Internet. The mobile communication network may also be referred to as a cellular mobile network, including but not limited to: Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time-division code division multiple access (TD-SCDMA), etc.
[0068] In the embodiments of the present disclosure, the first terminal and the second terminal may be a mobile phone, a tablet, a computer, an Internet of Things device, a smart wearable device, etc.
[0069] It should be noted that Figure 1 Only one first terminal 11 is used as an example for illustration, and in different scenario requirements, the number of first terminals 11 can be one or more. That is, according to actual scenario requirements, the second terminal 12 can share the mobile communication network with one or more first terminals 11, so that one or more first terminals 11 can use the mobile communication network of the second terminal 12 to connect to the Internet.
[0070] The present disclosure is described below in conjunction with specific embodiments.
[0071] Figure 2 is a flowchart of a network connection method according to an exemplary embodiment. Figure 1 The first terminal in the method may include:
[0072] S210, creating a group client through a point-to-point network card.
[0073] S220, establishing a point-to-point connection with the wireless access point of the second terminal through the group client, where the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
[0074] By adopting the above method, after the first terminal creates a group client through a point-to-point network card, it can establish a point-to-point connection with the wireless access point of the second terminal through the group client, so that when the second terminal accesses the mobile communication network, the first terminal can connect to the Internet through the mobile communication network of the second terminal. It can be seen that the embodiment of the present disclosure proposes a new method for realizing the connection of the first terminal to the Internet. In addition, in the network connection method of the embodiment of the present disclosure, since the first terminal uses the mobile communication network of the second terminal to connect to the Internet through a point-to-point connection, and does not use the WLAN method, based on the data sharing characteristics of the point-to-point connection, the first terminal can use the network capabilities of the second terminal including directional traffic, thereby improving the scope of use of the network connection. In addition, in the embodiment of the present disclosure, since the second terminal is used as the group owner in the point-to-point connection, the first terminal uses the mobile communication network of the second terminal as a group client to connect to the Internet, so that the mobile communication network of the second terminal can be shared on multiple first terminal devices. In addition, in the second terminal providing the mobile communication network, a wireless access point is created as the group owner in the point-to-point connection, which can cover more scenarios and support more devices.
[0075] In some embodiments, when the first terminal is connected to the Internet through the mobile communication network of the second terminal, the first terminal can send the data to be sent to the Internet to the second terminal through the point-to-point connection between the group client and the wireless access point, and then the data network card of the second terminal uses the mobile communication network to send the data to the Internet. After the second terminal receives the data sent from the Internet to the first terminal through the data network card, it can send the received data to the first terminal through the point-to-point connection. Thus, through the above process, the function of the first terminal connecting to the Internet using the mobile communication network of the second terminal through the point-to-point connection is realized.
[0076] In some implementations, the method of the embodiment of the present disclosure may further include the following steps:
[0077] A request for acquiring wireless access point parameters is sent to the second terminal; in response to receiving the wireless access point parameters sent by the second terminal, a point-to-point network card is enabled, wherein the wireless access point parameters are sent when the second terminal determines to create a wireless access point.
[0078] In the disclosed embodiment, the first terminal may send a request for obtaining wireless access point parameters to the second terminal. After receiving the request for obtaining wireless access point parameters, the second terminal may send the wireless access point parameters corresponding to the created wireless access point to the first terminal. Then, when the first terminal receives the wireless access point parameters sent by the second terminal, it enables the point-to-point network card so that a group client can be created through the point-to-point network card later, thereby ensuring the successful establishment of a point-to-point connection and avoiding wasting resources. In addition, by obtaining the wireless access point parameters by sending a request to the second terminal, and enabling the point-to-point network card when the wireless access point parameters are obtained, a point-to-point connection is established by interconnecting the first terminal and the second terminal, thereby improving the convenience of network connection.
[0079] In some embodiments, after enabling the point-to-point network card and creating a group client through the point-to-point network card, the first terminal can send a point-to-point connection request to the second terminal through the group client. After receiving the point-to-point connection request, the second client can establish a point-to-point connection with the group client through the created wireless access point.
[0080] In some implementations, enabling the peer-to-peer network card may be enabling a p2p interface in a WiFi module included in the first terminal.
[0081] In some implementations, the wireless access point parameters may include a SSID (Service Set Identifier) and a password of the wireless access point.
[0082] In the disclosed embodiment, considering that there may be multiple group clients in a point-to-point connection, but only one wireless access point needs to be created, therefore, if the group client requests to obtain wireless access point parameters when the second terminal has not yet created a wireless access point, the second terminal needs to first create the wireless access point, and if the group client requests to obtain the wireless access point parameters when the second terminal has already created a wireless access point, the second terminal can send the wireless access point parameters corresponding to the created wireless access point to the first terminal.
[0083] Therefore, in some implementations, the first terminal may send a request for obtaining wireless access point parameters to the second terminal. After receiving the request for obtaining wireless access point parameters, the second terminal may respond to the request for obtaining wireless access point parameters and first determine whether a wireless access point has been created. If it is determined that the wireless access point has not been created, the wireless access point is created and then the wireless access point parameters are sent to the first terminal. If it is determined that the wireless access point is created, the wireless access point parameters are sent to the first terminal.
[0084] In some implementations, when the first terminal determines that the second terminal has not created a wireless access point, the request sent by the first terminal for acquiring wireless access point parameters may be a wireless access point creation request.
[0085] In some implementations, when the first terminal determines that the second terminal has created a wireless access point, the request sent by the first terminal for acquiring wireless access point parameters may be a wireless access point parameter acquisition request.
[0086] In some implementations, the wireless access point creation request and the wireless access point parameter acquisition request may be the same request.
[0087] In some implementations, it may be determined whether the second terminal has created a wireless access point by determining whether the first terminal has searched for a wireless access point corresponding to the second terminal.
[0088] For example, the first terminal may provide a wireless access point scanning function. When the wireless access point corresponding to the second terminal can be scanned, it is determined that the second terminal has created the wireless access point, so that the first terminal can send a wireless access point parameter acquisition request. When the wireless access point corresponding to the second terminal is not scanned, it is determined that the second terminal has not created the wireless access point, so that the first terminal can send a wireless access point creation request.
[0089] In some implementations, sending a request for acquiring wireless access point parameters to the second terminal may include the following steps:
[0090] Acquire identity authentication information of the second terminal; and in response to successful identity authentication of the second terminal according to the identity authentication information, send a request for acquiring wireless access point parameters to the second terminal.
[0091] In some implementations, the identity authentication information may include an identity information identifier and a service identifier.
[0092] In the disclosed embodiment, the second terminal can send identity authentication information to the first terminal, so that the first terminal can first obtain the identity authentication information of the second terminal, and authenticate the second terminal through the identity authentication information. If the identity authentication is passed, the first terminal sends a request for obtaining wireless access point parameters to the second terminal, otherwise, the request for obtaining wireless access point parameters is not sent to the second terminal. In this way, the second terminal device that performs point-to-point connection can be authenticated, thereby improving the security of network connection.
[0093] In some implementations, obtaining the identity authentication information of the second terminal may include the following steps:
[0094] Receive broadcast information via Bluetooth protocol, the broadcast information includes identity authentication information.
[0095] In the disclosed embodiment, the second terminal may periodically send broadcast information outwardly using the Bluetooth protocol, and the broadcast information may include the identity authentication information of the second terminal. Thus, if the first terminal is within the Bluetooth broadcast range of the second terminal, the first terminal may receive the broadcast information through the Bluetooth protocol, and then parse the broadcast information to obtain the identity authentication information of the second terminal.
[0096] In some implementations, the Bluetooth protocol may be a Bluetooth low energy protocol.
[0097] In some implementations, the second terminal may also send the identity authentication information to the first terminal using other protocols, for example, sending the identity authentication information to the first terminal using a Near Field Communication (NFC) protocol.
[0098] In some implementations, in order to enable the first terminal to use its own mobile communication network as if it were supporting the display of mobile network signals or traffic usage prompts and other information on the first terminal, and to enable the first terminal to have a video caching mechanism, the method of the embodiment of the present disclosure may further include the following steps:
[0099] Register the network type of the peer-to-peer network card as a mobile communication network, and configure a routing address and a DNS (Domain Name System) server address for the mobile communication network.
[0100] In the disclosed embodiment, by registering the network type of the point-to-point network card as a mobile communication network (CELLUAR type) and configuring a routing address and a DNS server address for the mobile communication network, the point-to-point network card is virtually transformed into a data network card, so that the first terminal can have the characteristics of the above-mentioned data network card, and further enables the first terminal to support the display of mobile network signals, or information such as traffic usage prompts, and enables the first terminal to have a video caching mechanism, etc., thereby improving the user experience.
[0101] In some implementations, in order to enable the first terminal to connect to the Internet using the mobile communication network of the second terminal through a point-to-point connection, the routing address configured for the mobile communication network is the IP (Internet Protocol) address of the second terminal.
[0102] In some implementations, the DNS server address configured for the mobile communication network is the DNS server address of the second terminal, and may also be some other preset DNS server addresses that can complete the domain name resolution requirement of the first terminal.
[0103] In some implementations, after the first terminal establishes a point-to-point connection with the wireless access point of the second terminal through the group client, the method of the embodiment of the present disclosure may further include the following steps:
[0104] Prompt information is displayed, where the prompt information includes at least one of the following: first prompt information for prompting that the network currently in use is a mobile communication network, and second prompt information for prompting a frequency band of the mobile communication network currently in use.
[0105] In the disclosed embodiment, by displaying prompt information, for example, displaying that the network currently in use is a mobile communication network, and for another example, displaying that the frequency band of the mobile communication network currently in use is a 5G signal, the network sharing status can be intuitively prompted to the user of the first terminal, thereby further improving the user experience.
[0106] In some implementations, the first terminal and the second terminal may each execute the steps in the network connection method of the above embodiment after turning on the network sharing function.
[0107] Combine the following Figure 3 The software architecture shown is used to describe in detail the network connection method of the embodiment of the present disclosure.
[0108] like Figure 3 As shown, the first terminal may include a user space, a framework layer, a kernel space, and a subsystem layer. Among them, the user space of the first terminal includes an application, the framework layer of the first terminal includes a network configuration module (netd) and a connection service module (connectivityservice), the kernel space of the first terminal includes a point-to-point network card and a WiFi driver (WiFidriver), and the subsystem of the first terminal includes WiFi firmware (WiFiFW).
[0109] The second terminal may include a user space, a framework layer, a kernel space, and a subsystem layer. The user space of the second terminal includes an application program, the framework layer of the second terminal includes a network configuration module (netd) and a network sharing module (tethering), the kernel space of the second terminal includes a data network card (rmnet), a data network card driver (rmnetdriver), a WLAN network card, and a WiFi driver (WiFidriver), and the subsystem of the second terminal includes a modem and WiFi firmware (WiFiFW).
[0110] Among them, in the first terminal, the network configuration module is responsible for the configuration of the routing table of the point-to-point network card and the addition and deletion of routing policies; the connection service module is responsible for registering the network to the system for use by applications in the user space; the point-to-point network card is a physical network card created, responsible for sending and receiving data; the WiFi driver is the driver program of the point-to-point network card, responsible for sending system data packets to the WiFi firmware, and receiving data from the WiFi firmware and sending it to the system; the WiFi firmware is used to receive air interface data or send air interface data.
[0111] In the second terminal, the network configuration module is responsible for configuring the routing tables of the data network card and the WLAN network card, and adding and deleting routing policies; the network sharing module is responsible for forwarding the data packets received by the WLAN network card to the data network card according to the configured routing table and routing policy; the data network card is responsible for sending the received data packets to the modem; the modem is responsible for sending the received data to the network; the WLAN network card is the physical network card in the second terminal, responsible for sending and receiving data; the point-to-point network card is the created physical network card, responsible for sending and receiving data; the WiFi driver is the driver program of the WLAN network card, responsible for sending the system data packets to the WiFi firmware, and receiving the data of the WiFi firmware and sending it to the system, and the WiFi firmware is used to receive air interface data or send air interface data.
[0112] In the disclosed embodiment, first, a point-to-point connection is established between the group client of the first terminal and the wireless access point of the second terminal. Then, the point-to-point network card is registered in the system as a mobile communication network through the connection service module in the first terminal, and the routing address of the point-to-point network card is configured as the IP address of the wireless access point in the second terminal through the network configuration module in the first terminal, and the DNS server address of the point-to-point network card is configured as the DNS server address of the wireless access point in the second terminal.
[0113] After completing the above settings, the application of the first terminal can use the mobile communication network of the second terminal to connect to the Internet through a point-to-point connection. Figure 3 As shown:
[0114] The first data generated by the application of the first terminal is sent to the group client created by the first terminal through the point-to-point network card and the WiFi driver of the first terminal, and the first data is sent to the wireless access point created by the second terminal through the group client. The wireless access point sends the first data to the WLAN network card through the WiFi driver of the second terminal. The WLAN network card sends the first data to the data network card. The data network card sends the first data to the Internet through the data network card driver and the modem.
[0115] The second data sent from the Internet to the first terminal is received by the modem of the second terminal, the modem sends the second data to the data network card through the data network card driver, the data network card sends the second data to the WLAN network card, the WLAN network card sends the second data to the wireless access point through the WiFi driver of the second terminal, the wireless access point sends the second data to the group client, and the group client of the first terminal sends the second data to the application through the WiFi driver of the first terminal and the point-to-point network card.
[0116] Figure 4 is a flowchart of a network connection method according to an exemplary embodiment. Figure 1 The second terminal in the method may include:
[0117] S410: Receive a point-to-point connection request sent by a group client created by a first terminal.
[0118] S420, in response to the point-to-point connection request, establish a point-to-point connection with the group client through the created wireless access point, the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
[0119] The detailed description of steps S410 - S420 may refer to the aforementioned embodiment and will not be repeated here.
[0120] By adopting the above method, the group client created by the first terminal sends a point-to-point connection request to the second terminal, and the second terminal can establish a point-to-point connection with the group client through the created wireless access point in response to the point-to-point connection request, so that when the second terminal accesses the mobile communication network, the first terminal can connect to the Internet through the mobile communication network of the second terminal. It can be seen that the embodiment of the present disclosure proposes a new method for realizing the connection of the first terminal to the Internet. In addition, in the network connection method of the embodiment of the present disclosure, since the first terminal uses the mobile communication network of the second terminal to connect to the Internet through a point-to-point connection, and does not use the WLAN method, based on the data sharing characteristics of the point-to-point connection, the first terminal can use the network capabilities of the second terminal including directional traffic, thereby improving the scope of use of the network connection. In addition, in the embodiment of the present disclosure, since the second terminal is used as the group owner in the point-to-point connection, the first terminal, as a group client, uses the mobile communication network of the second terminal to connect to the Internet, so that the mobile communication network of the second terminal can be shared on multiple first terminal devices.
[0121] In some implementations, the method of the disclosed embodiment further includes the following steps:
[0122] A request for obtaining wireless access point parameters sent by the first terminal is received; in response to the request for obtaining wireless access point parameters, the wireless access point parameters are sent to the first terminal, and the wireless access point parameters are used by the group client of the first terminal to send a point-to-point connection request.
[0123] In some implementations, in response to a request for obtaining wireless access point parameters, sending the wireless access point parameters to the first terminal may include the following steps:
[0124] In response to a request for obtaining wireless access point parameters, if it is determined that the wireless access point has not been created, a wireless access point is created and the wireless access point parameters are sent to the first terminal; in response to a request for obtaining wireless access point parameters, if it is determined that the wireless access point is to be created, the wireless access point parameters are sent to the first terminal.
[0125] In some implementations, before receiving the request sent by the first terminal for acquiring the wireless access point parameters, the method of the embodiment of the present disclosure may further include the following steps:
[0126] Identity authentication information is sent to the first terminal, where the identity authentication information is used by the first terminal to authenticate the second terminal, wherein the request for obtaining wireless access point parameters is sent by the first terminal when the identity authentication of the second terminal is successful.
[0127] In some implementations, sending the identity authentication information to the first terminal may include the following steps:
[0128] Broadcast information is sent periodically via the Bluetooth protocol, and the broadcast information includes identity authentication information.
[0129] The detailed description of the above steps can be referred to the aforementioned embodiments, which will not be repeated here.
[0130] Figure 5 is a flowchart of a network connection method according to an exemplary embodiment. Figure 1 In the communication system shown in the scenario, the method may include:
[0131] S510: The first terminal creates a group client through a point-to-point network card.
[0132] S520: The first terminal sends a point-to-point connection request to the second terminal through the created group client.
[0133] S530, the second terminal establishes a point-to-point connection with the group client through the created wireless access point in response to the point-to-point connection request, and the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
[0134] The detailed description of S510 - S530 can refer to the aforementioned embodiment and will not be repeated here.
[0135] Figure 6 is a flowchart of a network connection method according to an exemplary embodiment. Figure 1 In the communication system shown in the scenario, the method may include:
[0136] S610: The second terminal sends a Bluetooth broadcast.
[0137] In this step, the second terminal periodically sends broadcast information through the Bluetooth protocol, and the broadcast information includes identity authentication information.
[0138] S620: The first terminal performs identity authentication on the second terminal according to the identity authentication information.
[0139] In this step, the first terminal that receives the broadcast information parses the broadcast information to obtain identity authentication information, and performs identity authentication on the second terminal according to the identity authentication information.
[0140] S630: The first terminal sends a request for creating a wireless access point to the second terminal.
[0141] In this step, after the first terminal passes the identity authentication of the second terminal, the first terminal may send a request for creating a wireless access point to the second terminal.
[0142] S640: The second terminal creates a wireless access point.
[0143] In this step, the second terminal determines whether it has created a wireless access point. If not, it creates a wireless access point and executes S650. If it has already created a wireless access point, it skips S640 and directly executes S650.
[0144] S650: Send wireless access point parameters to the first terminal.
[0145] S660: Create a group client.
[0146] In this step, the first terminal enables the point-to-point network card in response to receiving the wireless access point parameters sent by the second terminal, and creates a group client through the point-to-point network card.
[0147] S670: The first terminal sends a point-to-point connection request to the second terminal.
[0148] In this step, the first terminal sends a point-to-point connection request to the second terminal through the group client.
[0149] S680, the first terminal registers on the network.
[0150] In this step, the network type of the point-to-point network card is registered as a mobile communication network, and a routing address and a DNS server address are configured for the mobile communication network to complete the process of the first terminal registering the network.
[0151] In some implementations, the routing address configured for the mobile communication network is the IP address of the second terminal, and the DNS server address configured for the mobile communication network is the DNS server address of the second terminal.
[0152] S690: A point-to-point connection is established between the second terminal and the group client.
[0153] In this step, the second terminal establishes a point-to-point connection with the group client through the created wireless access point in response to the point-to-point connection request.
[0154] The detailed description of steps S610-S690 can refer to the aforementioned embodiment and will not be repeated here.
[0155] Figure 7 is a structural block diagram of a network connection device 700 according to an exemplary embodiment. Figure 7 , the device 700 comprises:
[0156] The creation module 710 is configured to create a group client through a point-to-point network card.
[0157] The first establishing module 720 is configured to establish a point-to-point connection with the wireless access point of the second terminal through the group client, and the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
[0158] In some embodiments, the apparatus 700 further comprises:
[0159] The first sending module is configured to send a request for acquiring wireless access point parameters to the second terminal.
[0160] The enabling module is configured to enable the point-to-point network card in response to receiving the wireless access point parameters sent by the second terminal, where the wireless access point parameters are sent when the second terminal determines to create the wireless access point.
[0161] In some implementations, the first sending module is further configured to obtain identity authentication information of the second terminal; in response to the second terminal being authenticated according to the identity authentication information, send a request for obtaining the wireless access point parameters to the second terminal.
[0162] In some implementations, the first sending module is further configured to receive broadcast information via a Bluetooth protocol, where the broadcast information includes the identity authentication information.
[0163] In some embodiments, the apparatus 700 further comprises:
[0164] The configuration module is configured to register the network type of the point-to-point network card as a mobile communication network, and configure a routing address and a DNS server address for the mobile communication network.
[0165] In some embodiments, the apparatus 700 further comprises:
[0166] The display module is configured to display prompt information, wherein the prompt information includes at least one of the following: first prompt information for prompting that the network currently in use is the mobile communication network, and second prompt information for prompting the frequency band of the mobile communication network currently in use.
[0167] Figure 8 is a structural block diagram of a network connection device 800 according to an exemplary embodiment. Figure 8 , the device 800 comprises:
[0168] The first receiving module 810 is configured to receive a point-to-point connection request sent by a group client created by the first terminal.
[0169] The second establishing module 820 is configured to establish a point-to-point connection with the group of clients through the created wireless access point in response to the point-to-point connection request, and the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
[0170] In some embodiments, the apparatus 800 further comprises:
[0171] The second receiving module is configured to receive a request sent by the first terminal for acquiring wireless access point parameters.
[0172] The second sending module is configured to send the wireless access point parameters to the first terminal in response to the request for acquiring the wireless access point parameters, where the wireless access point parameters are used by the group client of the first terminal to send the point-to-point connection request.
[0173] In some implementations, the second sending module is further configured to, in response to the request for acquiring the wireless access point parameters, create the wireless access point if it is determined that the wireless access point has not been created, and send the wireless access point parameters to the first terminal.
[0174] In some implementations, the second sending module is further configured to, in response to the request for acquiring the wireless access point parameters, send the wireless access point parameters to the first terminal if it is determined to create the wireless access point.
[0175] In some embodiments, the apparatus 800 further comprises:
[0176] The third sending module is configured to send identity authentication information to the first terminal, where the identity authentication information is used by the first terminal to authenticate the second terminal, wherein the request for obtaining wireless access point parameters is sent by the first terminal when the identity authentication of the second terminal is successful.
[0177] In some implementations, the third sending module is further configured to periodically send broadcast information via the Bluetooth protocol, where the broadcast information includes identity authentication information.
[0178] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0179] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, and the program instructions, when executed by a processor, implement the steps of the network connection method provided by the present disclosure.
[0180] Fig. 9 is a block diagram of an electronic device according to an exemplary embodiment, the electronic device may be Figure 1 The first or second terminal in . Please refer to Fig. 9 , the electronic device 900 may include one or more of the following components: a processing component 902 , a memory 904 , a power component 906 , a multimedia component 908 , an audio component 910 , an input / output interface 912 , a sensor component 914 , and a communication component 916 .
[0181] The processing component 902 generally controls the overall operation of the electronic device 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the above-mentioned image processing method. In addition, the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.
[0182] The memory 904 is configured to store various types of data to support operations on the electronic device 900. Examples of such data include instructions for any application or method operating on the electronic device 900, contact data, phone book data, messages, pictures, videos, etc. The memory 904 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0183] The power supply component 906 provides power to the various components of the electronic device 900. The power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 900.
[0184] The multimedia component 908 includes a screen that provides an output interface between the electronic device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front camera and / or a rear camera. When the electronic device 900 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0185] The audio component 910 is configured to output and / or input audio signals. For example, the audio component 910 includes a microphone (MIC), and when the electronic device 900 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 904 or sent via the communication component 916. In some embodiments, the audio component 910 also includes a speaker for outputting audio signals.
[0186] The input / output interface 912 provides an interface between the processing component 902 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0187] The sensor assembly 914 includes one or more sensors for providing various aspects of status assessment for the electronic device 900. For example, the sensor assembly 914 can detect the open / closed state of the electronic device 900, the relative positioning of components, such as the display and keypad of the electronic device 900, and the sensor assembly 914 can also detect the position change of the electronic device 900 or a component of the electronic device 900, the presence or absence of user contact with the electronic device 900, the orientation or acceleration / deceleration of the electronic device 900, and the temperature change of the electronic device 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 914 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0188] The communication component 916 is configured to facilitate wired or wireless communication between the electronic device 900 and other devices. The electronic device 900 can access a wireless network based on a communication standard, such as WiFi, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0189] In an exemplary embodiment, the electronic device 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-mentioned image processing method.
[0190] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, and the instructions can be executed by the processor 920 of the electronic device 900 to complete the above network connection method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0191] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program executable by a programmable device. The computer program has a code portion for executing the above network connection method when executed by the programmable device.
[0192] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0193] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A network connection method, characterized in that: Applied to a first terminal, the method includes: Create group clients via peer-to-peer network cards; A point-to-point connection with a wireless access point of a second terminal is established through the group client, and the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
2. The method according to claim 1, characterized in that: The method further comprises: Sending a request for acquiring wireless access point parameters to the second terminal; In response to receiving the wireless access point parameters sent by the second terminal, enabling the point-to-point network card, wherein the wireless access point parameters are sent when the second terminal determines to create the wireless access point.
3. The method according to claim 2, characterized in that The sending a request for acquiring wireless access point parameters to the second terminal includes: Obtaining identity authentication information of the second terminal; In response to the identity authentication of the second terminal being successful according to the identity authentication information, a request for acquiring the wireless access point parameters is sent to the second terminal.
4. The method according to claim 3, characterized in that The obtaining the identity authentication information of the second terminal includes: The broadcast information is received through the Bluetooth protocol, where the broadcast information includes the identity authentication information.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: The network type of the peer-to-peer network card is registered as a mobile communication network, and a routing address and a DNS server address are configured for the mobile communication network.
6. The method according to claim 5, characterized in that After establishing the point-to-point connection with the second terminal, the method further includes: Prompt information is displayed, wherein the prompt information includes at least one of the following: first prompt information for prompting that the network currently in use is the mobile communication network, and second prompt information for prompting a frequency band of the mobile communication network currently in use.
7. A network connection method, characterized in that: Applied to the second terminal, the method includes: Receiving a point-to-point connection request sent by a group client created by the first terminal; In response to the point-to-point connection request, a point-to-point connection is established between the group of clients through the created wireless access point, and the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
8. The method according to claim 7, characterized in that The method further comprises: receiving a request sent by the first terminal for acquiring wireless access point parameters; In response to the request for acquiring the wireless access point parameters, the wireless access point parameters are sent to the first terminal, and the wireless access point parameters are used by the group client of the first terminal to send the point-to-point connection request.
9. The method according to claim 8, characterized in that The sending the wireless access point parameters to the first terminal in response to the request for acquiring the wireless access point parameters includes: In response to the request for acquiring the wireless access point parameters, if it is determined that the wireless access point has not been created, creating the wireless access point and sending the wireless access point parameters to the first terminal; In response to the request for acquiring the wireless access point parameters, if it is determined to create the wireless access point, the wireless access point parameters are sent to the first terminal.
10. The method according to claim 8, characterized in that Before receiving the request for acquiring wireless access point parameters sent by the first terminal, the method further includes: Sending identity authentication information to the first terminal, where the identity authentication information is used by the first terminal to authenticate the second terminal, wherein the request for obtaining wireless access point parameters is sent by the first terminal when the identity authentication of the second terminal is successful.
11. The method according to claim 10, characterized in that The sending identity authentication information to the first terminal includes: The broadcast information is periodically sent through the Bluetooth protocol, and the broadcast information includes identity authentication information.
12. A network connection device, characterized in that: include: A creation module configured to create a group client via a peer-to-peer network card; The first establishing module is configured to establish a point-to-point connection with the wireless access point of the second terminal through the group client, and the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
13. A network connection device, characterized in that: include: A first receiving module is configured to receive a point-to-point connection request sent by a group client created by the first terminal; The second establishing module is configured to establish a point-to-point connection with the group of clients through the created wireless access point in response to the point-to-point connection request, wherein the point-to-point connection is used for the first terminal to connect to the Internet through the mobile communication network of the second terminal.
14. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method described in any one of claims 1 to 6, or to implement the steps of the method described in any one of claims 7 to 11.
15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the program implements the steps of the method described in any one of claims 1 to 6, or implements the steps of the method described in any one of claims 7 to 11.