Network connection method, device and electronic device

By implementing proxy calls to the network interface of the second electronic device on a small-volume smart terminal, the high power consumption problem caused by the continuous operation of the modem is solved, and the terminal's battery life is improved.

CN113891441BActive Publication Date: 2025-02-14VIVO MOBILE COMM CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111366049.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-17
Publication Date
2025-02-14
Estimated Expiration
2041-11-17

AI Technical Summary

Technical Problem

The long-term continuous operation of the modem will lead to higher power consumption of the smart terminal, affecting the battery life of the small-volume smart terminal.

Method used

When the first electronic device meets the remote networking condition, the RPC operation request including the network interface function call number is sent to the second electronic device, causing the second electronic device to call the network interface function and return the response information to the first electronic device. device, thereby implementing proxy calls to the network interface of the second electronic device.

Benefits of technology

The working time of the network components that are owned by the first electronic device is reduced, the operating power consumption of the network components is reduced, and thus the battery life of the smart terminal is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113891441B_ABST
    Figure CN113891441B_ABST
Patent Text Reader

Abstract

The present application discloses a network connection method, device and electronic device, belonging to the field of electronic technology. The network connection method includes: when a remote network connection condition is met, a remote procedure call RPC operation request including a network interface function call number is sent to a second electronic device, so that the second electronic device calls the network interface call function indicated by the network interface function call number, generates an RPC operation response according to the response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device; receives the RPC operation response sent by the second electronic device; and parses the RPC operation response to obtain the response information of the network interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of electronic technology, and specifically relates to a network connection method, device and electronic equipment. Background Art

[0002] With the development of mobile Internet technology, small-sized smart terminals such as watches and bracelets have integrated modems to enable cellular network capabilities for users to communicate online. As a result, they have gradually become portable items for people to carry around in their lives, work, and travel. However, the long-term continuous operation of the modem will result in high power consumption of the smart terminal, affecting the battery life of the small-sized smart terminal. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a network connection method, device and electronic device, which can solve the problem that the long-term continuous operation of the modem affects the endurance of a small-volume smart terminal.

[0004] In order to solve the above technical problems, this application is implemented as follows:

[0005] In a first aspect, an embodiment of the present application provides a network connection method, which is applied to a first electronic device, and the method includes:

[0006] When the remote network connection condition is met, a remote procedure call (RPC) operation request including a network interface function call number is sent to the second electronic device, so that the second electronic device calls the network interface call function indicated by the network interface function call number, generates an RPC operation response according to response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device;

[0007] Receiving the RPC operation response sent by the second electronic device;

[0008] The response information of the network interface is obtained by parsing the RPC operation response.

[0009] In a second aspect, an embodiment of the present application provides a network connection method, which is applied to a second electronic device, and the method includes:

[0010] Receiving a remote procedure call operation request including a network interface function call number sent by a first electronic device;

[0011] Calling the network interface calling function indicated by the network interface function calling number;

[0012] Generate an RPC operation response according to the response information of the network interface called by the network interface call function;

[0013] The RPC operation response is sent to the first electronic device.

[0014] In a third aspect, an embodiment of the present application provides a network connection device, applied to a first electronic device, the device comprising:

[0015] a sending module, configured to send a remote procedure call (RPC) operation request including a network interface function call number to a second electronic device when a remote network connection condition is met, so that the second electronic device calls a network interface call function indicated by the network interface function call number, generates an RPC operation response according to response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device;

[0016] A receiving module, configured to receive the RPC operation response sent by the second electronic device;

[0017] A parsing module is used to parse the RPC operation response to obtain the response information of the network interface.

[0018] In a fourth aspect, an embodiment of the present application provides a network connection device, which is applied to a second electronic device, and the device includes:

[0019] A receiving module, configured to receive a remote procedure call (RPC) operation request including a network interface function call number sent by a first electronic device;

[0020] A calling module, used for calling the network interface calling function indicated by the network interface function calling number;

[0021] A generating module, used for generating an RPC operation response according to the response information of the network interface called by the network interface calling function;

[0022] A sending module is used to send the RPC operation response to the first electronic device.

[0023] In a fifth aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect or the second aspect.

[0024] In a sixth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect or the second aspect are implemented.

[0025] In the seventh aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect or the second aspect.

[0026] In an embodiment of the present application, when the first electronic device meets the remote networking condition, the first electronic device sends an RPC operation request including a network interface function call number to the second electronic device. So that the second electronic device calls the network interface call function indicated by the network interface function call number, and generates an RPC operation response according to the response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device. After receiving the RPC operation response sent by the second electronic device, the first electronic device can parse the response information of the network interface from the RPC operation response. In this technical solution, the first electronic device can send an RPC operation request to the second electronic device so that the second electronic device calls the local network interface and returns the response information of the network interface to the first electronic device. The proxy call of the network interface of the second electronic device by the first electronic device is realized, so that the network interface of the second electronic device provides the network communication capability for the first electronic device. Compared with the related art, it avoids the first electronic device from using its own network components such as modems to provide network communication capabilities. On the basis of ensuring that the first electronic device has network communication capabilities, the working time of the network components of the first electronic device is reduced, thereby reducing the impact of the high power consumption of the network components on the endurance of the first electronic device, and improving the endurance of the first electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a structural diagram of a network connection system provided in an embodiment of the present application.

[0028] Figure 2 It is a system framework diagram of a network connection system provided in an embodiment of the present application.

[0029] Figure 3 It is a flow chart of a network connection method provided in an embodiment of the present application.

[0030] Figure 4 It is a flowchart of another network connection method provided in an embodiment of the present application.

[0031] Figure 5 This is a flowchart of another network connection method provided in an embodiment of the present application.

[0032] Figure 6 This is a flowchart of another network connection method provided in an embodiment of the present application.

[0033] Figure 7 It is a block diagram of a network connection device provided in an embodiment of the present application.

[0034] Figure 8 It is a block diagram of another network connection device provided in an embodiment of the present application.

[0035] Fig. 9 It is a block diagram of an electronic device provided in an embodiment of the present application.

[0036] Fig.10 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0039] The network connection method provided in the embodiment of the present application is described in detail below through specific embodiments and application scenarios in conjunction with the accompanying drawings.

[0040] Please refer to Figure 1 , which shows a schematic diagram of the structure of a network connection system provided by an embodiment of the present application. Figure 1 As shown, the network connection system includes: a first electronic device 101 and a second electronic device 102. The first electronic device 101 and the second electronic device 102 can establish a connection based on protocols such as Bluetooth and Universal Serial Bus (USB), and then communicate through the established connection.

[0041] The following embodiments of the present application are described by taking Bluetooth communication between a first electronic device and a second electronic device as an example. Optionally, the first electronic device and / or the second electronic device may have a Bluetooth Low Energy (BLE) component and a classic Bluetooth (BT) module. The first electronic device and the second electronic device may be connected via a Bluetooth Low Energy component and / or a classic Bluetooth module to achieve a BLE connection or a BT connection between the first electronic device and the second electronic device.

[0042] Among them, the first electronic device and the second electronic device can run a remote procedure call (RPC) component so that the first electronic device has the ability to remotely call the function of the second electronic device. The first electronic device can send an RPC operation request to the second electronic device through the Bluetooth connection between it and the second electronic device, and the RPC operation request includes a network interface function call number. After receiving the RPC operation request, the second electronic device can call the network interface call function indicated by the network interface function call number. The network interface corresponding to the network interface call function is called through the network interface call function. The response information of the network interface is sent to the first electronic device, thereby realizing the proxy call of the network interface of the second electronic device by the first electronic device, so that the network interface of the second electronic device provides the network communication capability for the first electronic device. At this time, the first electronic device can act as a network proxy client, and the second electronic device can act as a network proxy server to provide network communication capability for the first electronic device. For example, the first electronic device and the second electronic device can be mobile phones, computers, wearable devices, etc. Figure 1 The following description is made by taking the first electronic device as a wearable device and the second electronic device as a mobile phone as an example.

[0043] Optionally, the first electronic device and the second electronic device may be connected based on Bluetooth as an example. Figure 2 , which shows a schematic diagram of the system framework of a network connection system provided by an embodiment of the present application. Figure 2 As shown, the first electronic device 101 includes a microcontroller unit (MCU), which includes: a Bluetooth physical link layer 1011, an RPC component layer 1012, and a network proxy client layer 1013. The second electronic device 102 includes: a Bluetooth physical link layer 1021, an RPC component layer 1022, and a network proxy server layer 1023.

[0044] Among them, the network proxy client layer 1013 of the first electronic device 101 and the network proxy server layer 1023 of the second electronic device 102 both include a network interface. The RPC component layer 1012 of the first electronic device 101 is used to generate an RPC operation request including a network interface function call number according to the RPC protocol. And the RPC operation request is transmitted to the Bluetooth physical link layer 1011. The Bluetooth physical link layer 1011 of the first electronic device 101 transmits the RPC operation request to the Bluetooth physical link layer 1021 of the second electronic device 102. The Bluetooth physical link layer 1021 transmits the received RPC operation request to the RPC component layer 1022. The RPC component layer 1022 parses the RPC operation request and obtains the calling number of the calling network interface function. The second electronic device 102 calls the network interface calling function indicated by the network interface function calling number, and calls the network interface in the network proxy server layer 1023 through the network interface calling function.

[0045] Please refer to Figure 3 , which shows a flow chart of a network connection method provided by an embodiment of the present application. The network connection method can be applied to Figure 1 or Figure 2 The network connection system shown. Figure 3 As shown, the network connection methods include:

[0046] Step 301: When a remote network connection condition is met, the first electronic device sends an RPC operation request including a network interface function call number to the second electronic device.

[0047] In an embodiment of the present application, the first electronic device can periodically or in real time detect the operating data of the first electronic device to determine whether the first electronic device meets the conditions for remote networking, so as to determine whether the first electronic device needs to execute a proxy call to the network interface of the second electronic device.

[0048] When the first electronic device does not meet the remote networking conditions, the first electronic device can call the local network interface to achieve network communication. When the first electronic device meets the remote networking conditions, the first electronic device can obtain the network interface function call number of the network interface function. The network interface function is used to call the network interface, and the network interface function call number is used to identify the network interface function. The network interface function call number of the network interface function is encapsulated according to the RPC protocol to generate an RPC operation request. The first electronic device can send an RPC operation request to the second electronic device through a connection established between it and the second electronic device based on Bluetooth. It should be noted that the RPC operation request can also include: networking parameters, the network address of the second electronic device and other information. Among them, the network interface is used to provide network communication functions. For example, the network interface can be a socket interface, which is also called a BSD socket interface, etc.

[0049] Among them, the remote networking condition may refer to the condition that the first electronic device can proxy call the network interface of other electronic devices. Optionally, the remote networking condition may include: the first electronic device is connected to the second electronic device; or the first electronic device is connected to the second electronic device, and the power consumption of the first electronic device is greater than the set power consumption threshold; or the first electronic device is connected to the second electronic device, and the power of the first electronic device is lower than the set power threshold.

[0050] For example, when the remote networking condition is that the first electronic device is connected to the second electronic device, the first electronic device can obtain the Bluetooth connection status between it and the second electronic device in real time. When it is detected that the Bluetooth connection status of the first electronic device and the second electronic device indicates that the first electronic device and the second electronic device are successfully connected based on Bluetooth, it is determined that the first electronic device meets the remote networking condition.

[0051] Step 302: The second electronic device calls the network interface calling function indicated by the network interface function calling number.

[0052] In the embodiment of the present application, after receiving the RPC operation request sent by the first electronic device, the second electronic device can parse the RPC operation request according to the RPC protocol to obtain the network interface function call number included in the RPC operation request. The second electronic device calls the network interface call function indicated by the network interface function call number to call the local network interface of the second electronic device through the network interface call function.

[0053] For example, the RPC operation request includes: a socket interface parameter and a network interface function call number for calling a network interface call function of the socket interface. After the second electronic device parses the RPC operation request, it obtains the socket interface parameter and the network interface function call number. The second electronic device calls the network interface function indicated by the network interface function call number and passes the socket interface parameter to the network interface function.

[0054] Step 303: The second electronic device generates an RPC operation response according to the response information of the network interface called by the network interface call function.

[0055] In the embodiment of the present application, the second electronic device calls the network interface calling function to call the network interface through the network interface calling function to obtain the response information returned by the network interface. The second electronic device encapsulates the response information according to the RPC protocol to generate an RPC operation response.

[0056] Step 304: The second electronic device sends an RPC operation response to the first electronic device.

[0057] In the embodiment of the present application, the second electronic device sends an RPC operation response to the first electronic device through the connection established between the second electronic device and the first electronic device based on Bluetooth.

[0058] Step 305: The first electronic device parses the RPC operation response to obtain response information of the network interface.

[0059] In the embodiment of the present application, after receiving the RPC operation response sent by the second electronic device, the first electronic device parses the RPC operation response, obtains the response information of the network interface, and implements the network communication function of the first electronic device.

[0060] In summary, the network connection method provided by the embodiment of the present application is that when the first electronic device meets the remote networking condition, the first electronic device sends an RPC operation request including a network interface function call number to the second electronic device. So that the second electronic device calls the network interface call function indicated by the network interface function call number, and generates an RPC operation response according to the response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device. After receiving the RPC operation response sent by the second electronic device, the first electronic device can parse the response information of the network interface from the RPC operation response. In this technical solution, the first electronic device can send an RPC operation request to the second electronic device so that the second electronic device calls the local network interface and returns the response information of the network interface to the first electronic device. The proxy call of the network interface of the second electronic device by the first electronic device is realized, so that the network interface of the second electronic device provides the network communication capability for the first electronic device. Compared with the related art, it avoids the first electronic device using its own network components such as modems to provide network communication capabilities. On the basis of ensuring that the first electronic device has network communication capabilities, the working time of the network component of the first electronic device is reduced, thereby reducing the impact of the high operating power consumption of the network component on the battery life of the first electronic device, thereby improving the battery life of the first electronic device.

[0061] Please refer to Figure 4 , which shows a flow chart of a network connection method provided by an embodiment of the present application. The network connection method can be applied to Figure 1 or Figure 2 The network connection system shown. Figure 4 As shown, the network connection methods include:

[0062] Step 401: When a remote network connection condition is met, the first electronic device sends an RPC operation request including a network interface function call number to the second electronic device.

[0063] The explanation and implementation of this step can refer to the explanation and implementation of the aforementioned step 301, and will not be elaborated in detail in the embodiment of the present application.

[0064] Step 402: The second electronic device calls the network interface calling function indicated by the network interface function calling number.

[0065] The explanation and implementation of this step can refer to the explanation and implementation of the aforementioned step 302, and will not be elaborated in detail in the embodiment of the present application.

[0066] It should be noted that, in an optional application scenario, both the first electronic device and the second electronic device can perform operations in a multiplexed manner. The embodiment of the present application is described by taking the example that both the first electronic device and the second electronic device can perform operations in a multiplexed manner. For example, the second electronic device can use a multiplexed listening function to call a network interface calling function. Then the second electronic device can create a handle of the network interface called by the network interface calling function, and the content of the handle is the second information. The second electronic device stores the handle of the network interface in the second storage space. The process of the second electronic device calling the network interface calling function indicated by the network interface function call number includes: when the multiplexed listening function is used to monitor that there is a handle of the network interface including the second information in the second storage space, the network interface calling function indicated by the network interface function call number is called.

[0067] Among them, the handle is also called the handle number, which is monitored by the multiplexing monitoring function. Optionally, the second storage space may store the handle of the network interface. The multiplexing monitoring function monitors the handle of the network interface. When the second electronic device uses the multiplexing monitoring function to monitor that there is a handle of the network interface including the second information in the second storage space, the process of calling the network interface calling function indicated by the network interface function calling number may include: when the handle of the network interface is monitored as the second information by using the multiplexing monitoring function, calling the network interface calling function indicated by the network interface function calling number. Optionally, the multiplexing monitoring function may be a select function or a poll function.

[0068] For example, the second electronic device establishes a handle of the network interface in response to the networking instruction, and the content of the handle is the second information. The handle of the network interface is stored in the second storage space. When the select function monitors that the handle of the network interface is the second information, the network interface call function indicated by the network interface function call number is called. Among them, the networking instruction can be triggered by the second electronic device when the user to whom the second electronic device belongs wants to use the second electronic device to use the network communication function. For example, the user clicks on the networking logo, so that when the second electronic device receives the click operation on the networking logo, it generates a networking instruction in response to the click operation.

[0069] Step 403: The second electronic device generates an RPC operation response according to the response information of the network interface called by the network interface call function.

[0070] In the embodiment of the present application, the second electronic device calls the network interface calling function to call the network interface through the network interface calling function to obtain the response information returned by the network interface. The second electronic device encapsulates the response information according to the RPC protocol to generate an RPC operation response.

[0071] Step 404: The second electronic device sends an RPC operation response to the first electronic device.

[0072] In the embodiment of the present application, the second electronic device sends an RPC operation response to the first electronic device through the connection established between the second electronic device and the first electronic device based on Bluetooth.

[0073] Step 405: The first electronic device parses the RPC operation response to obtain response information of the network interface.

[0074] In the embodiment of the present application, after receiving the RPC operation response sent by the second electronic device, the first electronic device parses the RPC operation response, obtains the response information of the network interface, and implements the network communication function of the first electronic device.

[0075] Step 406: The second electronic device updates the handle of the network interface from the second information to the first information, where the first information is used to indicate that the network interface is called through an RPC operation request.

[0076] Optionally, the first information may be designated information. Alternatively, the first information may be information generated according to the second information using a set rule. In the case where the first information may be information generated according to the second information using a set rule, the process in which the second electronic device updates the handle of the network interface from the second information to the first information may include: the second electronic device generates the first information according to the second information using the set rule, and updates the handle of the network interface from the second information to the first information.

[0077] For example, the content of the handle may be a numerical value, and the handle may be a fixed value greater than 100,000. The setting rule may be that the first information is the sum of the second information and 100,000. Assume that the handle of the network interface created by the second electronic device is 26, that is, the second information is 26, and the first information generated by the second electronic device according to the second information using the setting rule is 100026. The handle of the network interface is updated to 100026.

[0078] Step 407: The second electronic device sends a handle to the first electronic device.

[0079] In an embodiment of the present application, the second electronic device can send a handle of a network interface to the first electronic device through a connection established between the second electronic device and the first electronic device based on Bluetooth. It should be noted that step 406 can be performed before step 403, and the second electronic device generates an RPC operation response based on the response information of the network interface called by the network interface call function, which can be replaced by: the second electronic device generates an RPC operation response based on the response information of the network interface called by the network interface call function and the handle of the network interface. That is, the RPC operation response may include: the response information of the network interface and the handle of the network interface.

[0080] Step 408: The first electronic device stores the handle in the first storage space, and the handle is monitored by the multiplexing monitoring function.

[0081] In an embodiment of the present application, after receiving the handle of the network interface sent by the second electronic device, the first electronic device can store the handle of the network interface in the first storage space. For example, the first electronic device can include a virtual file system layer, and the first storage space can be a storage space corresponding to the virtual file system layer. The first electronic device can use a multiplexing function to monitor the handle stored in the first storage space.

[0082] Step 409: In response to the networking instruction, the first electronic device sends an RPC operation request to the second electronic device when it detects that a handle including the first information exists in the first storage space using a multiplexing monitoring function. The RPC operation request also includes the handle.

[0083] In an embodiment of the present application, when a user wants to use a network communication function, a target input for triggering the network communication function can be executed on the first electronic device, and a networking instruction is generated in response to the target input, and the networking instruction is used to reflect that the first electronic device needs to call a network interface. In response to the networking instruction, the first electronic device can locally call a network interface call function to call the network interface through the network interface call function. Obtain the response information of the network interface. Alternatively, the first electronic device can also send an RPC operation request to the second electronic device, so that the first electronic device executes a proxy call to the network interface of the second electronic device, thereby obtaining the response information of the network interface of the second electronic device.

[0084] Among them, the first electronic device responds to the networking instruction and determines whether a handle including the first information is monitored in the first storage space using a multiplexed monitoring function to determine whether the first electronic device can execute a proxy call to the network interface of the second electronic device by sending an RPC request to the second electronic device.

[0085] When the multiplexing listening function is used to monitor the existence of a handle including the first information in the first storage space, it indicates that the first electronic device can perform a proxy call to the network interface of the second electronic device. Then the first electronic device sends an RPC operation request to the second electronic device. The RPC operation request includes the network interface function call number and the handle of the network interface including the first information. When the multiplexing listening function is used to fail to monitor the existence of a handle including the first information in the first storage space, it indicates that the first electronic device cannot perform a proxy call to the network interface of the second electronic device. Then the first electronic device can call the network interface call function to obtain the response information of the network interface called by the network interface call function. That is, the first electronic device can call the local network interface to receive the response information of the network interface to achieve network communication.

[0086] Optionally, the first storage space may store a handle of a network interface. When the handle including the first information sent by the second electronic device is not received, the handle stored in the first storage space may be a handle of the network interface created by the first electronic device, and the handle includes third information. After the first electronic device receives the handle including the first information sent by the second electronic device, the process of the first electronic device storing the handle in the first storage space may include: the first electronic device updates the handle of the network interface including the third information in the first storage space to a handle including the first information.

[0087] Then the first electronic device can respond to the networking instruction and determine whether the handle of the network interface in the first storage space monitored by the multiplexing monitoring function is the first information. In the case that the handle of the network interface in the first storage space monitored by the multiplexing monitoring function is the first information, it is determined that there is a handle including the first information in the first storage space. In the case that the handle of the network interface in the first storage space monitored by the multiplexing monitoring function is not the first information, it is determined that there is no handle including the first information in the first storage space.

[0088] For example, let's continue with the example in the aforementioned step 406. The first electronic device determines whether the handle of the network interface in the first storage space monitored by the multiplexing monitoring function is 100026. In the case that the handle of the network interface in the first storage space monitored is 100026, an RPC operation request is sent to the second electronic device, so that the first electronic device responds to the RPC request, calls the local network interface, and returns the response information of the network interface to the second electronic device. In the case that the handle of the network interface in the first storage space monitored is not 100026, the first electronic device can call the local network interface to obtain the response information of the network interface.

[0089] Step 410: The second electronic device updates the received handle from the first information to the second information. Execute step 402.

[0090] In the embodiment of the present application, after receiving the RPC operation request including the handle of the network interface sent by the first electronic device, the second electronic device updates the received handle from the first information to the second information, and updates and stores the updated handle in the second storage space. Thus, the second electronic device executes step 402 and calls the network interface call function indicated by the network interface function call number when the multiplexing monitoring function is used to monitor the existence of the handle of the network interface including the second information in the second storage space.

[0091] Optionally, in the case where the first information is information generated according to the second information using set rules, the process by which the second electronic device updates the received handle from the first information to the second information may include: the second electronic device uses the set rules to restore and generate the second information according to the first information, and updates the handle of the network interface from the first information to the second information.

[0092] For example, the setting rule may be that the first information is the sum of the second information and 100000. Assume that the handle in the RPC operation request received by the second electronic device is 100026, and the second information generated by the second electronic device according to the first information using the setting rule is 26. The handle of the network interface in the first storage space is updated to 26.

[0093] In the embodiment of the present application, after the second electronic device calls the network interface call function indicated by the network interface function call number, the second electronic device updates the handle of the network interface to the first information indicating that the network interface is called through the RPC operation request, and sends the updated handle of the network interface to the first electronic device. Thus, when the first electronic device performs the operation in a multiplexing manner, it can determine whether the first electronic device performs a proxy call to the network interface of the second electronic device, or whether it performs a call to the local network interface of the first electronic device, according to whether the multiplexing monitoring function monitors the handle of the network interface including the first information. That is, the first electronic device can distinguish whether the first electronic device uses the network interface of the second electronic device to provide the first electronic device with the network communication capability, or the first electronic device uses its local network interface to provide the first electronic device with the network communication capability, according to whether the multiplexing monitoring function monitors the handle of the network interface including the first information, so that the first electronic device can be compatible with the local network interface call and the network interface call of the second electronic device, solving the call compatibility problem under multiplexing.

[0094] In summary, the network connection method provided by the embodiment of the present application is that when the first electronic device meets the remote networking condition, the first electronic device sends an RPC operation request including a network interface function call number to the second electronic device. So that the second electronic device calls the network interface call function indicated by the network interface function call number, and generates an RPC operation response according to the response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device. After receiving the RPC operation response sent by the second electronic device, the first electronic device can parse the response information of the network interface from the RPC operation response. In this technical solution, the first electronic device can send an RPC operation request to the second electronic device so that the second electronic device calls the local network interface and returns the response information of the network interface to the first electronic device. The proxy call of the network interface of the second electronic device by the first electronic device is realized, so that the network interface of the second electronic device provides the network communication capability for the first electronic device. Compared with the related art, it avoids the first electronic device using its own network components such as modems to provide network communication capabilities. On the basis of ensuring that the first electronic device has network communication capabilities, the working time of the network component of the first electronic device is reduced, thereby reducing the impact of the high operating power consumption of the network component on the battery life of the first electronic device, thereby improving the battery life of the first electronic device.

[0095] Please refer to Figure 5 , which shows a flow chart of a network connection method provided by an embodiment of the present application. The network connection method can be applied to Figure 1 or Figure 2 The network connection system shown is executed by the first electronic device. Figure 5 As shown, the network connection methods include:

[0096] Step 501: When the remote networking conditions are met, an RPC operation request including a network interface function call number is sent to a second electronic device, so that the second electronic device calls a network interface call function indicated by the network interface function call number, generates an RPC operation response based on response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device.

[0097] Step 502: Receive an RPC operation response sent by the second electronic device.

[0098] Step 503: parse the RPC operation response to obtain the response information of the network interface.

[0099] In an embodiment of the present application, when the first electronic device meets the remote networking condition, the first electronic device sends an RPC operation request including a network interface function call number to the second electronic device. So that the second electronic device calls the network interface call function indicated by the network interface function call number, and generates an RPC operation response according to the response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device. After receiving the RPC operation response sent by the second electronic device, the first electronic device can parse the response information of the network interface from the RPC operation response. In this technical solution, the first electronic device can send an RPC operation request to the second electronic device so that the second electronic device calls the local network interface and returns the response information of the network interface to the first electronic device. The proxy call of the network interface of the second electronic device by the first electronic device is realized, so that the network interface of the second electronic device provides the network communication capability for the first electronic device. Compared with the related art, it avoids the first electronic device from using its own network components such as modems to provide network communication capabilities. On the basis of ensuring that the first electronic device has network communication capabilities, the working time of the network components of the first electronic device is reduced, thereby reducing the impact of the high power consumption of the network components on the endurance of the first electronic device, and improving the endurance of the first electronic device.

[0100] Optionally, after sending a remote procedure call (RPC) operation request including a network interface function call number to the second electronic device, the method further includes:

[0101] Receive a handle of a network interface sent by a second electronic device, the handle including first information, the handle is sent to the first electronic device after the second electronic device calls the network interface, and the handle of the network interface is updated to the first information, the first information is used to indicate that the network interface is called through an RPC operation request;

[0102] The handle is stored in the first storage space, and the handle is monitored by the multiplexing monitoring function;

[0103] In response to the networking instruction, when the multiplexing monitoring function is used to monitor that there is a handle including the first information in the first storage space, an RPC operation request is sent to the second electronic device, and the RPC operation request also includes the handle.

[0104] Optionally, responding to the network connection instruction further includes:

[0105] In response to the networking instruction, when the multiplexing monitoring function fails to monitor the existence of a handle including the first information in the first storage space, the network interface calling function is called to obtain response information of the network interface called by the network interface calling function.

[0106] Optional remote connection conditions include:

[0107] The first electronic device is connected to the second electronic device; or,

[0108] The first electronic device is connected to the second electronic device, and the power consumption of the first electronic device is greater than a set power consumption threshold; or,

[0109] The first electronic device is connected to the second electronic device, and the power level of the first electronic device is lower than a set power level threshold.

[0110] In the network connection method provided in the embodiment of the present application, the explanation and implementation of each step can refer to the aforementioned Figure 3 or Figure 4 The explanation and implementation of the relevant steps in the network connection method shown are not repeated in the embodiments of the present application.

[0111] Please refer to Figure 6 , which shows a flow chart of a network connection method provided by an embodiment of the present application. The network connection method can be applied to Figure 1 or Figure 2 The network connection system shown is executed by the second electronic device. Figure 6 As shown, the network connection methods include:

[0112] Step 601: Receive an RPC operation request including a network interface function call number sent by a first electronic device.

[0113] Step 602: Call the network interface call function indicated by the network interface function call number.

[0114] Step 603: Generate an RPC operation response according to the response information of the network interface called by the network interface call function.

[0115] Step 604: Send an RPC operation response to the first electronic device.

[0116] In an embodiment of the present application, when the first electronic device meets the remote networking condition, the first electronic device sends a remote procedure call RPC operation request including a network interface function call number to the second electronic device. So that the second electronic device calls the network interface call function indicated by the network interface function call number, and generates an RPC operation response according to the response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device. After receiving the RPC operation response sent by the second electronic device, the first electronic device can parse the response information of the network interface from the RPC operation response. In this technical solution, the first electronic device can send an RPC operation request to the second electronic device so that the second electronic device calls the local network interface and returns the response information of the network interface to the first electronic device. The proxy call of the network interface of the second electronic device by the first electronic device is realized, so that the network interface of the second electronic device provides the network communication capability for the first electronic device. Compared with the related art, it avoids the first electronic device from using its own network components such as modems to provide network communication capabilities. On the basis of ensuring that the first electronic device has network communication capabilities, the working time of the network components of the first electronic device is reduced, thereby reducing the impact of the high power consumption of the network components on the endurance of the first electronic device, and improving the endurance of the first electronic device.

[0117] Optionally, the handle of the network interface is the second information, and after calling the network interface call function indicated by the network interface function call number, the method further includes:

[0118] Updating the handle of the network interface from the second information to the first information, where the first information is used to indicate that the network interface is called through the RPC operation request;

[0119] A handle is sent to the first electronic device.

[0120] Optionally, calling the network interface calling function indicated by the network interface function calling number includes: when a handle of a network interface including the second information exists in the second storage space by monitoring using the multiplexing monitoring function, calling the network interface calling function indicated by the network interface function calling number;

[0121] The method also includes:

[0122] Receiving an RPC operation request sent by a first electronic device, the RPC operation request further comprising: a handle of a network interface including the first information;

[0123] The received handle is updated from the first information to the second information, the updated handle is updated and stored in the second storage space, and the handle is monitored by the multiplexing monitoring function.

[0124] In the network connection method provided in the embodiment of the present application, the explanation and implementation of each step can refer to the aforementioned Figure 3 or Figure 4 The explanation and implementation of the relevant steps in the network connection method shown are not repeated in the embodiments of the present application.

[0125] It should be noted that the network connection method provided in the embodiment of the present application can be executed by a network connection device or a control module in the network connection device for executing the network connection method. In the embodiment of the present application, the network connection device provided in the embodiment of the present application is described by taking the network connection method executed by the network connection device as an example.

[0126] Please refer to Figure 7 , which shows a block diagram of a network connection device provided in an embodiment of the present application. The network connection device is applied to a first electronic device. Figure 7 As shown, the network connection device 700 includes:

[0127] The sending module 701 is used to send an RPC operation request including a network interface function call number to the second electronic device when the remote networking conditions are met, so that the second electronic device calls the network interface call function indicated by the network interface function call number, generates an RPC operation response according to the response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device.

[0128] The receiving module 702 is used to receive the RPC operation response sent by the second electronic device.

[0129] The parsing module 703 is used to parse the RPC operation response to obtain the response information of the network interface.

[0130] Optionally, the receiving module 702 is also used to receive a handle of a network interface sent by a second electronic device, the handle including first information. After the second electronic device calls the network interface, the handle of the network interface is updated to the first information and sent to the first electronic device. The first information is used to indicate that the network interface is called through an RPC operation request.

[0131] The device 700 further includes: a storage module, configured to store the handle in a first storage space, and the handle is monitored by a multiplexed monitoring function.

[0132] The sending module 701 is also used to respond to the networking instruction and send an RPC operation request to the second electronic device when the multiplexing monitoring function monitors that there is a handle including the first information in the first storage space, wherein the RPC operation request also includes the handle.

[0133] Optionally, the device 700 further includes:

[0134] The calling module is used to respond to the networking instruction and call the network interface calling function to obtain the response information of the network interface called by the network interface calling function when the multiplexing monitoring function fails to monitor the existence of the handle including the first information in the first storage space.

[0135] Optional remote connection conditions include:

[0136] The first electronic device is connected to the second electronic device; or,

[0137] The first electronic device is connected to the second electronic device, and the power consumption of the first electronic device is greater than a set power consumption threshold; or,

[0138] The first electronic device is connected to the second electronic device, and the power level of the first electronic device is lower than a set power level threshold.

[0139] In an embodiment of the present application, when the first electronic device meets the remote networking condition, the first electronic device sends a remote procedure call RPC operation request including a network interface function call number to the second electronic device. So that the second electronic device calls the network interface call function indicated by the network interface function call number, and generates an RPC operation response according to the response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device. After receiving the RPC operation response sent by the second electronic device, the first electronic device can parse the response information of the network interface from the RPC operation response. In this technical solution, the first electronic device can send an RPC operation request to the second electronic device so that the second electronic device calls the local network interface and returns the response information of the network interface to the first electronic device. The proxy call of the network interface of the second electronic device by the first electronic device is realized, so that the network interface of the second electronic device provides the network communication capability for the first electronic device. Compared with the related art, it avoids the first electronic device from using its own network components such as modems to provide network communication capabilities. On the basis of ensuring that the first electronic device has network communication capabilities, the working time of the network components of the first electronic device is reduced, thereby reducing the impact of the high power consumption of the network components on the endurance of the first electronic device, and improving the endurance of the first electronic device.

[0140] Please refer to Figure 8 , which shows a block diagram of a network connection device provided in an embodiment of the present application. The network connection device is applied to a first electronic device. Figure 8 As shown, the network connection device 800 includes:

[0141] The receiving module 801 is used to receive an RPC operation request including a network interface function call number sent by a first electronic device.

[0142] The calling module 802 is used to call the network interface calling function indicated by the network interface function calling number.

[0143] The generating module 803 is used to generate an RPC operation response according to the response information of the network interface called by the network interface calling function.

[0144] The sending module 804 is used to send an RPC operation response to the first electronic device.

[0145] Optionally, the handle of the network interface is the second information, and the apparatus 800 further includes:

[0146] The update module is used to update the handle of the network interface from the second information to the first information, where the first information is used to indicate that the network interface is called through an RPC operation request.

[0147] The sending module 804 is further configured to send a handle to the first electronic device.

[0148] Optionally, the calling module 802 is further used to: when the multiplexing monitoring function is used to monitor that the second storage space has a handle of the network interface including the second information, call the network interface calling function indicated by the network interface function calling number;

[0149] The receiving module 801 is further configured to receive an RPC operation request sent by the first electronic device, wherein the RPC operation request further includes: a handle of a network interface including the first information;

[0150] The update module is also used to update the received handle from the first information to the second information, and update and store the updated handle in the second storage space. The handle is monitored by the multiplexed monitoring function.

[0151] In an embodiment of the present application, when the first electronic device meets the remote networking condition, the first electronic device sends a remote procedure call RPC operation request including a network interface function call number to the second electronic device. So that the second electronic device calls the network interface call function indicated by the network interface function call number, and generates an RPC operation response according to the response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device. After receiving the RPC operation response sent by the second electronic device, the first electronic device can parse the response information of the network interface from the RPC operation response. In this technical solution, the first electronic device can send an RPC operation request to the second electronic device so that the second electronic device calls the local network interface and returns the response information of the network interface to the first electronic device. The proxy call of the network interface of the second electronic device by the first electronic device is realized, so that the network interface of the second electronic device provides the network communication capability for the first electronic device. Compared with the related art, it avoids the first electronic device from using its own network components such as modems to provide network communication capabilities. On the basis of ensuring that the first electronic device has network communication capabilities, the working time of the network components of the first electronic device is reduced, thereby reducing the impact of the high power consumption of the network components on the endurance of the first electronic device, and improving the endurance of the first electronic device.

[0152] The network connection device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0153] The network connection device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0154] The network connection device provided in the embodiment of the present application can achieve Figures 3 to 6To avoid repetition, each process implemented by any of the method embodiments shown will not be described in detail here.

[0155] Optional, such as Fig. 9 As shown, an embodiment of the present application also provides an electronic device 900, including a processor 901, a memory 902, and a program or instruction stored in the memory 902 and executable on the processor 901. When the program or instruction is executed by the processor 901, each process of the above-mentioned network connection method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0156] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0157] Fig.10 The hardware structure diagram of an electronic device for implementing the embodiment of the present application is shown in FIG. The electronic device 1000 includes, but is not limited to, a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010.

[0158] Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.10 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0159] Wherein, in the case where the electronic device is a first electronic device, the processor 1010 is used to send a remote procedure call RPC operation request including a network interface function call number to a second electronic device when a remote networking condition is met, so that the second electronic device calls a network interface call function indicated by the network interface function call number, generates an RPC operation response according to response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device;

[0160] The processor 1010 is further configured to receive the RPC operation response sent by the second electronic device;

[0161] The processor 1010 is further configured to parse the RPC operation response to obtain response information of the network interface.

[0162] In an embodiment of the present application, when the first electronic device meets the remote networking condition, the first electronic device sends an RPC operation request including a network interface function call number to the second electronic device. So that the second electronic device calls the network interface call function indicated by the network interface function call number, and generates an RPC operation response according to the response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device. After receiving the RPC operation response sent by the second electronic device, the first electronic device can parse the response information of the network interface from the RPC operation response. In this technical solution, the first electronic device can send an RPC operation request to the second electronic device so that the second electronic device calls the local network interface and returns the response information of the network interface to the first electronic device. The proxy call of the network interface of the second electronic device by the first electronic device is realized, so that the network interface of the second electronic device provides the network communication capability for the first electronic device. Compared with the related art, it avoids the first electronic device from using its own network components such as modems to provide network communication capabilities. On the basis of ensuring that the first electronic device has network communication capabilities, the working time of the network components of the first electronic device is reduced, thereby reducing the impact of the high power consumption of the network components on the endurance of the first electronic device, and improving the endurance of the first electronic device.

[0163] Optionally, the processor 1010 is further configured to:

[0164] receiving a handle of the network interface sent by the second electronic device, the handle comprising first information, the handle being sent to the first electronic device after the second electronic device calls the network interface, and updating the handle of the network interface to the first information, the first information being used to indicate that the network interface is called through an RPC operation request;

[0165] Storing the handle in a first storage space, wherein the handle is monitored by a multiplexing monitoring function;

[0166] In response to the networking instruction, when the multiplexing monitoring function monitors that there is a handle including the first information in the first storage space, the RPC operation request is sent to the second electronic device, and the RPC operation request also includes the handle.

[0167] Optionally, processor 1010 is further used to: in response to the networking instruction, call the network interface calling function and obtain response information of the network interface called by the network interface calling function when the multiplexing listening function does not detect the existence of a handle including the first information in the first storage space.

[0168] Optionally, the remote network connection conditions include:

[0169] The first electronic device is connected to the second electronic device; or,

[0170] The first electronic device is connected to the second electronic device, and the power consumption of the first electronic device is greater than a set power consumption threshold; or,

[0171] The first electronic device is connected to the second electronic device, and the power level of the first electronic device is lower than a set power threshold.

[0172] In the case where the electronic device is the second electronic device, the processor 1010 is configured to receive a remote procedure call (RPC) operation request including a network interface function call number sent by the first electronic device;

[0173] Processor 1010 is further used to call the network interface call function indicated by the network interface function call number; and is further used to generate an RPC operation response based on the response information of the network interface called by the network interface call function; and send the RPC operation response to the first electronic device.

[0174] Optionally, the handle of the network interface is the second information, and the processor 1010 is further configured to:

[0175] Updating the handle of the network interface from the second information to the first information, where the first information is used to indicate that the network interface is called through an RPC operation request;

[0176] The handle is sent to the first electronic device.

[0177] Optionally, the processor 1010 is further configured to: when a handle of the network interface including the second information is detected in the second storage space by using a multiplexing monitoring function, call a network interface calling function indicated by the network interface function calling number;

[0178] receiving the RPC operation request sent by the first electronic device, wherein the RPC operation request further includes: a handle of the network interface including the first information;

[0179] The received handle is updated from the first information to the second information, and the updated handle is updated and stored in the second storage space, and the handle is monitored by the multiplexing monitoring function.

[0180] It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1007 includes a touch panel 10071 and other input devices 10072. The touch panel 10071 is also called a touch screen. The touch panel 10071 may include two parts: a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 1009 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 1010 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 1010.

[0181] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned network connection method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0182] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0183] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned network connection method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0184] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0185] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0186] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0187] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A network connection method, characterized in that: Applied to a first electronic device, the method includes: When the remote network connection condition is met, a remote procedure call (RPC) operation request including a network interface function call number is sent to the second electronic device, so that the second electronic device calls the network interface call function indicated by the network interface function call number, generates an RPC operation response according to response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device; Receiving the RPC operation response sent by the second electronic device; Parsing the RPC operation response to obtain response information of the network interface; After sending the remote procedure call (RPC) operation request including the network interface function call number to the second electronic device, the method further includes: receiving a handle of the network interface sent by the second electronic device, the handle comprising first information, the handle being sent to the first electronic device after the second electronic device calls the network interface, and updating the handle of the network interface to the first information, the first information being used to indicate that the network interface is called through an RPC operation request; Storing the handle in a first storage space, wherein the handle is monitored by a multiplexing monitoring function; In response to the networking instruction, when the multiplexing monitoring function monitors that there is a handle including the first information in the first storage space, the RPC operation request is sent to the second electronic device, and the RPC operation request also includes the handle.

2. The method according to claim 1, characterized in that The responding to the network connection instruction further comprises: In response to the networking instruction, when the multiplexing monitoring function does not detect the existence of a handle including the first information in the first storage space, the network interface calling function is called to obtain response information of the network interface called by the network interface calling function.

3. The method according to claim 1, characterized in that The remote connection conditions include: The first electronic device is connected to the second electronic device; or, The first electronic device is connected to the second electronic device, and the power consumption of the first electronic device is greater than a set power consumption threshold; or, The first electronic device is connected to the second electronic device, and the power level of the first electronic device is lower than a set power threshold.

4. A network connection method, characterized in that: Applied to a second electronic device, the method includes: Receiving a remote procedure call (RPC) operation request including a network interface function call number sent by a first electronic device; Calling the network interface calling function indicated by the network interface function calling number; Generate an RPC operation response according to the response information of the network interface called by the network interface call function; Sending the RPC operation response to the first electronic device; The handle of the network interface is the second information, and after calling the network interface call function indicated by the network interface function call number, the method further includes: Updating the handle of the network interface from the second information to the first information, where the first information is used to indicate that the network interface is called through an RPC operation request; The handle is sent to the first electronic device.

5. The method according to claim 4, characterized in that The calling of the network interface calling function indicated by the network interface function calling number comprises: when a handle of the network interface including the second information is detected in the second storage space by using a multiplexing monitoring function, calling the network interface calling function indicated by the network interface function calling number; The method further comprises: receiving the RPC operation request sent by the first electronic device, wherein the RPC operation request further includes: a handle of the network interface including the first information; The received handle is updated from the first information to the second information, and the updated handle is updated and stored in the second storage space, and the handle is monitored by the multiplexing monitoring function.

6. A network connection device, characterized in that: Applied to a first electronic device, the device comprises: a sending module, configured to send a remote procedure call (RPC) operation request including a network interface function call number to a second electronic device when a remote network connection condition is met, so that the second electronic device calls a network interface call function indicated by the network interface function call number, generates an RPC operation response according to response information of the network interface called by the network interface call function, and sends the RPC operation response to the first electronic device; A receiving module, configured to receive the RPC operation response sent by the second electronic device; A parsing module, used for parsing the RPC operation response to obtain the response information of the network interface; The receiving module is further used to receive a handle of the network interface sent by the second electronic device, where the handle includes first information, and the handle is sent to the first electronic device after the second electronic device calls the network interface and updates the handle of the network interface to the first information, where the first information is used to indicate that the network interface is called through an RPC operation request; The device further comprises: a storage module, configured to store the handle into a first storage space, the handle being monitored by a multiplexed monitoring function; The sending module is also used to respond to the networking instruction and send the RPC operation request to the second electronic device when the multiplexing monitoring function monitors that the first storage space has a handle including the first information, and the RPC operation request also includes the handle.

7. The device according to claim 6, characterized in that The device also includes: A calling module is used to respond to the networking instruction and, if the multiplexing monitoring function fails to detect the existence of a handle including the first information in the first storage space, call the network interface calling function to obtain response information of the network interface called by the network interface calling function.

8. The device according to claim 6, characterized in that The remote connection conditions include: The first electronic device is connected to the second electronic device; or, The first electronic device is connected to the second electronic device, and the power consumption of the first electronic device is greater than a set power consumption threshold; or, The first electronic device is connected to the second electronic device, and the power level of the first electronic device is lower than a set power threshold.

9. A network connection device, characterized in that: Applied to a second electronic device, the device comprises: A receiving module, configured to receive a remote procedure call (RPC) operation request including a network interface function call number sent by a first electronic device; A calling module, used for calling the network interface calling function indicated by the network interface function calling number; A generating module, used for generating an RPC operation response according to the response information of the network interface called by the network interface calling function; A sending module, configured to send the RPC operation response to the first electronic device; The handle of the network interface is the second information, and the device further includes: An updating module, used for updating the handle of the network interface from the second information to the first information, wherein the first information is used for indicating that the network interface is called through an RPC operation request; The sending module is further used to send the handle to the first electronic device.

10. The device according to claim 9, characterized in that The calling module is further used to: when the multiplexing monitoring function is used to monitor that the handle of the network interface including the second information exists in the second storage space, call the network interface calling function indicated by the network interface function calling number; The receiving module is further configured to receive the RPC operation request sent by the first electronic device, wherein the RPC operation request further includes: a handle of the network interface including the first information; The updating module is further used to update the received handle from the first information to the second information, and update and store the updated handle in the second storage space, and the handle is monitored by the multiplexing monitoring function.

Citation Information

Patent Citations

  • Intelligent watch energy saving method and system

    CN105704647A

  • Method, device and electronic device for remotely controlling android device

    CN109062714A

  • Virtual network interface connectivity

    CN109309660A