Network sharing method, electronic equipment and chip system
By establishing virtual network pathways between electronic devices and configuring these pathways according to network type, the problem of limited application scenarios for network sharing methods is solved, enabling wider network sharing and a better user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-19
- Publication Date
- 2026-03-10
AI Technical Summary
Existing network sharing methods have limited application scenarios across different devices, resulting in poor user experience and failing to meet diverse network sharing needs.
By establishing a virtual network path between the first and second electronic devices, configuring different virtual network paths according to the network type of the second electronic device, network sharing is achieved, and the virtual network path is automatically disconnected and connected to the second network when the user selects the second network, simplifying the operation process.
It has broadened the scope of network sharing applications and improved the user experience, simplified the network switching process, and enhanced user satisfaction and ease of operation.
Smart Images

Figure CN121645554A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and particularly relates to a network sharing method, an electronic device and a chip system. BACKGROUND
[0002] With the development of network connection technology, multiple electronic devices can share the same network connection to facilitate communication and cooperation. The sharing of such 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.).
[0003] At present, the sharing of such network connection includes different scenarios and levels. For example, it can be home network sharing, multiple family members or devices sharing the same home network connection, for example, sharing the same WiFi router. For another example, it can be enterprise network sharing, in which multiple employees or departments share the same Local Area Network (LAN) or Wide Area Network (WAN) in an enterprise or office environment to access shared files, applications and resources. For another example, it can also be public network sharing, in which multiple users can share the same public WiFi network connection in a public place. For another example, it can be mobile network sharing, in which different devices share mobile network resources, for example, through a mobile hotspot. SUMMARY
[0004] To solve the above technical problems, the embodiments of the present application provide a network sharing method, an electronic device and a chip system. The technical scheme provided by the embodiments of 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 network of the second electronic device, thereby making the use scenarios of network sharing more extensive and improving the user experience.
[0005] To achieve the above technical purposes, the embodiments of the present application provide the following technical scheme:
[0006] 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.
[0007] 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.
[0008] 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.
[0009] 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.
[0010] 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.
[0011] 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.
[0012] 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 operation of cutting off the virtual network path without the user performing other operations, thereby completing the network sharing with the second network and improving the user experience.
[0013] 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 network sharing disconnection instruction in response to the inputted selection operation of the second network; destroying the first network agent based on the network sharing disconnection 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 by 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.
[0014] In this way, the user only needs to select the second network, and the first electronic device can complete the operation of cutting off the virtual network path without the user performing other operations, thereby completing the network sharing with the second network and improving the user experience.
[0015] 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.
[0016] 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.
[0017] 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.
[0018] 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.
[0019] According to the first aspect, or any one of the implementations of the first aspect, the first electronic device and the second electronic device satisfy 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.
[0020] 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.
[0021] 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.
[0022] 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; 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.
[0023] 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.
[0024] 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.
[0025] 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.
[0026] 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.
[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 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.
[0028] 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; the first 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 interact with data.
[0029] 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.
[0030] 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.
[0031] In 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 comprising computer instructions. The one or more processors invoke the computer instructions to cause the electronic device to perform the method according to the first aspect or the method according to the second aspect.
[0032] In a fourth aspect, a chip system is provided, which is applied to an electronic device. The chip system comprises one or more processors. The processor is configured to invoke computer instructions to cause the electronic device to perform the method according to the first aspect or the method according to the second aspect.
[0033] In a fifth aspect, a computer readable storage medium is provided, which comprises instructions. When the instructions are executed on an electronic device, the electronic device is caused to perform the method according to the first aspect or the method according to the second aspect. BRIEF DESCRIPTION OF DRAWINGS
[0034] Figure 1 A timing diagram of a network sharing method provided by an embodiment of the present application is shown;
[0035] Figure 2 An interface diagram of the first electronic device preparing to start network sharing in a network sharing method provided by an embodiment of the present application is shown;
[0036] Figure 3 An interface diagram of the second electronic device preparing to start network sharing in a network sharing method provided by an embodiment of the present application is shown;
[0037] Figure 4 An interface diagram of the first electronic device starting smart interconnection in a network sharing method provided by an embodiment of the present application is shown;
[0038] Figure 5 An interface diagram of the first electronic device starting smart interconnection in a network sharing method provided by an embodiment of the present application is shown;
[0039] Figure 6 Fig. 8 shows an interface schematic diagram of the first electronic device and the second electronic device logging in the same account in a network sharing method provided by an embodiment of the present application;
[0040] Figure 7 Fig. 9 shows an interface schematic diagram of the first electronic device popping up a "discover available network" pop-up window in a network sharing method provided by an embodiment of the present application;
[0041] Figure 8 Fig. 10 shows an interface schematic diagram of the first electronic device popping up another implementation of the "discover available network" pop-up window in a network sharing method provided by an embodiment of the present application;
[0042] Figure 9 Fig. 11 shows an interface schematic diagram of the first electronic device popping up another implementation of the "discover available network" pop-up window in a network sharing method provided by an embodiment of the present application;
[0043] Figure 10 Fig. 12 shows a timing diagram of establishing a virtual mobile network in a network sharing method provided by an embodiment of the present application;
[0044] Figure 11 Fig. 13 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 provided by an embodiment of the present application;
[0045] Figure 12 Fig. 14 shows an interface schematic diagram of the application program in the first electronic device sending an online request in a network sharing method provided by an embodiment of the present application;
[0046] Figure 13 Fig. 15 shows a scenario schematic diagram of switching the second network in a network sharing method provided by an embodiment of the present application;
[0047] Figure 14 Fig. 16 shows a timing diagram of connecting the second network in a network sharing method provided by an embodiment of the present application;
[0048] Figure 15 Fig. 17 shows an interface schematic diagram of the first electronic device popping up an interface of "the mobile data network connection with the second electronic device has been disconnected" in a network sharing method provided by an embodiment of the present application;
[0049] Figure 16 Fig. 18 shows a timing diagram of cutting off the virtual network path in a network sharing method provided by an embodiment of the present application;
[0050] Figure 17 Fig. 19 shows an interface schematic diagram of connecting the second network in a network sharing method provided by an embodiment of the present application;
[0051] Figure 18 A scenario schematic diagram of sharing a mobile network by a mobile phone to a tablet in a network sharing method provided by an embodiment of the present application is shown;
[0052] Figure 19 A scenario schematic diagram of sharing a WiFi network by a mobile phone to a mobile phone in a network sharing method provided by an embodiment of the present application is shown;
[0053] Figure 20 An interface schematic diagram of an implementation of popping up a "discover available network" pop-up window by a first electronic device in a network sharing method provided by an embodiment of the present application is shown;
[0054] Figure 21 A timing diagram of sharing a WiFi network by a mobile phone to a mobile phone in a network sharing method provided by an embodiment of the present application is shown;
[0055] Figure 22 A scenario schematic diagram of sharing a WiFi network by a mobile phone to a tablet in a network sharing method provided by an embodiment of the present application is shown;
[0056] Figure 23 A hardware structure schematic diagram of an electronic device provided by an embodiment of the present application is shown;
[0057] Figure 24 A software structure schematic diagram of an electronic device provided by an embodiment of the present application is shown;
[0058] Figure 25 A component schematic diagram of a chip system provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0059] 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; “and / or” in the present application 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 can represent: A alone, A and B together, and B 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 or similar items with 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, the use of “exemplary” or “for example” is intended to present the relevant concept in a specific manner, and to facilitate understanding.
[0060] 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.
[0061] 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 user experience. 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, a light, 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 (such as a water dispenser, an oven, a dishwasher, and the like), a smart sensor, and the like.
[0062] In some embodiments, the operating system of the electronic device can be an Android system
[0063] Through the Bluetooth channel or the WLAN channel, multiple electronic devices can exchange information.
[0064] The network traffic of the network sharing can be mobile network traffic or wireless network traffic.
[0065] 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.
[0066] The network sharing method provided by the embodiment of the present application is described in detail below by taking an example of sharing the network of a second electronic device by a first electronic device.
[0067] 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.
[0068] Figure 1 A timing diagram of a network sharing method provided by the embodiment of the present application is shown. As shown in the figure, Figure 1 In some embodiments, the network sharing method includes the following steps:
[0069] S1, in response to the first electronic device and the second electronic device meeting preset conditions, the first electronic device establishes a first network path between the first electronic device and the second electronic device.
[0070] The following describes the scenarios in which the first electronic device and the second electronic device meet the preset conditions.
[0071] Figure 2 This illustration shows a schematic diagram of the interface of a first electronic device preparing to enable network sharing in a network sharing method provided in an embodiment of this application. Figure 2 As shown, in some embodiments, the first electronic device may 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 enabled but not connected state. The Bluetooth option 502 is in an enabled state. The mobile data option 504 is in a disconnected state. When the mobile data option 504 is in a disconnected state, the first electronic device has no mobile network available.
[0072] Figure 3 This illustration shows a schematic diagram of the interface of a second electronic device preparing to enable network sharing in a network sharing method provided in an embodiment of this application. Figure 3 As shown, in some embodiments, the second electronic device may 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 enabled but not connected state. The Bluetooth option 502s is enabled. The mobile data option 504s is enabled. When the mobile data option 504s is enabled, the second electronic device is currently using a mobile network.
[0073] Communication between the first and second electronic devices is achieved by enabling Bluetooth on both devices. It's understood that even if the first and second electronic devices are not on the same local area network (hotspot), the first device can discover the second device via Bluetooth. Enabling WLAN on both devices allows for the subsequent establishment of a network sharing channel.
[0074] In some embodiments, such as Figure 4As shown, the user interface 3A of the first electronic device also includes a Smart Connectivity option 503. In response to a user clicking the Smart Connectivity option 503, the first electronic device enters the user interface 3A'. The user interface 3A' displays the Smart Connectivity details page. The Smart Connectivity details page includes a network sharing option 5031, which is enabled, allowing the first electronic device to use the shared network of other devices. The Smart Connectivity details page also includes a "My Other Devices" option 5032. For example, the "My Other Devices" option 5032 includes a second electronic device. If the network sharing option 5031 is disabled, the first electronic device cannot share the network. Similarly, as... Figure 5 As shown, the user interface 4A of the second electronic device also includes a Smart Connectivity option 503s on its settings details page. In response to the user clicking the Smart Connectivity option 503s, the second electronic device enters user interface 4B. User interface 4B displays the Smart Connectivity details page. The Smart Connectivity details page includes a network sharing option 5031s, which is enabled. The Smart Connectivity details page also includes a "My Other Devices" option 5032s. For example, "My Other Devices" option 5032s includes the first electronic device. In this case, the second electronic device can share its network with other electronic devices. This allows network sharing between the first and second electronic devices.
[0075] Figure 6 This illustration shows a schematic diagram of the interface where a first electronic device and a second electronic device log in to the same account in a network sharing method provided in an embodiment of this application. Figure 6 As shown, the account center details page of the first electronic device includes a user account option 801 and a user login option 802. The first electronic device receives the user account "00000000001" entered by the user in user account option 801, and then responds to the user clicking the login option 802, successfully logging into the first user account with the username "NAME01". The account center details page of the second electronic device includes a user account option 801s and a user login option 802s. The second electronic device receives the user account "00000000001" entered by the user in user account option 801s, and then responds to the user clicking the login option 802s, successfully logging into the first user account with the username "NAME01". In other words, the first and second electronic devices log into the same user account.
[0076] In this way, the first electronic device can discover a second electronic device nearby that can provide network sharing; that is, the second electronic device appears on the first electronic device's list of available networks. Or, in other words, the second electronic device goes online.
[0077] 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 in the same trust circle can be in a secure execution environment, and can isolate and protect the key system resources and data, so as to ensure that they are not accessed and attacked by unauthorized access. In addition, the first electronic device and the second electronic device in the same trust circle can access and transmit data to each other.
[0078] Figure 7 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 is shown. As shown in Figure 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.
[0079] In an implementation, as shown in Figure 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.
[0080] The pop-up of the "discover available network" pop-up window has multiple scenarios, and other several feasible implementation manners are given below in combination with the drawings.
[0081] In another implementation, as shown in Figure 7The first electronic device detects the available network in response to the user opening the music application in the first electronic device. 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 in response to the Internet access request of the APP, and selects the network of the second electronic device as the available network. The white list is pre-set. Figure 8 Fig. 3D shows a 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. 3D, Figure 8 The first electronic device detects the available network in response to the user opening the music application in the first electronic device. 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 in response to the Internet access request of the APP, and selects the network of the second electronic device as the available network. The white list is pre-set.
[0082] Alternatively, as shown in Fig. 3E, Figure 7 The first electronic device receives the user's operation of clicking the cancel option in the "discover available network" pop-up window 60 on the setting details page. In this case, the first electronic device pops up the "discover available network" pop-up window 60 as shown in Fig. 3F on the user interface 3C in response to the user opening any application in the first electronic device that is in the white list (which includes applications allowed to use network sharing). Figure 8
[0083] Alternatively, as shown in Fig. 3E, Figure 7 The first electronic device receives a user operation of clicking the cancel option in the "discover available network" pop-up window 60 on the setting details page shown. The first electronic device confirms the currently available network in response to the interception operation of the application internet request of the first electronic device. The currently available network is the first network. In response to the confirmation action of the first network, the "discover available network" pop-up window is popped up 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 can simulate a real network card capable of accessing the Internet by software. The virtual network card is pre-registered by the first electronic device, and is used to intercept the internet request when the first electronic device has no available network 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.
[0084] In yet another implementation, the user performs a screen-off operation immediately after turning on the WLAN option 501, the Bluetooth option 502, and the smart interconnection option 503 on the setting details page shown. Figure 7 The first electronic device does not pop up the "discover available network" pop-up window 60 on the user interface 3B in a timely manner. In this case, the first electronic device receives a user input of a screen-on operation. Figure 9 An interface schematic diagram of another implementation of the first electronic device popping up the "discover available network" pop-up window in a network sharing method provided by an embodiment of the application is shown. As shown in Figure 9 In yet another implementation, the user interface 3C of the first electronic device displays a screen-on interface. The first electronic device pops up the "discover available network" pop-up window 60 on the user interface 3C in response to a user input of a screen-on operation. 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".
[0085] After the "discover available network" pop-up window is popped up, the first electronic device triggers the first electronic device to perform the network sharing operation with the second electronic device in response to a user operation of selecting the "connect immediately" option.
[0086] The preset conditions 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, 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.
[0087] The network sharing confirmation operation is described below.
[0088] 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 manner, the first electronic device implements the network sharing confirmation operation of the first electronic device in response to the operation of the user clicking the "immediately connect" button 601 of the "discover available network" pop-up window 60 on the user interface 3B of the first electronic device as shown in FIG. 6B. 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. Figure 7 、 Figure 8 or Figure 9
[0089] 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.
[0090] The first network channel can be a physical link of a peer-to-peer (P2P) connection, which is used to transmit 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.
[0091] In some embodiments, the establishment of the first network channel depends on the turning on of the WLAN function. In an implementation manner, the first electronic device creates a session by calling the interface of the connection module (Magiclink), and at the same time, creates a physical link of a peer-to-peer (P2P) connection, that is, the first network channel. When the physical link is created, the peer-to-peer network card (that is, the P2P network card) of the first electronic device and the peer-to-peer network card (that is, the 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.
[0092] 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.
[0093] S2, the first electronic device sends a network sharing request to the second electronic device through the first network path.
[0094] The network sharing request includes a second instruction. The second instruction instructs the second electronic device to turn on the network sharing switch, triggers the second electronic device to configure the proxy gateway, and, upon completion of the proxy gateway configuration, replies to the first device that the gateway configuration is successful.
[0095] S3, the second electronic device responds to the network sharing request sent by the first electronic device by configuring the proxy gateway and replying to the first electronic device with a first instruction that the proxy gateway configuration is successful.
[0096] The proxy gateway can restrict or allow P2P connections. In some embodiments, the proxy gateway includes its own Internet Protocol (IP) forwarding, its own Domain Name System (DNS) forwarding, Network Address Translation (NAT), Address Resolution Protocol (ARP) proxying, and traffic statistics. In one implementation, the distribution gateway service of the second electronic device can be configured with the proxy gateway.
[0097] The first instruction indicating successful proxy gateway configuration is issued by the second electronic device upon successful proxy gateway configuration.
[0098] When the second electronic device responds to the first electronic device with the first instruction, this information includes information such as successful gateway configuration and the network type shared by the second electronic device. The network type is either "cellular network" or "WiFi network". In this embodiment, the network type is "cellular network". For example, the second electronic device replies to the first electronic device with the network type as a string. If the network type is "cellular network", the character is "1". If the network type is "WiFi network", the character is "2".
[0099] S4, the first electronic device responds to the first instruction and 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.
[0100] Data interaction is used for the second electronic device to share the first network of the second electronic device with the first electronic device.
[0101] In cases where a second electronic device shares mobile network traffic with a first electronic device, the virtual network path is a Virtual Mobile Network (VMN). The VMN includes settings for its name, type, and network interface card (NIC) address. In one implementation, the name can be a default name of the first electronic device's system. The type is "Mobile". The NIC address includes the address of the first electronic device's peer-to-peer (P2P) NIC.
[0102] In one implementation, the Distribute Gateway Service of the first electronic device can be configured with a virtual network path.
[0103] In some embodiments, in response to a first instruction, the first electronic device configures a default gateway and domain name mapping, in addition to configuring a virtual network path. In one implementation, the Distribute Gateway Service of the first electronic device can configure a default gateway and domain name mapping.
[0104] The default gateway refers to the gateway designated by default by the first electronic device, which is used to receive and process network data packets when the first electronic device has no available gateway.
[0105] Domain Name System (DNS) refers to the mapping between the domain name of a first electronic device and the IP address of a second electronic device.
[0106] This network sharing method enables communication between the first and second electronic devices by enabling Bluetooth on both devices, even when the first device lacks a network. Once the second electronic device is online in the first device's available network list, the user can confirm network sharing on the first device. By enabling WLAN on both devices, the first device responds to the network sharing confirmation to establish a first network path between them. The first device sends a network sharing request to the second device through this first network path, causing the second device to enable network sharing. The second device configures a proxy gateway in response to the network sharing request. Upon successful proxy gateway configuration, the first device responds with a first instruction indicating successful proxy gateway configuration. It then configures a default gateway, domain name mapping, and a virtual mobile network. This allows the second device to share its cellular network with the first device using the virtual mobile network.
[0107] like Figure 10As shown, in some embodiments, the first electronic device includes a network sharing module and a connection service module. When the first electronic device executes step S4, the network sharing method further includes the following steps:
[0108] S41, the first electronic device establishes a virtual network access path and registers a network provider.
[0109] In some embodiments, the network sharing module of the first electronic device establishes a virtual network path and registers a network provider.
[0110] S42, the first electronic device detects the first network provided by the second electronic device based on the virtual network path and network provider.
[0111] In some embodiments, the network sharing module of the first electronic device registers the virtual network path and network provider with the connection service module of the first electronic device.
[0112] The connection service module can detect the currently available networks of the first electronic device. When the VMN is registered with the connection service module of the Android system framework, the first electronic device recognizes that there is a network available for internet access, namely the first network provided by the second electronic device. For example, the first electronic device registers the virtual network path with the connection service module via the telephony module.
[0113] In steps S41 and S42, the network sharing module notifies the connection service module that "a virtual network path has been established and a network provider has been registered," essentially informing the connection service module that a usable network, namely VMN, exists. The connection service module assigns an ID to this "VMN" to distinguish it from other available networks. This prepares the application in the first electronic device for using the mobile network of the second electronic device.
[0114] like Figure 1 As shown, in some embodiments, after executing step S4, the network sharing method further includes the following step: prompting the user that network sharing is successful and that the mobile network of the second electronic device is being shared. In one implementation, a pop-up window displaying "Network sharing successful, sharing the mobile network of the second electronic device" appears on the screen of the first electronic device. It is understood that a pop-up window displaying "Network sharing successful, sharing the mobile network with the first electronic device" can also appear on the screen of the second electronic device. This allows the user to monitor the current network status of both the first and second electronic devices, improving the user experience.
[0115] The network sharing method provided in this application embodiment eliminates the need for users to manually enter a password, increasing the probability of a successful connection and improving the user experience.
[0116] The network sharing method provided in this application ensures that the signal type remains unchanged when sharing mobile network data with other devices. It guarantees signal coverage, signal speed, and performance. This meets user needs and provides a simpler and more user-friendly network sharing method.
[0117] After the second electronic device is able to share its mobile network with the first electronic device, in order to meet the internet access needs of the apps on the first electronic device, Figure 11 This illustration shows a timing diagram of an application in a first electronic device using the mobile network of a second electronic device in a network sharing method provided in an embodiment of this application. Figure 11 As shown, in some embodiments, after performing step S4, the network sharing method further includes the following steps:
[0118] S541, the first electronic device responds to receiving the Internet access request from the first application by creating a new first network proxy, registering the first network proxy, and obtaining routing information.
[0119] The first application is the application that requires an internet connection. The first application can be a background program, such as a data sync or location service. It can also be a foreground program, such as a browser or streaming media application.
[0120] like Figure 12 As shown, in one implementation, the first electronic device responds to a user's action of opening a music application on the first electronic device. The user interface 3C of the first electronic device displays a music application details page. Playback option 901 is selected on the music application details page to play a song. The music application needs to retrieve song data from a server, therefore it sends an internet access request to the operating system of the first electronic device.
[0121] In one scenario, if a user opens an application on a first electronic device that does not require internet access, such as a phonebook or address book application, step S541 may be skipped.
[0122] In some embodiments, after performing step S4 and before performing step S541, the network sharing method further includes the following steps:
[0123] S540, the first electronic device transmits the Internet access request of the first application through a virtual network path.
[0124] In some embodiments, the connection service module of the first electronic device forwards the internet access request of the first application to the network sharing module of the first electronic device through a virtual network path. Upon receiving the internet access request from the first application, the network sharing module of the first electronic device creates and registers a first network proxy and obtains routing information.
[0125] Routing information, including the address of the VMN (i.e., the address of the first network provided by the second electronic device).
[0126] S542, the first electronic device discovers the first network based on the routing information.
[0127] In some embodiments, the network proxy module of the first electronic device registers routing information with the connection service module to discover the network of the second electronic device.
[0128] Execute steps S42 and S543 to associate routing information with virtual network paths, that is, to associate network names with network addresses. The first application is then able to discover the virtual network paths.
[0129] S543, if the first electronic device detects that it has been connected to the first network, it generates a notification message.
[0130] The notification message is used to indicate that the first electronic device has successfully connected to the first network.
[0131] 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 is connected, it notifies the user that the network connection is successful.
[0132] It is understandable that steps S541 to S543 are all completed inside the first electronic device.
[0133] In one implementation, when step S543 is executed, a prompt message appears on the screen of the first electronic device, indicating that the network connection is successful and the mobile network of the second electronic device is being shared. At the same time, a prompt message also appears on the screen of the second electronic device, indicating that the network connection is successful and the first electronic device is sharing the mobile network.
[0134] After executing steps S541 to S543, the first electronic device can receive the data packets corresponding to the internet access request from the first application. The first electronic device sends the data packets to the second electronic device through the default gateway. The second electronic device sends the data packets to the mobile network (cellular network card) through the proxy gateway. The cellular network card forwards the internet access 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 with the first electronic device using the virtual network path. The app on the first electronic device can use the mobile network of the second electronic device to access the internet.
[0135] During the process of the first electronic device and the second electronic device sharing a network, there may be a scenario where the first electronic device needs to switch to another network. Figure 13This illustration shows a scenario of switching to a second network in a network sharing method provided in an embodiment of this application. Figure 13 As shown, 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 an available WLAN list 102. The WLAN connection option 101 is enabled. The connected network option 103 includes a first network 1031, in which case the first electronic device is successfully connected to the first network 1031. At this time, in response to the user clicking on a second network 1021 in the available WLAN list 102, the first electronic device switches networks. However, the first electronic device cannot successfully connect to the second network, resulting in a switching failure.
[0136] The second network can be a hotspot network provided by a third electronic device or a WIFI network provided by a router.
[0137] Before connecting to the second network, a virtual VMN network path has been created on the first electronic device through steps S1 to S4. The connection service module considers the VMN network path on the current device to be the network path for internet access. In other words, all internet access requests from applications on the first electronic device are sent to the VMN network path. Switching to the second network at this time requires connecting to the network path corresponding to the second network. However, since there are no internet access requests on the network path corresponding to the second network, the first electronic device will not be triggered to establish a network connection with the third electronic device. That is, when the first electronic device connects to the VMN network path, it cannot connect to the second network, resulting in a failure to connect to the second network.
[0138] In contrast, when the first electronic device switches between different hotspots, for example, from a second network to a third network, all internet access requests from the first electronic device are sent to the same hotspot network path. This hotspot network path is a physical link. Simultaneously, the IP address of the first electronic device connecting to the network changes from the IP address of the second network to the IP address of the third network. Thus, based on the IP address of the third network, internet access requests on the hotspot network path trigger the first electronic device to establish a network connection with the third network.
[0139] To resolve the issue of failing to connect to other hotspots or routers in the WLAN list after successful network sharing. Figure 14 This illustration shows a timing diagram of connecting a second network in a network sharing method provided in an embodiment of this application. Figure 14 As shown, in some embodiments, after performing step S54, the network sharing method further includes the following steps:
[0140] S55, in response to the input selection operation of the second network, the first electronic device disconnects the virtual network path and confirms the second network path.
[0141] The second network path is a physical link used to transmit internet access requests from applications on the first electronic device when the first electronic device connects to a hotspot. In some embodiments, when the first electronic device is an Android system, the second network path is pre-configured.
[0142] like Figure 13 As shown, 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 first electronic device of the second network 1021, the first electronic device uses the second network as the new shared network. The first electronic device disconnects the virtual network path, stopping network sharing between the first and second electronic devices. Figure 15 As shown, the user interface 3F of the first electronic device displays a pop-up window 70 stating "The mobile data network connection with the second electronic device has been lost".
[0143] In some embodiments, when performing step S55, the network sharing method further includes the following step: calling the disableInternetBorrowing interface of the distributed gateway in the wireless network connection interface to shut down the distributed gateway. Thus, the first electronic device disconnects the virtual network path in response to the user's selection of the second network on the first electronic device.
[0144] like Figure 16 As shown, in some embodiments, when performing step S55, the network sharing method further includes the following steps:
[0145] S551, the first electronic device generates a disconnect network sharing command in response to the input selection operation of the second network.
[0146] The Disconnect network share command is used to instruct the destruction of the first network agent.
[0147] In some embodiments, the first electronic device includes a network sharing module, a connectivity service module, and a network agent module, as well as a wireless network module. In response to a user's selection of a second network on the first electronic device, the wireless network module of the first electronic device sends a "disconnect network sharing" command to the network sharing module.
[0148] S552, the first electronic device destroys the first network agent based on the disconnect network sharing instruction.
[0149] In some embodiments, in response to receiving a "disconnect network sharing" instruction, the network sharing module of the first electronic device notifies the network proxy module to destroy the first network proxy. In response to the "destroy first network proxy" notification, the network sharing module invokes the network sharing interface to destroy the first network proxy.
[0150] The first network agent is created and registered in step S542.
[0151] S553, the first electronic device sends an internet access request for the second application to the second network path.
[0152] The connection service module of the first electronic device forwards the Internet access request of the second application to the wireless network module of the first electronic device.
[0153] The second application's internet access request is for all applications whose internet access requests were not processed by the first electronic device after step S551.
[0154] In this way, the connection service module queries the first electronic device for unprocessed app internet access requests and discovers an available network (i.e., the second network). Then, it transmits the second application's internet access request to the network path of the second network.
[0155] S554, the first electronic device sends a destruction completion command.
[0156] The destruction command is issued based on the destruction of the first network agent by the first electronic device, and is used to indicate that the destruction has been completed.
[0157] In some embodiments, the network proxy module of the first electronic device sends a destruction completion instruction to the network sharing module of the first electronic device, notifying that the network connection has been destroyed.
[0158] The content of the destruction message may include: "Connection destroyed (on Network Destroyed)".
[0159] S555, the first electronic device responds to receiving the destruction completion instruction and generates a success instruction.
[0160] The success instruction is used to trigger the first electronic device to perform a network connection operation for the second network.
[0161] In some embodiments, the network sharing module of the first electronic device generates a success instruction in response to receiving the destruction completion instruction; and sends the success instruction to the wireless network module of the first electronic device.
[0162] It is understandable that steps S551 to S555 are all completed inside the first electronic device.
[0163] S56, the first electronic device accesses the second network via the second network path.
[0164] After executing step S56, as follows Figure 17 As shown, in one implementation, the user interface 3G of the first electronic device displays a WLAN details page. The WLAN connection option 101 is enabled. The connected network option 103 includes a second network 1032, in which case the first electronic device is in a state of successfully connecting to the second network 1032. Thus, the first electronic device completes the network switching operation.
[0165] To enable users to keep track of the current network sharing progress between the first and second electronic devices and improve the user experience, such as... Figure 16 As shown, in some embodiments, after executing step S56, the network sharing method further includes the following step: the first electronic device prompts the user that the network sharing of the second electronic device has been disconnected. For example, a pop-up window displaying "The network sharing of the second electronic device has been disconnected" appears on the screen of the first electronic device.
[0166] In one implementation, the first electronic device replies to the second electronic device with "Second electronic device network disconnection successful." After receiving the "Second electronic device network disconnection successful" message, the first electronic device prompts the user that network sharing has been disconnected. For example, a pop-up window appears on the screen of the second electronic device displaying "Disconnected from network sharing with the first electronic device."
[0167] As can be seen from the above embodiments, the network sharing method provided in this application not only supports mobile phones sharing their mobile networks, but also solves the problem that users fail to connect to the hotspots of other electronic devices or the WIFI provided by routers in the WLAN list after successful network sharing.
[0168] The first electronic device can be not only a mobile phone, but also something like... Figure 18 The flat plate shown is described above. Implementation methods can be found in the foregoing embodiments and will not be repeated here.
[0169] In one scenario, the network environment is a local area network (LAN). For example, in an airport, when a user connects a second electronic device to this LAN, they need to enter login information. This login information can be a phone number and a username. If the user only has one phone number, the first electronic device, which lacks internet access, cannot log in using the same phone number and username, and therefore cannot access the LAN. Similarly, in a campus network, if a user only has one login account, after a second electronic device logs in, other devices will be unable to access the internet because they lack a login account.
[0170] To resolve the issue of the first electronic device being unable to log in Figure 19This illustration shows a scenario where a mobile phone shares a WiFi network with another mobile phone in a network sharing method provided in an embodiment of this application. Figure 19 As shown, 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 an disabled state. That is, the second electronic device is currently using a WiFi network. For the network sharing settings of the first electronic device, see [link to documentation]. Figure 2 This will not be elaborated upon here. See also Figure 6 As shown, both the first and second electronic devices are logged into the same user account, and the second electronic device appears on the first electronic device's list of available networks. Further details are omitted here. The first electronic device is not connected to a Wi-Fi network and has no mobile data usage. The second electronic device is connected to a Wi-Fi network and has not enabled mobile data. Through network sharing, the second electronic device shares its Wi-Fi network with the first electronic device.
[0171] In cases where the second electronic device shares its WiFi network with the first electronic device, such as Figure 20 As shown, in one implementation, the content of the "Discover Available Networks" pop-up window for 60 seconds may include "Use the WiFi network of the second electronic device to access the Internet".
[0172] Figure 21 This diagram illustrates a timing sequence of a mobile phone sharing a WiFi network with another mobile phone in a network sharing method provided in an embodiment of this application. Figure 21 As shown, in some embodiments, steps S1 and S1' are the same as when the second electronic device shares its mobile network (cellular network) with the first electronic device, and steps S2 and S2' are the same, and can be referred to interchangeably. However, when executing step S3', when the second electronic device replies to the first electronic device with the first instruction that the proxy gateway configuration is successful, the network type in the information is "WiFi network". When executing step S4', the first electronic device responds to the first instruction and configures a virtual wireless network corresponding to the network type "WiFi network" according to the network type "WiFi network" included in the first instruction. The virtual wireless network includes setting a name, type, and network card address. In one implementation, the name can be the default name of the first electronic device's system. The type is "WiFi". The network card address is the address of a peer-to-peer network card (i.e., a P2P network card). After the default gateway, domain name mapping, and virtual wireless network are successfully set, the second electronic device can share the WiFi network with the first electronic device using the virtual wireless network.
[0173] After successful network sharing, in one implementation, the screen of the first electronic device will display a notification message including: "Network connection successful, sharing the WiFi network of the second electronic device." At this time, the screen of the second electronic device will also display a notification message including: "Network connection successful, the first electronic device is sharing your WiFi network."
[0174] When the first electronic device needs to access the internet, it can connect without needing to enter login information, making the connection process simpler and improving user satisfaction. Furthermore, in one scenario, the local area network environment is a 5G network; the second electronic device can connect to the 5G network, while the first electronic device cannot. Through the network sharing method provided in this application embodiment, the first electronic device can access the internet by connecting to the second electronic device to share the network.
[0175] If the network type of the second electronic device is "Wi-Fi network" and the first electronic device is configured with a virtual mobile network, network sharing cannot be achieved.
[0176] If the second electronic device's network type is "WiFi," a virtual wireless network is established. If the second electronic device's network type is "cellular," 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 pathways. The first electronic device can share different types of networks from the second electronic device, expanding its application scenarios and improving the user experience.
[0177] In cases where the second electronic device can share a WiFi network with the first electronic device, in order to meet the internet access needs of the APP in the first electronic device, in some embodiments, when configuring a virtual wireless network, the network sharing method further includes the following step: registering the virtual wireless network to the connection service module.
[0178] The first electronic device can be not only a mobile phone, but also something like... Figure 22 The flat plate shown is described above. Implementation methods can be found in the foregoing embodiments and will not be repeated here.
[0179] Understandably, in real-world applications, there can be multiple primary electronic devices.
[0180] As can be seen from the above embodiments, the network sharing method provided in this application can realize mobile network sharing and WiFi network sharing between electronic devices such as mobile phones, mobile phones to tablets, and mobile phones to computers. Furthermore, after network sharing is achieved, it can also successfully connect to other hotspots or routers on the available WiFi list of the first electronic device. Therefore, network connection operations are more convenient and intelligent, not only solving users' network connection difficulties and meeting the needs of a wider range of usage scenarios, but also improving the user experience.
[0181] Furthermore, the network sharing method provided in this application only requires the user to complete a network sharing confirmation operation on the first electronic device to trigger subsequent steps of the network sharing service and complete the interaction process between the first and second electronic devices. Subsequent steps or interactions do not require user intervention. For example, the user does not need to manually enable network sharing on the second electronic device, nor does the user need to manually establish a connection between the first and second electronic devices. This convenient operation improves the user experience.
[0182] Finally, the network sharing method provided in this application embodiment does not require the second electronic device to identify when the user of the first electronic device uses the network, thus solving the problem that the first electronic device does not enable network sharing in a timely manner.
[0183] Figure 23 A schematic diagram of the hardware structure of the electronic device is shown.
[0184] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, universal serial bus (USB) interface 130, charging management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity 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.
[0185] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0186] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0187] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0188] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0189] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may 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.
[0190] 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 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 100.
[0191] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.
[0192] 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 via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0193] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically 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 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.
[0194] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CS1) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.
[0195] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0196] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, or USB Type-C port. USB port 130 can be used to connect a charger to charge electronic device 100, and can also be used for data transfer between electronic device 100 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0197] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0198] The charging management module 140 receives 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 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0199] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.
[0200] The wireless communication function of electronic device 100 can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.
[0201] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, 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 conjunction with tuning switches.
[0202] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.
[0203] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the 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. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.
[0204] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (WiFi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0205] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling electronic device 100 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may 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 technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0206] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0207] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0208] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0209] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0210] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. 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 passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0211] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0212] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0213] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0214] The external storage interface 120 can be used to connect an external memory card, such as a MicroSD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0215] Internal memory 121 can be used to store computer executable program code, which includes instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
[0216] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0217] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0218] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 170A.
[0219] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 170B can be brought close to the ear to listen to the voice.
[0220] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Electronic device 100 may have at least one microphone 170C. In some embodiments, electronic device 100 may have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.
[0221] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0222] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 100 can also calculate the touch position based on the detection signal from 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 commands. For example, when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.
[0223] The gyroscope sensor 180B can be used to determine the motion attitude of the electronic device 100. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the electronic device 100 about three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the shake of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the electronic device 100 by moving in the opposite direction, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.
[0224] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.
[0225] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. 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 using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.
[0226] The 180E accelerometer can detect the magnitude of acceleration of electronic device 100 in various directions (typically three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic devices and applied to applications such as screen orientation switching and pedometers.
[0227] A distance sensor 180F is used to measure distance. Electronic device 100 can measure distance via infrared or laser. In some embodiments, during a shooting scene, electronic device 100 can utilize the distance sensor 180F to measure distance for rapid focusing.
[0228] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined 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 may use the proximity sensor 180G to detect when a user holds the electronic device 100 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.
[0229] The ambient light sensor 180L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also work with the proximity sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0230] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can utilize the characteristics of the collected fingerprints to achieve fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, etc.
[0231] Temperature sensor 180J is used to detect temperature. In some embodiments, electronic device 100 uses the temperature detected by temperature sensor 180J to execute a temperature handling strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs thermal protection by reducing the performance of a processor located near temperature sensor 180J to reduce power consumption. In other embodiments, when the temperature is below another threshold, electronic device 100 heats battery 142 to prevent abnormal shutdown of electronic device 100 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, electronic device 100 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.
[0232] Touch sensor 180K, also known as a "touch panel," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touch screen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of electronic device 100, in a different position than display screen 194.
[0233] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be incorporated into headphones to form bone conduction headphones. The audio module 170 can parse the voice signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 180M to realize voice functionality. The application processor can parse heart rate information from the blood pressure signals acquired by the bone conduction sensor 180M to realize heart rate detection functionality.
[0234] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Electronic device 100 can receive button input and generate key signal inputs related to user settings and function control of electronic device 100.
[0235] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
[0236] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0237] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from 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, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as calls 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.
[0238] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.
[0239] Figure 24 This is a software structure block diagram of an electronic device according to an embodiment of the present invention.
[0240] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0241] The application layer can include a series of application packages.
[0242] like Figure 24 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.
[0243] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0244] like Figure 24As shown, the application framework layer may include a network sharing module, a connectivity service module, a network agent module, a wireless network module, a telephony module, a connection module (Magiclink), a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
[0245] The network sharing module is used to monitor the currently available networks of the first electronic device.
[0246] The connection service module is responsible for monitoring network connection status and issuing broadcast notifications when the connection status changes. It also attempts to connect to other networks after a network connection failure and provides application programming interfaces (APIs) to application layer services, enabling these services to obtain network status information. In this embodiment, the connection service module provides an API to the upper-layer business app, allowing it to obtain network status information. It also monitors the currently available networks on the electronic device.
[0247] The Network Agent module registers routing information with the Connection Service module.
[0248] The wireless network module sends a "disconnect network sharing" command to the network sharing module.
[0249] Telephony is used to provide communication functions for primary electronic devices. For example, it manages call status (including call connection and disconnection). Telephony connects to cellular networks, WLAN networks, etc., and communicates via cellular networks or Wi-Fi networks.
[0250] Magiclink can serve as an authentication or authorization mechanism for network collaboration services. For example, it can create session channels for transmitting commands, requests, or notifications with other electronic devices, and instruct other electronic devices to enable or disable network sharing services.
[0251] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0252] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0253] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0254] The phone manager is used to provide communication functions for electronic device 100. For example, it manages call status (including connection and disconnection).
[0255] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0256] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.
[0257] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
[0258] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.
[0259] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0260] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0261] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0262] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0263] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0264] A 2D graphics engine is a graphics engine for 2D drawing.
[0265] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0266] The following example, using a scene of capturing a photograph, illustrates the workflow of the software and hardware of the electronic device 100.
[0267] When 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, timestamp of the touch operation, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking a touch click as an example, where the corresponding control is the camera application icon, the camera application calls the application framework layer's interface to launch the camera application, and then calls the kernel layer to launch the camera driver, capturing still images or videos through camera 193.
[0268] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.
[0269] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the above-described method embodiments.
[0270] This application also provides a computer program product that, when run on an electronic device, enables the electronic device to execute the steps described in the various method embodiments above.
[0271] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can perform the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to the first device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include a USB flash drive, a portable hard drive, a magnetic disk, or an optical disk.
[0272] This application also provides a chip system that can be applied to the electronic devices described in the foregoing embodiments. For example... Figure 25 As shown, the chip system includes at least one processor 301 and at least one interface circuit 302. The processor 301 can be a processor in the aforementioned electronic device. The processor 301 and the interface circuit 302 can be interconnected via a circuit. The processor 301 can receive and execute computer instructions from the memory of the aforementioned electronic device through the interface circuit 302. When the computer instructions are executed by the processor 301, the electronic device can perform the various steps performed by the electronic device in the above embodiments. The chip system can be a single chip or a chip module composed of multiple chips. The chip system may also include other discrete devices, which are not specifically limited in this application embodiment.
[0273] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the 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, including 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 the case that the current connection 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 the case that the current connection 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, Applied to a second electronic device, the network sharing method 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 of successful configuration of the proxy gateway 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 interact with data.
15. The network sharing method of claim 14, wherein, The proxy gateway comprises an Internet protocol forwarding, a domain name resolution system forwarding of itself, a network address translation, an 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 including computer instructions, and the one or more processors are configured to invoke the computer instructions to cause the electronic device to perform the method according to any one of claims 1 to 13, or the method according to 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 configured to invoke computer instructions to cause the electronic device to perform the method according to any one of claims 1 to 13, or the method according to any one of claims 14 to 15.
18. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises instructions configured to cause an electronic device to perform the method according to any one of claims 1 to 13, or the method according to any one of claims 14 to 15 when the instructions are executed on the electronic device.