Network sharing method, electronic device, and chip system

By establishing virtual network pathways between electronic devices and configuring these pathways according to network type, the problem of the limited use of network sharing methods is solved, improving user experience and ease of operation, and enabling convenient network sharing and switching between devices.

WO2026040530A1PCT designated stage Publication Date: 2026-02-26HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/097606
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-19
Filing Date
2025-05-28
Publication Date
2026-02-26

AI Technical Summary

Technical Problem

Existing network sharing methods are not widely used in different scenarios, and the user experience needs to be improved. In particular, when there is no network coverage or insufficient network, the network sharing operation between devices is complicated and has a low success rate.

Method used

By establishing a virtual network path between the first and second electronic devices, configuring the corresponding virtual network path according to the network type of the second electronic device, network sharing is achieved, and the virtual network path is automatically disconnected and switched to another network after the user selects the second network, simplifying the operation process.

Benefits of technology

It enhances the use cases and user experience of network sharing, simplifies the network switching process between devices, improves the ease of operation and success rate, and avoids complex user interactions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025097606_26022026_PF_FP_ABST
    Figure CN2025097606_26022026_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a network sharing method, an electronic device, and a chip system. The method is applied to a first electronic device. When the first electronic device and a second electronic device meet a preset condition, the first electronic device can communicate with the second electronic device by establishing a first network path with the second electronic device. The first electronic device sends a network sharing request to the second electronic device by means of the first network path, so that the second electronic device enables network sharing. The second electronic device configures a proxy gateway in response to the network sharing request. The first electronic device configures a default gateway, domain name mapping, and a virtual network path in response to a first instruction indicating that the proxy gateway has been successfully configured. A network access request of the first electronic device can be forwarded to the virtual network path to implement network sharing. The virtual network path is configured on the basis of the network type of the second electronic device so as to share different types of networks. The present application can also achieve switching of other hotspot networks or wireless networks.
Need to check novelty before this filing date? Find Prior Art

Description

Network sharing method, electronic device and chip system

[0001] The present application claims priority to the Chinese patent application No. 2024111427165, filed on August 19, 2024, and entitled "Network sharing method, electronic device and chip system", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the field of communication technology, and in particular to a network sharing method, an electronic device and a chip system. BACKGROUND

[0003] With the development of network connection technology, multiple electronic devices can share the same network connection for convenient communication and collaboration. This sharing of network connection can be achieved through devices (such as routers, switches or network servers, etc.) and protocols (such as Wireless Fidelity (WiFi), Ethernet, Bluetooth, etc.).

[0004] Currently, this sharing of network connection includes different scenarios and levels. For example, it can be home network sharing, in which multiple family members or devices share the same home network connection, for example, the same WiFi router. For another example, it can be enterprise network sharing, in which multiple employees or departments in an enterprise or office environment share the same Local Area Network (LAN) or Wide Area Network (WAN) to access shared files, applications and resources. For another example, it can also be public network sharing, in which multiple users in a public place can share the same public WiFi network connection. For another example, it can be mobile network sharing, in which different devices share mobile network resources, for example, through a mobile hotspot. SUMMARY

[0005] To solve the above technical problems, the present application provides a network sharing method, an electronic device and a chip system. The technical scheme provided by the present application can configure different virtual network paths based on the network type of a second electronic device, so that the first electronic device can share different types of networks of the second electronic device, thereby making the use scenarios of network sharing more extensive and improving the user experience.

[0006] To achieve the above technical purposes, the present application provides the following technical scheme:

[0007] In a first aspect, a network sharing method is provided, applied to a first electronic device. In response to the first electronic device and a second electronic device satisfying a preset condition, a first network path between the first electronic device and the second electronic device is established. A network sharing request is sent to the second electronic device through the first network path. The network sharing request is used to trigger an operation of the second electronic device to configure a proxy gateway. In response to a first instruction, a virtual network path corresponding to a network type of the second electronic device included in the first instruction is configured, so that the first electronic device interacts with the second electronic device through the virtual network path. The data interaction is used for the second electronic device to share a first network of the second electronic device with the first electronic device. The first instruction is issued by the second electronic device in the case that the configuration of the proxy gateway is successful.

[0008] Based on the above description of the network sharing method applied to the first electronic device provided by the embodiments of the present application, it can be known that the network sharing method establishes the first network path between the first electronic device and the second electronic device in the case that the first electronic device and the second electronic device satisfy the preset condition, so that the first electronic device and the second electronic device can communicate. The first electronic device sends the network sharing request to the second electronic device through the first network path, so that the second electronic device opens the network sharing. The second electronic device configures the proxy gateway in response to the network sharing request. After the configuration of the proxy gateway is completed, the first electronic device configures the virtual network path in response to the first instruction that the configuration of the proxy gateway is successful. The virtual network path is the network path for the first electronic device to share the first network, so that the online request of the first electronic device can be forwarded to the virtual network path, the online request of each application in the first electronic device can be sent to the virtual network path, and then the first electronic device can realize the network sharing with the second electronic device. The virtual network path is configured based on the network type of the second electronic device, different virtual network paths are configured for different network types, the first electronic device can share different types of networks of the second electronic device, the use scenario is more extensive, and then the use experience of the user is improved.

[0009] According to the first aspect, or any one of the implementations of the first aspect, in the operation of configuring the virtual network path corresponding to the network type of the second electronic device included in the first instruction in response to the first instruction, the network sharing method further includes: in response to an input selection operation on the second network, disconnecting the virtual network path and confirming the second network path. The second network path is a physical link. The second network is accessed based on the second network path.

[0010] In this way, after the first electronic device connects the first network of the second electronic device, the first electronic device can confirm the other available network path, i.e., the second network path, by cutting off the virtual network path. Further, the first electronic device triggers the first electronic device to perform the operation of connecting the second network by sending the online request to the second network path. In this way, the first electronic device can switch from the network sharing network to the hotspot or the WiFi of the router of the other electronic device, meeting more scene requirements. In addition, the user only needs to select the second network, and the first electronic device automatically disconnects the virtual network path and performs the operation of connecting the second network, which is simple and improves the user experience.

[0011] According to the first aspect, or any one of the implementations of the first aspect, the second network includes a hotspot network provided by the electronic device and a wireless network provided by the router.

[0012] According to the first aspect, or any one of the implementations of the first aspect, when performing the step of disconnecting the virtual network path in response to the inputted selection operation of the second network, the network sharing method further includes: calling a destruction simulation network path interface of the distributed gateway in the wireless network connection interface of the first electronic device to close the distributed gateway.

[0013] In this way, the first electronic device disconnects the virtual network path by calling the destruction simulation network path interface of the distributed gateway to close the distributed gateway. The user only needs to select the second network, and the first electronic device can complete the disconnection of the virtual network path without the user performing other operations, and then complete the network sharing with the second network, improving the user experience.

[0014] According to the first aspect, or any one of the implementations of the first aspect, when performing the step of disconnecting the virtual network path in response to the inputted selection operation of the second network, the network sharing method further includes: generating a disconnection network sharing instruction in response to the inputted selection operation of the second network; destroying the first network agent based on the disconnection network sharing instruction; sending the online request of the second application to the second network path; sending a destruction completion instruction; the destruction completion instruction is issued based on the first electronic device in the case of destroying the first network agent, and is used to indicate that the destruction has been completed; generating a success instruction in response to receiving the destruction completion instruction; the success instruction is used to trigger the first electronic device to perform the network connection operation of the second network.

[0015] In this way, the user only needs to select the second network, and the first electronic device can complete the disconnection of the virtual network path without the user performing other operations, and then complete the network sharing with the second network, improving the user experience.

[0016] According to the first aspect, or any one of the implementations of the first aspect, in response to the first instruction, the virtual network path corresponding to the network type of the second electronic device included in the first instruction is configured, including: establishing the virtual network path, and registering the network provider; and the first network provided by the second electronic device is detected based on the virtual network path and the network provider.

[0017] In this way, the first electronic device spontaneously completes the operations of establishing and registering, and the network sharing can be completed without user operation, thereby improving the experience of the user.

[0018] According to the first aspect, or any one of the implementations of the first aspect, after the step of configuring the virtual network path corresponding to the network type of the second electronic device included in the first instruction in response to the first instruction is performed, the network sharing method further includes: in response to receiving an online request of the first application program, creating a first network agent, and registering the first network agent to obtain routing information; the online request is transmitted through the virtual network path; the first network is discovered based on the routing information; and after the step of detecting the currently available network based on the virtual network path and the network provider is performed, the network sharing method further includes: if it is detected that the first network is connected, a notification message is generated; and the notification message is used to prompt that the connection with the first network is successful.

[0019] In this way, the first electronic device spontaneously completes the network connection operation of the first application program, and the network sharing can be completed without user operation, thereby improving the experience of the user.

[0020] According to the first aspect, or any one of the implementations of the first aspect, the first electronic device and the second electronic device meet the preset conditions, including that the Bluetooth and the WLAN of the first electronic device are turned on, the Bluetooth and the WLAN of the second electronic device are turned on; the second electronic device is in an online state in the available network list of the first electronic device; and the first electronic device receives an input network sharing request confirmation operation.

[0021] According to the first aspect, or any one of the implementations of the first aspect, in a case where the current connection network type of the second electronic device is a cellular network, the virtual network path is a virtual mobile network; and the network sharing method further includes: configuring the virtual mobile network based on the address of the point-to-point network card of the first electronic device.

[0022] In this way, the first electronic device can share the mobile network of the second electronic device, and the first electronic device is still connected to the mobile network, thereby ensuring that the network type does not change. This is conducive to ensuring the network speed and providing better network experience for the user. In addition, compared with a hotspot, the embodiment does not need to input a password, and the operation is simple, thereby avoiding network connection failure caused by inputting an incorrect password.

[0023] According to the first aspect, or any one of the implementations of the first aspect, in a case where the second electronic device is currently connected to a wireless network, the virtual network path is a virtual wireless network; and the network sharing method further includes: configuring the virtual wireless network based on an address of the point-to-point network card of the first electronic device.

[0024] In this way, when the second electronic device is connected to the wireless network, the first electronic device can still share the first network, and the first electronic device is still connected to the wireless network, ensuring that the network type does not change. In a scenario where login identity information is required to connect to the wireless network, the first electronic device can connect to the network of the second electronic device through network sharing, thereby avoiding the operation of logging in the login identity information and achieving the purpose of multiple devices of one user logging in at the same time.

[0025] According to the first aspect, or any one of the implementations of the first aspect, the first electronic device is a mobile phone or a tablet, and the second electronic device is a mobile phone.

[0026] In this way, the mobile phone and the tablet can share the network of the second electronic device, meet the needs of different scenarios, and improve the satisfaction of the user.

[0027] According to the first aspect, or any one of the implementations of the first aspect, the network sharing method further includes: in response to an input opening operation of an application program in a white list of the first electronic device, confirming a currently available network; the currently available network is the first network; in response to the confirmation action of the first network, a network sharing confirmation pop-up window is popped up, and the network sharing confirmation pop-up window is used to input a network sharing request confirmation operation.

[0028] According to the first aspect, or any one of the implementations of the first aspect, the network sharing method further includes: in response to an interception operation of an application program network request of the first electronic device, confirming a currently available network; the currently available network is the first network; in response to the confirmation action of the first network, a network sharing confirmation pop-up window is popped up, and the network sharing confirmation pop-up window is used to input a network sharing request confirmation operation.

[0029] The second aspect provides a network sharing method applied to a second electronic device, the network sharing method including: in response to a network sharing request sent by a first electronic device, configuring a proxy gateway; in response to successful configuration of the proxy gateway, replying a first instruction of successful configuration of the proxy gateway to the first electronic device; the first instruction includes a network type of the second electronic device; and the first network type of the second electronic device is used to configure a virtual network path by the first electronic device, so that the first electronic device and the second electronic device interact with each other.

[0030] In this way, the second electronic device can share the network connected by itself to the first electronic device. For example, the mobile network of the second electronic device can be shared to the first electronic device. In another scenario, the second electronic device can share the WiFi network connected by itself to the first electronic device. The needs of different scenarios are met, and the satisfaction of users is improved.

[0031] According to a second aspect, or any possible implementation mode of the second aspect, the proxy gateway comprises an Internet Protocol Forwarding, a Domain Name Resolution System Forwarding, a Network Address Translation, an Address Resolution Protocol Proxy, and a traffic statistics.

[0032] According to a third aspect, an electronic device is provided, which comprises one or more processors, a memory, and a display screen; the memory is coupled to the one or more processors, and the memory is configured to store computer program codes, the computer program codes comprising computer instructions, and the one or more processors are configured to invoke the computer instructions to enable the electronic device to perform the method according to the first aspect or the method according to the second aspect.

[0033] According to a fourth aspect, a chip system is provided, which is applied to an electronic device, and the chip system comprises one or more processors, and the processor is configured to invoke computer instructions to enable the electronic device to perform the method according to the first aspect or the method according to the second aspect.

[0034] According to a fifth aspect, a computer readable storage medium is provided, which comprises instructions, and when the instructions are executed on an electronic device, the electronic device is enabled to perform the method according to the first aspect or the method according to the second aspect. BRIEF DESCRIPTION OF DRAWINGS

[0035] FIG. 1 shows a timing diagram of a network sharing method according to an embodiment of the present application;

[0036] FIG. 2 shows an interface diagram of the first electronic device preparing to start network sharing in a network sharing method according to an embodiment of the present application;

[0037] FIG. 3 shows an interface diagram of the second electronic device preparing to start network sharing in a network sharing method according to an embodiment of the present application;

[0038] FIG. 4 shows an interface diagram of the first electronic device starting smart interconnection in a network sharing method according to an embodiment of the present application;

[0039] FIG. 5 shows an interface diagram of the first electronic device starting smart interconnection in a network sharing method according to an embodiment of the present application;

[0040] FIG. 6 shows an interface diagram of the first electronic device and the second electronic device logging in the same account in a network sharing method according to an embodiment of the present application;

[0041] FIG. 7 shows an interface diagram of one implementation of the first electronic device popping up a "discover available networks" pop-up window in a network sharing method according to an embodiment of the present application;

[0042] FIG. 8 shows an interface diagram of another implementation of the first electronic device popping up a "discover available networks" pop-up window in a network sharing method according to an embodiment of the present application;

[0043] FIG. 9 shows an interface diagram of yet another implementation of the first electronic device popping up a "discover available networks" pop-up window in a network sharing method according to an embodiment of the present application;

[0044] FIG. 10 shows a timing diagram of establishing a virtual mobile network in a network sharing method according to an embodiment of the present application;

[0045] FIG. 11 shows a timing diagram of the application program in the first electronic device using the mobile network of the second electronic device in a network sharing method according to an embodiment of the present application;

[0046] FIG. 12 shows an interface diagram of the application program in the first electronic device sending a network access request in a network sharing method according to an embodiment of the present application;

[0047] FIG. 13 shows a scenario diagram of switching the second network in a network sharing method according to an embodiment of the present application;

[0048] FIG. 14 shows a timing diagram of connecting the second network in a network sharing method according to an embodiment of the present application;

[0049] FIG. 15 shows an interface diagram of the first electronic device popping up an interface of "the mobile data network connection with the second electronic device has been disconnected" on the interface of the first electronic device in a network sharing method according to an embodiment of the present application;

[0050] FIG. 16 shows a timing diagram of cutting off the virtual network path in a network sharing method according to an embodiment of the present application;

[0051] FIG. 17 shows an interface diagram of connecting the second network in a network sharing method according to an embodiment of the present application;

[0052] FIG. 18 shows a scenario diagram of the mobile phone sharing the mobile network with the tablet in a network sharing method according to an embodiment of the present application;

[0053] FIG. 19 shows a scenario diagram of the mobile phone sharing the WiFi network with the mobile phone in a network sharing method according to an embodiment of the present application;

[0054] FIG. 20 shows an interface schematic diagram of one implementation of the first electronic device popping up a "discover available networks" pop-up window in a network sharing method according to an embodiment of the present application;

[0055] FIG. 21 shows a timing diagram of a mobile phone sharing a WiFi network with a mobile phone in a network sharing method according to an embodiment of the present application;

[0056] FIG. 22 shows a scenario schematic diagram of a mobile phone sharing a WiFi network with a tablet in a network sharing method according to an embodiment of the present application;

[0057] FIG. 23 is a hardware structure schematic diagram of an electronic device according to an embodiment of the present application;

[0058] FIG. 24 is a software structure schematic diagram of an electronic device according to an embodiment of the present application;

[0059] FIG. 25 is a component schematic diagram of a chip system according to an embodiment of the present application. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. In the description of the present application, unless otherwise specified, " / " represents a "or" relationship between the objects before and after the " / ", for example, A / B can represent A or B; in the present application, "and / or" is only a description of the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist together, and B exists alone, where A and B can be singular or plural. In addition, in the description of the present application, unless otherwise specified, "multiple" means two or more than two. "At least one of the following" or the like means any combination of the items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, and c can be single or multiple. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, "first", "second", and the like are used to distinguish the same items or similar items with basically the same function and effect. Those skilled in the art can understand that "first", "second", and the like do not limit the quantity and execution order, and "first", "second", and the like do not necessarily mean different. At the same time, in the embodiments of the present application, "exemplary" or "for example" means to serve as an example, illustration or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, "exemplary" or "for example" is used to present the relevant concept in a specific manner, and to facilitate understanding.

[0061] When a user has multiple electronic devices, by sharing the network of one or more electronic devices to other electronic devices, it is possible to avoid purchasing network data for each device separately, thereby saving costs and improving resource utilization.

[0062] The embodiment of the present application provides a network sharing method, which can also be called communication sharing, and is suitable for electronic devices with WLAN and Bluetooth. The network sharing method can realize network sharing between multiple electronic devices and improve the use experience of users. The electronic device can be a terminal device such as a mobile phone, a tablet computer (PAD), a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a wearable device, a smart home device, an artificial intelligence (AI) device, and the like. The smart home device includes, for example, an audio and video device (such as a large-screen device, a sound box, and the like), a lighting device (such as a table lamp, an electric lamp, a sleep aid lamp, and the like), an environmental control device (such as an air purifier, a sweeper, and the like), a security system device (such as a camera, a smart door lock, and the like), a kitchen appliance device (such as a water dispenser, an oven, a dishwasher, and the like), a smart sensor, and the like.

[0063] In some embodiments, the operating system of the electronic device can be an Android system

[0064] Through the Bluetooth channel or the WLAN channel, multiple electronic devices can exchange information.

[0065] The network traffic of the network sharing can be mobile network traffic or wireless network traffic.

[0066] Irrespective of the scenarios of home network sharing, enterprise network sharing, public network sharing, or mobile network sharing, when a certain electronic device of a user has no network, the network of other electronic devices can be shared through the network sharing method, so that the purpose of online is achieved.

[0067] The network sharing method provided by the embodiment of the present application will be described in detail below by taking an example of sharing the network of a second electronic device by a first electronic device.

[0068] In a scenario where a WiFi network is not covered, if the first electronic device of a user cannot use mobile network traffic, for example, has no mobile network traffic quota, some application programs (APPs) of the first electronic device cannot be normally used.

[0069] FIG. 1 shows a timing diagram of a network sharing method provided by the embodiment of the present application. As shown in FIG. 1, in some embodiments, the network sharing method includes the following steps:

[0070] S1, in response to the first electronic device and the second electronic device satisfying a preset condition, the first electronic device establishes a first network channel between the first electronic device and the second electronic device.

[0071] The following describes a case where the first electronic device and the second electronic device satisfy the preset condition.

[0072] FIG. 2 shows an interface diagram of the first electronic device preparing to start network sharing in a network sharing method according to an embodiment of the present application. As shown in FIG. 2, in some embodiments, the first electronic device can be a mobile phone. The user interface 3A of the first electronic device displays a settings details page, which includes a WLAN option 501, a Bluetooth option 502, and a mobile data option 504. The WLAN option 501 is in an on and not connected state. The Bluetooth option 502 is in an on state. The mobile data option 504 is in a not connected state. In the case where the mobile data option 504 is in the not connected state, the first electronic device has no mobile network available.

[0073] FIG. 3 shows an interface diagram of the second electronic device preparing to start network sharing in a network sharing method according to an embodiment of the present application. As shown in FIG. 3, in some embodiments, the second electronic device can also be a mobile phone. The user interface 4A of the second electronic device displays a settings details page, which includes a WLAN option 501s, a Bluetooth option 502s, and a mobile data option 504s. The WLAN option 501s is in an on and not connected state. The Bluetooth option 502s is in an on state. The mobile data option 504s is in an on state. In the case where the mobile data option 504s is in the on state, the second electronic device is currently using a mobile network.

[0074] By turning on the Bluetooth of the first electronic device and the Bluetooth of the second electronic device, communication between the first electronic device and the second electronic device is achieved. It can be understood that even if the first electronic device and the second electronic device are not in the same local area network (hotspot), the first electronic device can discover the second electronic device through the Bluetooth function. By turning on the WLAN of the first electronic device and the WLAN of the second electronic device, a network sharing channel can be established subsequently.

[0075] In some embodiments, as shown in FIG. 4, the user interface 3A of the first electronic device further comprises a smart interconnection option 503. The first electronic device enters a user interface 3A' in response to the operation of the user clicking the smart interconnection option 503. The user interface 3A' displays a smart interconnection details page. The smart interconnection details page comprises a network sharing option 5031, which is in an on state, in which case the first electronic device can use the shared network of the other device. The smart interconnection details page further comprises a my other device option 5032. Exemplarily, the my other device option 5032 comprises the second electronic device. If the network sharing option 5031 is turned off, the first electronic device cannot perform network sharing. Similarly, as shown in FIG. 5, the user interface 4A of the second electronic device further comprises a smart interconnection option 503s on the settings details page. The second electronic device enters a user interface 4B in response to the operation of the user clicking the smart interconnection option 503s. The user interface 4B displays a smart interconnection details page. The smart interconnection details page comprises a network sharing option 5031s, which is in an on state. The smart interconnection details page further comprises a my other device option 5032s. Exemplarily, the my other device option 5032s comprises the first electronic device. In this case, the second electronic device can share the network with other electronic devices. In this way, the first electronic device and the second electronic device are allowed to perform network sharing.

[0076] FIG. 6 shows an interface schematic diagram of the first electronic device and the second electronic device logging into the same account in a network sharing method according to an embodiment of the present application. As shown in FIG. 6, the account center details page of the first electronic device comprises a user account option 801 and a user login option 802. The first electronic device receives the user account "00000000001" input by the user in the user account option 801, and then the first electronic device successfully logs into the first user account with the user name "NAME01" in response to the operation of the user clicking the login user login option 802. The account center details page of the second electronic device comprises a user account option 801s and a user login option 802s. The second electronic device receives the user account "00000000001" input by the user in the user account option 801s, and then the second electronic device successfully logs into the first user account with the user name "NAME01" in response to the operation of the user clicking the login user login option 802s. That is, the first electronic device and the second electronic device log into the same user account.

[0077] In this way, the first electronic device can discover that there is a second electronic device that can provide network sharing nearby, that is, the second electronic device appears on the available network list of the first electronic device. Alternatively, the second electronic device is online.

[0078] In some embodiments, the first electronic device and the second electronic device have the trust circle capability in the case that the first electronic device and the second electronic device log in the same user account. The first electronic device and the second electronic device located in the same trust circle can be in a secure execution environment, and can isolate and protect the key system resources and data, and ensure that they are not accessed and attacked by unauthorized access. In addition, the first electronic device and the second electronic device located in the same trust circle can access and transmit data to each other.

[0079] FIG. 7 shows an interface schematic diagram of an implementation of the first electronic device popping up the "discover available network" pop-up window in the network sharing method provided by the embodiments of the present application. As shown in FIG. 7, after the second electronic device appears on the available network list of the first electronic device, the "discover available network" pop-up window 60 appears on the screen of the first electronic device.

[0080] In an implementation, as shown in FIG. 7, the user interface 3B of the first electronic device displays a setting details page, and the WLAN option 501, the Bluetooth option 502 and the smart interconnection option 503 are turned on on the setting details page. At this time, the WLAN and the Bluetooth of the second electronic device are turned on, and the second electronic device appears on the available network list of the first electronic device. The first electronic device can pop up the "discover available network" pop-up window 60 on the user interface 3B. The content of the "discover available network" pop-up window can include "use the mobile data network of the second electronic device to surf the Internet". It can be understood that the order of turning on the WLAN option, the Bluetooth option and the smart interconnection option is not limited in the present application.

[0081] The "discover available network" pop-up window can be popped up in multiple scenarios, and other several feasible implementation manners are given below in combination with the accompanying drawings.

[0082] In another implementation, after the WLAN option 501, the Bluetooth option 502, and the smart interconnection option 503 are turned on respectively on the setting details page as shown in FIG. 7, the setting details page is exited immediately. The first electronic device does not pop up the "discover available network" pop-up window 60 in time on the user interface 3B. In this case, the first electronic device confirms the currently available network in response to the input opening operation of the application in the white list of the first electronic device. The currently available network is the first network provided by the second electronic device. The first electronic device pops up a network sharing confirmation pop-up window on the interface of the first electronic device in response to the confirmation action of the first network, and the network sharing confirmation pop-up window is used to input the network sharing request confirmation operation. For example, the first electronic device responds to the operation of the user opening any application (such as a music application) in the first electronic device which is located in the white list (which includes applications allowed to use network sharing). FIG. 8 shows the interface schematic diagram of another implementation of the first electronic device popping up the "discover available network" pop-up window in the network sharing method provided by the embodiments of the present application. As shown in FIG. 8, the first electronic device responds to the operation of the user opening the music application in the first electronic device, and the first electronic device detects the available network. When the first electronic device detects that there is no other available network in the available network list except the second electronic device, the first electronic device pops up the "discover available network" pop-up window 60 on the user interface 3C. The network of the second electronic device is a cellular network, i.e., a mobile data network, and the content of the "discover available network" pop-up window can include "use the mobile data network of the second electronic device to surf the Internet". For example, the network sharing module of the first electronic device detects that the second electronic device appears in the available network list and there is no other available network in the available network list when the first electronic device responds to the Internet request of the APP, and selects the network of the second electronic device as the available network. The white list is pre-set.

[0083] Alternatively, on the setting details page as shown in FIG. 7, the first electronic device receives the operation of the user clicking the cancel option in the "discover available network" pop-up window 60. In this case, the first electronic device responds to the operation of the user opening any application in the first electronic device which is located in the white list (which includes applications allowed to use network sharing), and the first electronic device pops up the "discover available network" pop-up window 60 as shown in FIG. 8 on the user interface 3C.

[0084] Alternatively, on the settings details page as shown in FIG. 7, the first electronic device receives an operation of the user clicking the cancel option in the discover available network pop-up window 60. The first electronic device, in response to the interception operation of the application internet request of the first electronic device, confirms the currently available network. The currently available network is the first network. In response to the confirmation action of the first network, the first electronic device pops up the discover available network pop-up window on the interface of the first electronic device, and the network sharing confirmation pop-up window is used to input the network sharing request confirmation operation. In some embodiments, the internet request can be intercepted by a virtual network card. The virtual network card is a software-simulated network card that is used to simulate a real network card capable of accessing the Internet by software, and is pre-registered by the first electronic device. When the first electronic device has no available network, the virtual network card intercepts the internet request to obtain the internet intention of the application of the first electronic device. In one implementation, the first electronic device creates a virtual network card at each boot, and registers the virtual network card to the connection service module, which is used to intercept the internet request and obtain the internet intention when the first electronic device has no available network. In one implementation, when the electronic device is powered off, the virtual network card is cleared to avoid the influence of the last network sharing service on the next network sharing service. The first electronic device application internet request includes the application internet request in the background of the first electronic device.

[0085] In yet another implementation, the user turns on the WLAN option 501, the Bluetooth option 502, and the smart interconnection option 503 on the settings details page as shown in FIG. 7, and then performs a screen-off operation. The first electronic device does not timely pop up the discover available network pop-up window 60 on the user interface 3B. In this case, the first electronic device receives the screen-on operation input by the user. FIG. 9 shows a schematic diagram of an interface of another implementation of the first electronic device popping up the discover available network pop-up window in a network sharing method according to an embodiment of the present application. As shown in FIG. 9, in another implementation, the user interface 3C of the first electronic device displays a screen-on interface. The first electronic device, in response to the screen-on operation input by the user, pops up the discover available network pop-up window 60 on the user interface 3C. The content of the discover available network pop-up window can include “use the mobile data network of the second electronic device to access the Internet”.

[0086] After the discover available network pop-up window is popped up, the first electronic device, in response to the operation of the user selecting the immediately connect option, triggers the first electronic device to perform the network sharing operation with the second electronic device.

[0087] The preset conditions include, in addition to the first electronic device and the second electronic device having the Bluetooth and WLAN turned on, the second electronic device being in an online state in the available network list of the first electronic device, and the first electronic device receiving the input network sharing request confirmation operation.

[0088] The network sharing confirmation operation is explained below.

[0089] The network sharing confirmation operation refers to the confirmation of the network sharing request performed by the user on the first electronic device. In an implementation, the first electronic device performs the network sharing confirmation operation in response to the user clicking the "immediately connect" button 601 of the "discover available networks" pop-up window 60 on the user interface 3B of the first electronic device as shown in FIG. 7, FIG. 8 or FIG. 9. It can be understood that the network sharing confirmation operation can also be realized through non-contact operations such as eye movement, language or gestures of the user. The specific form of the network sharing confirmation operation is not limited in the present application.

[0090] After the first electronic device responds to the network sharing confirmation operation performed by the user on the first electronic device, the first electronic device establishes a first network channel between the first electronic device and the second electronic device.

[0091] The first network channel can be a physical link of a peer-to-peer (P2P) connection for transmitting online data. For example, the online request can be sent from the first electronic device to the second electronic device via the first network channel. For another example, the data downloaded from the cloud of the second electronic device is sent to the first electronic device via the first network channel.

[0092] In some embodiments, the establishment of the first network channel depends on the opening of the WLAN function. In an implementation, the first electronic device creates a session by calling the interface of the connection module (Magiclink) and creates a physical link of a first peer-to-peer (P2P) connection, i.e. the first network channel. When the physical link is created, the peer-to-peer network card (i.e. P2P network card) of the first electronic device and the peer-to-peer network card (i.e. P2P network card) of the second electronic device establish a connection to form the first network channel. The first network channel establishes the connection between the first electronic device and the second electronic device.

[0093] In some scenarios, the second electronic device as the device sharing the network can be multiple. In the case that multiple second electronic devices are online on the available network list of the first electronic device, the first electronic device can select the first online second electronic device to establish the first network channel.

[0094] S2, the first electronic device sends a network sharing request to the second electronic device through the first network channel.

[0095] The network sharing request comprises a second instruction. The second instruction is used to instruct the second electronic device to open a network sharing switch, trigger an operation of the second electronic device configuring a proxy gateway, and perform an action of replying to the first device with a gateway configuration success when the action of the second electronic device configuring the proxy gateway is completed.

[0096] S3, in response to the network sharing request sent by the first electronic device, the second electronic device configures a proxy gateway, and replies to the first electronic device with a first instruction of proxy gateway configuration success.

[0097] The proxy gateway can limit or allow P2P connection. In some embodiments, the proxy gateway comprises self Internet Protocol (IP) forwarding, self Domain Name System (DNS) forwarding, Network Address Translation (NAT), Address Resolution Protocol (ARP) proxy, and traffic statistics, etc. In an implementation, a Distribute Gateway Service of the second electronic device can configure the proxy gateway.

[0098] The first instruction of proxy gateway configuration success is sent by the second electronic device in the case of successful configuration of the proxy gateway.

[0099] When the second electronic device replies to the first instruction to the first electronic device, the information comprises gateway configuration success and a network type shared by the second electronic device. The network type is one of "cellular network" or "WiFi network". In this embodiment, the network type is "cellular network". Exemplarily, the second electronic device feeds back the network type to the first electronic device in the form of a string. If the network type is "cellular network", the character is "1". If the network type is "WiFi network", the character is "2".

[0100] S4, in response to the first instruction, the first electronic device configures a virtual network path corresponding to the network type of the second electronic device included in the first instruction, so as to enable data interaction between the first electronic device and the second electronic device.

[0101] The data interaction is used for the second electronic device to share a first network of the second electronic device to the first electronic device.

[0102] In the case that the second electronic device shares mobile network traffic to the first electronic device, the virtual network path is a virtual mobile network (VMN). The virtual mobile network VMN includes a name, a type and a network card address. In an implementation, the name can be a preset name of a system of the first electronic device. The type is "Mobile". The network card address includes an address of a point-to-point network card (i.e. P2P network card) of the first electronic device.

[0103] In an implementation, the Distribute Gateway Service of the first electronic device can configure the virtual network path.

[0104] In some embodiments, the first electronic device, in response to the first instruction, configures a default gateway and a domain name mapping in addition to the virtual network path. In an implementation, the Distribute Gateway Service of the first electronic device can configure the default gateway and the domain name mapping.

[0105] The default gateway refers to a gateway designated by default by the first electronic device, which is used to receive and process network packets when the first electronic device has no available gateway.

[0106] The domain name mapping (Domain Name System, DNS) refers to a mapping of a domain name of the first electronic device to an IP address of the second electronic device.

[0107] The network sharing method enables the first electronic device and the second electronic device to communicate when the first electronic device has no available network by turning on the Bluetooth of the first electronic device and the Bluetooth of the second electronic device. After the second electronic device is online in the list of available networks of the first electronic device, the user can complete a network sharing confirmation operation on the first electronic device. The first electronic device establishes a first network path between the first electronic device and the second electronic device in response to an input network sharing confirmation operation by turning on the WLAN of the first electronic device and the WLAN of the second electronic device. The first electronic device sends a network sharing request to the second electronic device through the first network path, so that the second electronic device opens network sharing. The second electronic device configures a proxy gateway in response to the network sharing request. In the case that the proxy gateway configuration of the second electronic device is completed, the first electronic device configures a default gateway, a domain name mapping and a virtual mobile network in response to a reply of the first instruction that the proxy gateway configuration is successful. In this way, the second electronic device can share a cellular network to the first electronic device by using the virtual mobile network.

[0108] As shown in FIG. 10, in some embodiments, the first electronic device comprises a network sharing module and a connectivity service module, and when the first electronic device performs step S4, the network sharing method further comprises the following steps:

[0109] S41, the first electronic device establishes a virtual network path and registers a network provider.

[0110] In some embodiments, the network sharing module of the first electronic device establishes a virtual network path and registers a network provider.

[0111] S42, the first electronic device detects a first network provided by the second electronic device based on the virtual network path and the network provider.

[0112] In some embodiments, the network sharing module of the first electronic device registers the virtual network path and the network provider to the connectivity service module of the first electronic device.

[0113] The connectivity service module can detect the current available network of the first electronic device. In the case of registering the VMN to the connectivity service module of the Android system framework, the first electronic device considers that there is a network available for online, i.e. the first network provided by the second electronic device. For example, the first electronic device registers the virtual network path to the connectivity service module through the telephony.

[0114] After performing steps S41 and S42, the network sharing module informs the connectivity service module that the virtual network path has been established and the network provider has been registered, which is equivalent to informing the connectivity service module that there is a network available for use, i.e. the VMN. The connectivity service module will assign an id to this "VMN" in order to distinguish other available networks. Thus, the first electronic device is prepared for the application program to use the mobile network of the second electronic device.

[0115] As shown in FIG. 1, in some embodiments, after performing step S4, the network sharing method further comprises the following steps: prompting the user that the network sharing is successful and the mobile network of the second electronic device is being shared. In an implementation, a prompt pop-up window of "network sharing is successful and the mobile network of the second electronic device is being shared" is popped up on the screen of the first electronic device. It can be understood that a prompt pop-up window of "network sharing is successful and the mobile network is being shared to the first electronic device" can also be popped up on the screen of the second electronic device. In this way, the user can master the current network status of the first electronic device and the second electronic device, and the user experience is improved.

[0116] The network sharing method provided by the embodiments of the present application does not require the user to manually input a password, the probability of successful connection once is improved, and the user experience is improved.

[0117] The network sharing method provided by the embodiments of the present application can ensure signal coverage, signal speed and performance, and meet the needs of users, and provide a more simple and operable network sharing method.

[0118] In order to meet the online needs of the APP in the first electronic device after the second electronic device can share the mobile network to the first electronic device, FIG. 11 shows a timing diagram of the application program using the mobile network of the second electronic device in the first electronic device in a network sharing method provided by the embodiments of the present application. As shown in FIG. 11, in some embodiments, after step S4 is performed, the network sharing method further includes the following steps:

[0119] S541, the first electronic device responds to the online request of the first application program, creates a first network agent, and registers the first network agent to obtain routing information.

[0120] The first application program is an application program that needs to be connected to the network. The first application program can be a background program, such as data synchronization or location service. The first application program can also be a foreground program, such as a browser or a streaming media application.

[0121] As shown in FIG. 12, in an implementation, the first electronic device responds to the operation of the user opening the music application in the first electronic device. The user interface 3C of the first electronic device displays a music application detail page. In the music application detail page, the play option 901 is selected to play a song. The music application needs to obtain song data from the server, so it sends an online request to the operating system of the first electronic device.

[0122] In a scenario, the user opens an application program in the first electronic device that does not need to be connected to the network, such as a phonebook or a contact application, and step S541 can not be performed.

[0123] In some embodiments, after step S4 is performed, before step S541 is performed, the network sharing method further includes the following steps:

[0124] S540, the first electronic device transmits the online request of the first application program through a virtual network path.

[0125] In some embodiments, the connection service module of the first electronic device forwards the online request of the first application program to the network sharing module of the first electronic device through a virtual network path. The network sharing module of the first electronic device creates and registers a first network agent to obtain routing information in the case of receiving the online request of the first application program.

[0126] The routing information includes the address of the VMN (i.e. the address of the first network provided by the second electronic device).

[0127] S542, the first electronic device discovers the first network based on the routing information.

[0128] In some embodiments, the network proxy module of the first electronic device registers the routing information to the connection service module to discover the second electronic device network.

[0129] The steps S42 and S543 associate the routing information and the virtual network path, i.e. the network name and the network address. The first application program can discover the virtual network path.

[0130] S543, the first electronic device generates a notification message if it detects that the first network has been connected.

[0131] The notification message is used to prompt the first electronic device that the connection with the first network is successful.

[0132] In some embodiments, the network sharing module of the first electronic device detects whether the network corresponding to the virtual network path is connected. If the network sharing module of the first electronic device detects that the network has been connected, the user is notified that the network connection is successful.

[0133] It can be understood that the steps S541 to S543 are all completed internally in the first electronic device.

[0134] In an implementation, when the step S543 is performed, a prompt information appears on the screen of the first electronic device, and the prompt information includes: the network connection is successful, and the mobile network of the second electronic device is being shared. At this time, a prompt information also appears on the screen of the second electronic device, and the prompt information includes: the network connection is successful, and the mobile network of the first electronic device is being shared.

[0135] After the steps S541 to S543 are performed, the first electronic device can receive the data packet corresponding to the network request of the first application program. The first electronic device sends the data packet to the second electronic device through the default gateway. The second electronic device sends the data packet to the mobile network (cellular network card) through the proxy gateway. The cellular network card forwards the network request to the cloud to perform network sharing. In this way, after the default gateway, domain name mapping and virtual network path are successfully set, the second electronic device can share the mobile network to the first electronic device by using the virtual network path. The APP of the first electronic device can use the mobile network of the second electronic device to realize network access.

[0136] In the process of sharing the network by the first electronic device and the second electronic device, the scenario that the first electronic device needs to switch to another network can occur. FIG. 13 shows a scenario diagram of switching to a second network in a network sharing method according to an embodiment of the present application. As shown in FIG. 13, in some embodiments, the user interface 3E of the first electronic device displays a WLAN details page. The WLAN details page includes a WLAN connection option 101, a connected network option 103, and a list of available WLANs 102. The WLAN connection option 101 is in an on state. The connected network option 103 includes a first network 1031. In this case, the first electronic device is in a state of successfully connecting to the first network 1031. At this time, the first electronic device switches to the network in response to the operation of the user clicking the second network 1021 in the list of available WLANs 102. However, the first electronic device fails to successfully connect to the second network, resulting in a switching failure.

[0137] The second network can be a hotspot network provided by a third electronic device or a WiFi network provided by a router.

[0138] Before connecting to the second network, a VMN network path is virtually established on the first electronic device by performing steps S1 to S4, and the connection service module considers the VMN network path on the current device as the network path for online access. That is, the online access request of all applications on the first electronic device is sent to the VMN network path. At this time, the second network needs to be switched to the network path corresponding to the second network. However, the network path corresponding to the second network has no online access request, so the first electronic device cannot trigger the establishment of a network connection with the third electronic device. That is, the first electronic device cannot connect to the second network when the VMN network path is connected, resulting in a failure to connect to the second network.

[0139] Unlike this, when the first electronic device switches between different hotspots, for example, when the first electronic device switches from the second network to the third network, the online access request of the first electronic device is sent to the same hotspot network path. The hotspot network path is a physical link. At the same time, the IP address for connecting to the network in the first electronic device changes from the IP address of the second network to the IP address of the third network. In this way, the first electronic device triggers the establishment of a network connection with the third network based on the IP address of the third network and the online access request on the hotspot network path.

[0140] In order to solve the problem that the connection to other hotspots or routers in the WLAN list fails after the network sharing is successful, FIG. 14 shows a timing diagram of connecting to a second network in a network sharing method according to an embodiment of the present application. As shown in FIG. 14, after step S54 is performed, the network sharing method further includes the following steps:

[0141] S55, in response to the inputted selection operation on the second network, the first electronic device disconnects the virtual network path and confirms the second network path.

[0142] The second network path is a physical link for transmitting the online request of the application of the first electronic device when the first electronic device connects to the hotspot. In some embodiments, in the case that the first electronic device is an Android system, the second network path is pre-configured.

[0143] As shown in FIG. 13, after the first electronic device successfully connects to the first network 1031 (i.e. the mobile network provided by the second electronic device), in response to the user’s selection operation on the second network 1021 on the first electronic device, the first electronic device takes the second network as a new shared network. The first electronic device disconnects the virtual network path and stops the network sharing between the first electronic device and the second electronic device. As shown in FIG. 15, the user interface 3F of the first electronic device pops up a pop-up window 70 “the mobile data network connection with the second electronic device has been disconnected”.

[0144] In some embodiments, when step S55 is performed, the network sharing method further comprises the following steps: calling the destroy simulation network path (disableInternetBorrowing) interface of the distributed gateway in the wireless network connection interface to close the distributed gateway. In this way, in response to the user’s selection operation on the second network on the first electronic device, the first electronic device disconnects the virtual network path.

[0145] As shown in FIG. 16, in some embodiments, when step S55 is performed, the network sharing method further comprises the following steps:

[0146] S551, in response to the inputted selection operation on the second network, the first electronic device generates a network sharing disconnection instruction.

[0147] The network sharing disconnection instruction is used to instruct to destroy the first network agent.

[0148] In some embodiments, in addition to the network sharing module, the connectivity service module and the network agent module, the first electronic device further comprises a wireless network module. In response to the user’s selection operation on the second network on the first electronic device, the wireless network module of the first electronic device sends a “network sharing disconnection” instruction to the network sharing module.

[0149] S552, based on the network sharing disconnection instruction, the first electronic device destroys the first network agent.

[0150] In some embodiments, the network sharing module of the first electronic device, in response to receiving the "disconnect network sharing" instruction, notifies the network proxy module to destroy the first network proxy. The network sharing module, in response to the notification of "destroying the first network proxy", calls the network sharing interface to destroy the first network proxy.

[0151] In some embodiments, the first network proxy is newly created and registered for performing step S542.

[0152] S553, the first electronic device sends the online request of the second application to the second network path.

[0153] The connection service module of the first electronic device forwards the online request of the second application to the wireless network module of the first electronic device.

[0154] The online request of the second application is all the online requests of the applications that the first electronic device has not processed after performing step S551.

[0155] In this way, the connection service module queries the online request of the APP that the first electronic device has not processed, and finds the network (i.e. the second network) that can be used. Then, the online request of the second application is transmitted to the network path of the second network.

[0156] S554, the first electronic device sends a destruction completion instruction.

[0157] The destruction instruction is issued based on the first electronic device in the case of destroying the first network proxy, and is used to indicate that the destruction has been completed.

[0158] In some embodiments, the network proxy module of the first electronic device sends the destruction completion instruction to the network sharing module of the first electronic device, and notifies that the network connection has been destroyed.

[0159] The content of the destruction message can include: on Network Destroyed.

[0160] S555, the first electronic device, in response to receiving the destruction completion instruction, generates a success instruction.

[0161] The success instruction is used to trigger the first electronic device to perform the network connection operation of the second network.

[0162] In some embodiments, the network sharing module of the first electronic device, in response to receiving the destruction completion instruction, generates a success instruction; and sends the success instruction to the wireless network module of the first electronic device.

[0163] It can be understood that steps S551 to S555 are all completed internally in the first electronic device.

[0164] S56, the first electronic device accesses the second network based on the second network channel.

[0165] After step S56 is performed, in one implementation, the user interface 3G of the first electronic device displays a WLAN details page as shown in FIG. 17. The WLAN connection option 101 is in an on state. The connected network option 103 includes the second network 1032. In this case, the first electronic device is in a state of successfully connecting the second network 1032. In this way, the first electronic device completes the network switching operation.

[0166] To enable the user to master the progress of the network sharing between the first electronic device and the second electronic device, and improve the user experience, after step S56 is performed, in some embodiments, the network sharing method further includes the following step: the first electronic device prompts the user that the second electronic device network sharing has been disconnected. For example, a prompt pop-up window of "the second electronic device network sharing has been disconnected" pops up on the screen of the first electronic device.

[0167] In one implementation, the first electronic device replies to the second electronic device with "the second electronic device network disconnection is successful". After the second electronic device receives the information of "the second electronic device network disconnection is successful", the first electronic device prompts the user that the network sharing has been disconnected. For example, a prompt pop-up window of "disconnecting the network sharing with the first electronic device" pops up on the screen of the second electronic device.

[0168] As can be seen from the above embodiments, the network sharing method provided by the embodiments of the present application not only supports the mobile phone sharing the mobile network of the mobile phone, but also solves the problem of the user failing to connect the WIFI provided by the hotspot or router of other electronic devices in the WLAN list after the network sharing is successful.

[0169] The first electronic device can be not only a mobile phone, but also a tablet as shown in FIG. 18. The implementation can refer to the foregoing embodiments, and thus will not be described here.

[0170] In one scenario, the network environment is a local area network. For example, in an airport, when the user connects the second electronic device to the local area network, the login identity information needs to be input. The login identity information can be a phone number and a user name. When the user has only one phone number, the first electronic device without network cannot log in again because it cannot use the same phone number and user name to log in the local area network. Or, in a campus network, the user has only one login account. After the second electronic device logs in, other devices cannot access the network because they do not have the login account.

[0171] To solve the problem that the first electronic device cannot log in, FIG. 19 shows a scenario diagram of sharing a WiFi network from a mobile phone to a mobile phone in a network sharing method according to an embodiment of the present application. As shown in FIG. 19, in some embodiments, the user interface 4A of the second electronic device displays a settings details page, which includes a WLAN option 501s, a Bluetooth option 502s, and a mobile data option 504s. The WLAN option 501s is in a connected state. The Bluetooth option 502s is in an enabled state. The mobile data option 504s is in a disabled state. That is, the second electronic device currently uses a WiFi network. The settings of the first electronic device for preparing network sharing are described with reference to FIG. 2, which are not repeated here. As shown in FIG. 6, the first electronic device and the second electronic device log in to the same user account, and the second electronic device appears on the available network list of the first electronic device. This is not repeated here. The first electronic device is not connected to the WiFi network and has no mobile network traffic. The second electronic device is connected to the WiFi network and has no mobile network traffic. Through network sharing, the second electronic device shares the WiFi network to the first electronic device.

[0172] In the case that the second electronic device shares the WiFi network to the first electronic device, as shown in FIG. 20, in an implementation, the content of the "discover available networks" pop-up window 60s can include "use the WiFi network of the second electronic device to access the Internet".

[0173] FIG. 21 shows a timing diagram of sharing a WiFi network from a mobile phone to a mobile phone in a network sharing method according to an embodiment of the present application. As shown in FIG. 21, in some embodiments, compared with the case that the second electronic device shares a mobile network (cellular network) to the first electronic device, step S1 is the same as step S1', and step S2 is the same as step S2', which can be referred to each other. However, when performing step S3', the second electronic device replies to the first electronic device with a first instruction that the proxy gateway configuration is successful, and the network type in the information is "WiFi network". When performing step S4', the first electronic device responds to the first instruction, and according to the network type "WiFi network" of the second electronic device included in the first instruction, configures a virtual wireless network corresponding to the network type "WiFi network". The virtual wireless network includes a setting name, a type, and a network card address. In an implementation, the name can be a preset name of the system of the first electronic device. The type is "WiFi". The network card address is the address of a point-to-point network card (i.e., a P2P network card). After the default gateway, the domain name mapping, and the virtual wireless network are successfully set, the second electronic device can share the WiFi network to the first electronic device by using the virtual wireless network.

[0174] After the sharing of the network is successful, in an implementation, a prompt message appears on the screen of the first electronic device, and the prompt message includes: the network connection is successful, and the WiFi network of the second electronic device is being shared. At this time, a prompt message also appears on the screen of the second electronic device, and the prompt message includes: the network connection is successful, and the first electronic device is sharing the WiFi network of the second electronic device.

[0175] When the first electronic device needs to access the network, the first electronic device can connect to the network without inputting the login identity information again. In this way, the way of connecting to the network is more concise, and the user satisfaction is improved. In a scenario, the network environment of the local area network is a 5G network, the second electronic device can connect to the 5G network, and the first electronic device cannot connect to the 5G network. Through the network sharing method provided in the embodiments of the present application, the first electronic device can access the network by connecting to the second electronic device in the network sharing manner.

[0176] If the network type of the second electronic device is a WiFi network, and the first electronic device is configured with a virtual mobile network, the network sharing cannot be implemented.

[0177] In the above, if the network type of the second electronic device is a WiFi network, a virtual wireless network is established. If the network type of the second electronic device is a cellular network, a virtual mobile network is established. Based on the different network types of the second electronic device, the first electronic device is configured with different types of virtual network paths. The first electronic device can share different types of networks of the second electronic device, and the use scenarios are more extensive, and the user experience is improved.

[0178] In the case that the second electronic device can share the WiFi network for the first electronic device, in order to meet the network access requirement of the APP in the first electronic device, in some embodiments, when the virtual wireless network is configured, the network sharing method further includes the following step: registering the virtual wireless network to the connection service module.

[0179] The first electronic device can be a mobile phone, and can also be a tablet computer as shown in FIG. 22. The implementation can refer to the foregoing embodiments, and will not be described here.

[0180] It can be understood that in actual application scenarios, the number of the first electronic devices can be more than one.

[0181] As can be seen from the foregoing embodiments, the network sharing method provided in the embodiments of the present application can implement mobile network sharing and WiFi network sharing of mobile phone to mobile phone, mobile phone to tablet computer, mobile phone to computer, and the like. After the network sharing is implemented, the first electronic device can also successfully connect to other hotspots or routers on the WiFi list. Therefore, the operation of network connection is more convenient and intelligent, the network connection difficulty of the user is solved, more extensive use scenario requirements can be met, and the user experience is improved.

[0182] In addition, the network sharing method provided by the embodiments of the present application can trigger the first electronic device to perform subsequent steps of the network sharing service and complete the interaction process between the first electronic device and the second electronic device only by completing the network sharing confirmation operation on the first electronic device. The subsequent steps or the interaction process do not need the user to intervene again, for example, the user does not need to manually perform the network sharing start operation of the second electronic device, and the user does not need to manually complete the connection between the first electronic device and the second electronic device. The operation is convenient, and the user experience is improved.

[0183] Finally, the network sharing method provided by the embodiments of the present application does not need the second electronic device to identify when the user of the first electronic device uses the network, and solves the problem of that the first electronic device does not start the network sharing in time.

[0184] FIG. 23 shows a schematic diagram of the hardware structure of an electronic device.

[0185] The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0186] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0187] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated in one or more processors.

[0188] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.

[0189] The memory in the processor 110 can also be configured to store instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that have just been used or are repeatedly used by the processor 110. If the processor 110 needs to use the instructions or data again, it can directly call them from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.

[0190] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0191] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 can contain multiple sets of I2C bus. The processor 110 can be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces respectively. For example, the processor 110 can be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface, and the touch function of the electronic device 100 is realized.

[0192] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can contain multiple sets of I2S bus. The processor 110 can be coupled to the audio module 170 through the I2S bus, and communication between the processor 110 and the audio module 170 is realized. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the I2S interface, and the function of answering a phone through a Bluetooth headset is realized.

[0193] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled through the PCM bus interface. In some embodiments, the audio module 170 can also deliver audio signals to the wireless communication module 160 through the PCM interface, and the function of answering a phone through a Bluetooth headset is realized. Both the I2S interface and the PCM interface can be used for audio communication.

[0194] The UART interface is a universal serial data bus, which is used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is usually used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface, and the Bluetooth function is realized. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the UART interface, and the function of playing music through a Bluetooth headset is realized.

[0195] The MIPI interface can be used to connect the processor 110 and the display screen 194, the camera 193 and other peripheral devices. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), and the like. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to realize the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to realize the display function of the electronic device 100.

[0196] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 and the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.

[0197] The USB interface 130 is an interface that conforms to the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other electronic devices, such as AR devices and the like.

[0198] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 100. In other embodiments of the present application, the electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0199] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input through the wireless charging coil of the electronic device 100. The charging management module 140 can charge the battery 142 while also providing power to the electronic device through the power management module 141.

[0200] The power management module 141 is configured to connect the battery 142 and the charging management module 140 to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 can also be configured to monitor parameters such as the battery capacity, the number of battery cycles, the battery health status (leakage, impedance), and the like. In some embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.

[0201] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, and the like.

[0202] The antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be configured to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.

[0203] The mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G and the like applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter, amplify, and the like the received electromagnetic waves, and transmit the processed signals to the modem processor for demodulation. The mobile communication module 150 can also amplify signals modulated by the modem processor and radiate the signals as electromagnetic waves through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 can be disposed in the same device.

[0204] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a microphone 170B, etc.), or displays an image or a video through the display 194. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110 and disposed in the same device as the mobile communication module 150 or other functional modules.

[0205] The wireless communication module 160 can provide a wireless communication solution applied to the electronic device 100, including wireless local area networks (WLAN) (e.g., a wireless fidelity (WiFi) network), Bluetooth (BT), a global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, and the like. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification thereon, and radiate the signal as an electromagnetic wave via the antenna 2.

[0206] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (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), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).

[0207] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.

[0208] The display screen 194 is configured to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diodes (QLED), or the like. In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.

[0209] The electronic device 100 can implement the photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor.

[0210] The ISP is configured to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing to convert it into an image visible to the naked eye. The ISP can also optimize the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature, and other parameters of the shooting scene. In some embodiments, the ISP can be disposed in the camera 193.

[0211] The camera 193 is configured to capture still images or videos. An object generates an optical image through a lens and projects it onto a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device 100 can include one or N cameras 193, where N is a positive integer greater than 1.

[0212] The digital signal processor is used to process digital signals, in addition to being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0213] The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0214] The NPU is a neural-network (NN) calculation processor, which can quickly process input information by drawing on the structure of a biological neural network, such as drawing on the transmission mode between human brain neurons, and can also constantly self-learn. Through the NPU, the electronic device 100 can realize intelligent cognition applications such as image recognition, face recognition, voice recognition, text understanding, etc.

[0215] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to realize data storage functions. For example, music, video, etc. Files are saved in the external memory card.

[0216] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various function applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0217] The electronic device 100 can realize audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.

[0218] The audio module 170 is configured to convert digital audio information into an analog audio signal output, and to convert an analog audio input into a digital audio signal. The audio module 170 can also be configured to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some of the functions of the audio module 170 can be disposed in the processor 110.

[0219] The speaker 170A, also referred to as a "loudspeaker", is configured to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0220] The receiver 170B, also referred to as a "earpiece", is configured to convert an audio electrical signal into a sound signal. When the electronic device 100 receives a call or a voice message, the user can listen to the voice by holding the receiver 170B close to the ear.

[0221] The microphone 170C, also referred to as a "microphone", "transducer", is configured to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can make a sound by holding the mouth close to the microphone 170C, and input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, in addition to collecting sound signals, noise reduction functions can also be achieved. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, in addition to collecting sound signals, noise reduction, and can also identify the source of the sound, and realize the function of directional recording, etc.

[0222] The earphone interface 170D is configured to connect a wired earphone. The earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0223] The pressure sensor 180A is configured to sense a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. The pressure sensor 180A

[0224] There are many types of pressure sensors, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can include at least two parallel plates with conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view short messages is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.

[0225] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake photography. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate according to the angle, and lets the lens offset the shaking of the electronic device 100 by reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and motion sensing game scenarios.

[0226] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude, assists in positioning and navigation by the air pressure value measured by the barometric pressure sensor 180C.

[0227] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can detect the opening and closing of a flip cover with the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover according to the magnetic sensor 180D. Further, according to the detected opening and closing state of the cover or the opening and closing state of the flip cover, the electronic device 100 can set features such as automatic unlocking of the flip cover.

[0228] The acceleration sensor 180E can detect the magnitude of acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the electronic device posture, applied to landscape / portrait screen switching, pedometer, etc.

[0229] The distance sensor 180F is configured to measure distance. The electronic device 100 can measure distance by infrared or laser. In some embodiments, the electronic device 100 can utilize the distance sensor 180F to measure distance to achieve fast focus when taking a picture.

[0230] The proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode can be an infrared light emitting diode. The electronic device 100 emits infrared light outwardly through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using the photodiode. When sufficient reflected light is detected, the electronic device 100 can determine that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can utilize the proximity light sensor 180G to detect that a user is holding the electronic device 100 close to the ear for a phone call, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used for automatic unlocking and locking of the screen in a case mode or a pocket mode.

[0231] The ambient light sensor 180L is configured to sense ambient light brightness. The electronic device 100 can adaptively adjust the display screen 194 brightness according to the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust white balance when taking a picture. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touch.

[0232] The fingerprint sensor 180H is configured to collect a fingerprint. The electronic device 100 can utilize the collected fingerprint characteristics to implement fingerprint unlocking, access application lock, fingerprint picture taking, fingerprint call answering, and the like.

[0233] The temperature sensor 180J is configured to detect temperature. In some embodiments, the electronic device 100 utilizes the temperature detected by the temperature sensor 180J to implement temperature processing strategies. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of a processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold value, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 caused by low temperature. In other embodiments, when the temperature is lower than yet another threshold value, the electronic device 100 performs voltage boosting on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.

[0234] Touch sensor 180K, also referred to as "touch panel". Touch sensor 180K can be disposed on display screen 194, and touch sensor 180K and display screen 194 together form a touch screen, also referred to as "touch panel". Touch sensor 180K is configured to detect touch operations applied to or near the touch sensor 180K. The touch sensor 180K can transmit the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K can also be disposed on the surface of electronic device 100, which is different from the position of display screen 194.

[0235] Bone conduction sensor 180M can obtain vibration signals. In some embodiments, bone conduction sensor 180M can obtain vibration signals of the human body's vocal vibration bone block. Bone conduction sensor 180M can also contact the human body pulse to receive blood pressure pulsation signals. In some embodiments, bone conduction sensor 180M can also be disposed in a headset to form a bone conduction headset. Audio module 170 can analyze voice signals based on the vibration signals of the vocal vibration bone block obtained by the bone conduction sensor 180M to realize voice functions. The application processor can analyze heart rate information based on the blood pressure pulsation signals obtained by the bone conduction sensor 180M to realize heart rate detection functions.

[0236] Keys 190 include power on / off keys, volume keys, and the like. Keys 190 can be mechanical keys. They can also be touch keys. Electronic device 100 can receive key input and generate key signal input related to user settings and function control of electronic device 100.

[0237] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts and also for touch vibration feedback. For example, touch operations applied to different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. Touch operations applied to different regions of display screen 194 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminders, received messages, alarms, games, etc.) can also correspond to different vibration feedback effects. Touch vibration feedback effects can also be customizable.

[0238] Indicator 192 can be an indicator light, which can be used to indicate charging status, power changes, and also to indicate messages, missed calls, notifications, and the like.

[0239] The SIM card interface 195 is configured to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the electronic device 100. The electronic device 100 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external storage cards. The electronic device 100 interacts with a network through the SIM card to achieve functions such as call and data communication. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0240] The software system of the electronic device 100 can use a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. Embodiments of the present application exemplarily illustrate the software structure of the electronic device 100 by taking an Android system with a layered architecture as an example.

[0241] FIG. 24 is a block diagram of the software structure of an electronic device according to an embodiment of the present application.

[0242] The layered architecture divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Android runtime and system library, and a kernel layer.

[0243] The application layer can include a series of application packages.

[0244] As shown in FIG. 24, the application packages can include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, and the like.

[0245] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions.

[0246] As shown in FIG. 24, the application framework layer can include a network sharing module, a connectivity service module, a network agent module, a wireless network module, a telephony module, a connectivity module, a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, etc.

[0247] The network sharing module is configured to monitor the currently available network of the first electronic device.

[0248] The connectivity service module is configured to monitor the network connection state and send a broadcast notification when the network connection state changes. The connectivity service module is also configured to attempt to connect to other networks after a network connection fails, and provide an application interface for services in the application layer to obtain network state information, etc. In an embodiment of the present application, the connectivity service module is configured to provide an application interface for the upper-layer service App and enable the upper-layer service App to obtain network state information. The connectivity service module is also configured to monitor the currently available network of the electronic device.

[0249] The network agent module is configured to register routing information to the connectivity service module.

[0250] The wireless network module is configured to send a "disconnect network sharing" instruction to the network sharing module.

[0251] The telephony module is configured to provide the communication function of the first electronic device. For example, the management of the call state (including call connection, call hang-up, etc.). The telephony module is connected to a cellular channel and a WLAN channel, and communicates according to the cellular network generated by the cellular channel or the Wi-Fi generated by the WLAN channel.

[0252] The magiclink module can be used as an authentication or authorization mechanism for the network coordination service. For example, a session channel is created to transmit commands, requests, or notifications to other electronic devices, and to notify other electronic devices to open or close the network sharing service, etc.

[0253] The window manager is configured to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, and capture the screen, etc.

[0254] The content provider is configured to store and obtain data, and enable the data to be accessed by an application. The data can include videos, images, audios, dialed and received calls, browsing history and bookmarks, a phonebook, etc.

[0255] The view system includes visual controls, such as controls that display text, controls that display pictures, and the like. The view system can be used to build an application. A display interface can be composed of one or more views. For example, a display interface that includes a short message notification icon can include a view that displays text and a view that displays a picture.

[0256] The telephony manager is used to provide the communication function of the electronic device 100. For example, the management of the call status (including call connection, call hang-up, and the like).

[0257] The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.

[0258] The notification manager enables the application to display notification information in the status bar, which can be used to convey a message of the notification type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the completion of a download, a message reminder, and the like. The notification manager can also be a notification that appears in the form of a chart or a scroll bar text in the top status bar of the system, such as a notification of an application running in the background, and can also be a notification that appears in the form of a dialog window on the screen. For example, the text information is prompted in the status bar, a prompt sound is emitted, the electronic device is vibrated, the indicator light flashes, and the like.

[0259] The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0260] The core library includes two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.

[0261] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the java file of the application layer and the application framework layer into a binary file. The virtual machine is used to perform the management of the object life cycle, the management of the stack, the management of the thread, the management of the security and the exception, and the garbage collection, and the like.

[0262] The system library can include a plurality of functional modules. For example: a surface manager, media libraries, a three-dimensional graphics processing library (for example: OpenGL ES), a 2D graphics engine (for example: SGL), and the like.

[0263] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for a plurality of applications.

[0264] The media library supports multiple commonly used audio, video format playback and recording, and static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0265] The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc.

[0266] The 2D graphics engine is a drawing engine for 2D drawing.

[0267] The kernel layer is a layer between hardware and software. The kernel layer at least contains display drivers, camera drivers, audio drivers, and sensor drivers.

[0268] The following describes the workflow of the software and hardware of the electronic device 100 in conjunction with a capture photographing scenario.

[0269] When the touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, a timestamp of the touch operation, and other information). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer, and identifies the control corresponding to the input event. Taking the touch operation as a touch single-click operation, and the control corresponding to the single-click operation as the control of the camera application icon as an example, the camera application calls an interface of the application framework layer, starts the camera application, and then starts the camera driver through the kernel layer, and captures a still image or a video through the camera 193.

[0270] The description of the flow or structure corresponding to each of the above-described figures has its own emphasis. The part not described in detail in a certain flow or structure can be referred to the related description of other flows or structures.

[0271] The embodiment of the present application further provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the steps in each of the method embodiments.

[0272] The embodiment of the present application further provides a computer program product, when the computer program product runs on an electronic device, the electronic device can execute the steps in each of the method embodiments.

[0273] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the computer program is executed by a processor, the steps of each method embodiment described above can be executed. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms. The computer readable medium at least includes any entity or device capable of carrying the computer program code to the first device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc.

[0274] The chip system can be applied to the electronic device in the above-mentioned embodiments. As shown in FIG. 25, the chip system includes at least one processor 301 and at least one interface circuit 302. The processor 301 can be the processor in the above-mentioned electronic device. The processor 301 and the interface circuit 302 can be interconnected through a line. The processor 301 can receive and execute computer instructions from the memory of the above-mentioned electronic device through the interface circuit 302. When the computer instructions are executed by the processor 301, the electronic device can execute each step executed by the electronic device in the above-mentioned embodiments. The chip system can be a single chip or a chip module composed of multiple chips. The chip system can also include other discrete devices, which are not limited in the embodiments of the present application.

[0275] The above is merely specific implementation of the present application, but the protection scope of the present application is not limited to this. Any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A network sharing method, characterized by, The network sharing method applied to a first electronic device comprises: In response to the first electronic device and a second electronic device satisfying a preset condition, establishing a first network channel with the second electronic device; Through the first network channel, sending a network sharing request to the second electronic device; the network sharing request is used to trigger the operation of the second electronic device configuring a proxy gateway; In response to a first instruction, configuring a virtual network channel corresponding to the network type of the second electronic device included in the first instruction, so that the first electronic device interacts with the second electronic device through the virtual network channel; the data interaction is used for the second electronic device sharing the first network of the second electronic device to the first electronic device; the first instruction is issued by the second electronic device in the case of successfully configuring the proxy gateway.

2. The network sharing method of claim 1, wherein, After executing the step of responding to the first instruction, configuring the virtual network channel corresponding to the network type of the second electronic device included in the first instruction, the network sharing method further comprises: In response to the input of the second network selection operation, disconnecting the virtual network channel, confirming the second network channel; the second network channel is a physical link; Based on the second network channel, access the second network.

3. The network sharing method of claim 2, wherein, The second network includes a hotspot network provided by an electronic device and a wireless network provided by a router.

4. The network sharing method of claim 2 or 3, wherein, When executing the step of responding to the input of the second network selection operation, disconnecting the virtual network channel, the network sharing method further comprises: In the wireless network connection interface of the first electronic device, calling the distributed gateway destruction simulation network channel interface to close the distributed gateway.

5. The network sharing method of claim 2 or 3, wherein, When executing the step of responding to the input of the second network selection operation, disconnecting the virtual network channel, the network sharing method further comprises: In response to the input of the second network selection operation, generating a network sharing disconnection instruction; Based on the network sharing disconnection instruction, destroying the first network proxy; Sending the online request of the second application to the second network channel; Sending a destruction completion instruction; the destruction completion instruction is issued by the first electronic device in the case of destroying the first network proxy, and is used to indicate that the destruction has been completed; In response to receiving the destruction completion instruction, generating a success instruction; the success instruction is used to trigger the first electronic device to execute the network connection operation of the second network.

6. The network sharing method of any of claims 1-5, wherein, The response to the first instruction, configuring the virtual network channel corresponding to the network type of the second electronic device included in the first instruction, comprises: Establishing the virtual network channel, and registering a network provider; Based on the virtual network channel and the network provider, detecting the first network provided by the second electronic device.

7. The network sharing method of claim 6, wherein, After the step of configuring the virtual network path corresponding to the network type of the second electronic device according to the network type of the second electronic device included in the first instruction in response to the first instruction is performed, the network sharing method further comprises: In response to receiving an online request of a first application, a first network agent is newly created, and the first network agent is registered to obtain routing information; the online request is transmitted through the virtual network path; Based on the routing information, the first network is discovered; After the step of detecting a currently available network based on the virtual network path and the network provider is performed, the network sharing method further comprises: If it is detected that the first network has been connected, a notification message is generated; the notification message is used to prompt a successful connection with the first network.

8. The network sharing method of any of claims 1-7, wherein, The first electronic device and the second electronic device meet the preset conditions, which include that the Bluetooth and WLAN of the first electronic device are turned on, the Bluetooth and WLAN of the second electronic device are turned on; in the available network list of the first electronic device, the second electronic device is in an online state; the first electronic device receives an input network sharing request confirmation operation.

9. The network sharing method of any of claims 1-8, wherein, In a case where the currently connected network type of the second electronic device is a cellular network, the virtual network path is a virtual mobile network; The network sharing method further comprises: Based on the address of the point-to-point network card of the first electronic device, the virtual mobile network is configured.

10. The network sharing method of any of claims 1-8, wherein, In a case where the currently connected network of the second electronic device is a wireless network, the virtual network path is a virtual wireless network; The network sharing method further comprises: Based on the address of the point-to-point network card of the first electronic device, the virtual wireless network is configured.

11. The network sharing method of any of claims 1-10, wherein, The first electronic device is a mobile phone or a tablet, and the second electronic device is a mobile phone.

12. The network sharing method of claim 8, wherein, The network sharing method further comprises: In response to an input opening operation of an application in a white list of the first electronic device, a currently available network is confirmed; the currently available network is a first network; In response to a confirmation action on the first network, a network sharing confirmation pop-up window is popped up; the network sharing confirmation pop-up window is used to input a network sharing request confirmation operation.

13. The network sharing method of claim 8, wherein, The network sharing method further comprises: In response to an interception operation of an online request of an application of the first electronic device, a currently available network is confirmed; the currently available network is a first network; In response to a confirmation action on the first network, a network sharing confirmation pop-up window is popped up; the network sharing confirmation pop-up window is used to input a network sharing request confirmation operation.

14. A network sharing method characterized by, The network sharing method applied to a second electronic device comprises: In response to a network sharing request sent by a first electronic device, a proxy gateway is configured; In response to successful configuration of the proxy gateway, a first instruction indicating that the proxy gateway configuration is successful is replied to the first electronic device; the first instruction includes a network type of the second electronic device; the network type of the second electronic device is used for the first electronic device to configure a virtual network path, so that the first electronic device and the second electronic device can interact with each other.

15. The network sharing method of claim 14, wherein, The proxy gateway comprises Internet protocol forwarding, self domain name resolution system forwarding, network address translation, address resolution protocol proxy and traffic statistics.

16. An electronic device, comprising: The electronic device comprises one or more processors, a memory and a display screen; The memory is coupled to the one or more processors, and the memory is configured to store computer program codes, the computer program codes comprising computer instructions, and the one or more processors are configured to invoke the computer instructions to cause the electronic device to perform the method of any one of claims 1 to 13, or the method of any one of claims 14 to 15.

17. A chip system, characterized by The chip system is applied to an electronic device, and the chip system comprises one or more processors, and the processor is configured to invoke computer instructions to cause the electronic device to perform the method of any one of claims 1 to 13, or the method of any one of claims 14 to 15.

18. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises instructions, and when the instructions run on an electronic device, the electronic device is caused to perform the method of any one of claims 1 to 13, or the method of any one of claims 14 to 15.

Citation Information

Patent Citations

  • Network switching method, first electronic equipment and readable storage medium

    CN108900441A

  • Network sharing method and related equipment

    CN110536016A

  • Network sharing method and device, chip, electronic equipment and storage medium

    CN117377129A

  • Network sharing method and electronic equipment

    CN117715050A

  • Distributed network connection policy management

    US20100115101A1