CN114449686A - Wireless network access method and device - Google Patents

Wireless network access method and device Download PDF

Info

Publication number
CN114449686A
CN114449686A CN202011212754.5A CN202011212754A CN114449686A CN 114449686 A CN114449686 A CN 114449686A CN 202011212754 A CN202011212754 A CN 202011212754A CN 114449686 A CN114449686 A CN 114449686A
Authority
CN
China
Prior art keywords
wireless network
network
terminal equipment
wireless networks
wireless
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011212754.5A
Other languages
Chinese (zh)
Inventor
石磊
冯杨森
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202011212754.5A priority Critical patent/CN114449686A/en
Publication of CN114449686A publication Critical patent/CN114449686A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/15Setup of multiple wireless link connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/20Manipulation of established connections
    • H04W76/25Maintenance of established connections
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/30Connection release
    • H04W76/34Selective release of ongoing connections

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

The application relates to a wireless network access method and a wireless network access device, wherein the method comprises the following steps: acquiring the running state of terminal equipment, wherein the terminal equipment is simultaneously connected with a plurality of wireless networks; acquiring NAT (network Address translation) timeout durations respectively corresponding to the wireless networks, wherein the NAT timeout durations comprise the longest duration for keeping connection of network links established by the wireless networks under the condition that communication does not occur; when the operating state of the terminal equipment and the NAT timeout duration respectively corresponding to the plurality of wireless networks are determined to meet the preset conditions, disconnecting at least one of the plurality of wireless networks, wherein the operating state of the terminal equipment and the NAT timeout duration respectively corresponding to the plurality of wireless networks meet the preset conditions and comprise the following steps: the terminal equipment operates in a background, the NAT timeout duration corresponding to a first wireless network in the wireless networks is longer than the NAT timeout duration corresponding to a second wireless network, and at least one wireless network is the second wireless network.

Description

Wireless network access method and device
Technical Field
The present application relates to the field of wireless communications, and in particular, to a wireless network access method and apparatus.
Background
Currently, most intelligent terminal devices have a wireless network communication function, and a user can select a plurality of wireless network access modes, typically, for example, WI-FI hotspot access, a 4G network, a 5G network, and the like. Different wireless network access modes naturally have different advantages, but opening multiple wireless network access modes simultaneously can cause the increase of equipment power consumption, especially to some small-size smart machines.
In the related art, the wireless network access modes are usually manually turned on or turned off by a user, and in many cases, switching is not performed after a plurality of wireless access modes are simultaneously turned on. In this case, the simultaneous turning on of multiple wireless network access modes causes an increase in power consumption of the device.
Disclosure of Invention
In view of this, a wireless network access method and apparatus are provided.
In a first aspect, an embodiment of the present application provides a wireless network access method, including:
acquiring the running state of terminal equipment, wherein the terminal equipment is simultaneously connected with a plurality of wireless networks;
acquiring NAT (network Address translation) timeout durations respectively corresponding to the wireless networks, wherein the NAT timeout durations comprise the longest duration for keeping connection of network links established by the wireless networks under the condition that communication does not occur;
when the operating state of the terminal equipment and the NAT timeout duration respectively corresponding to the plurality of wireless networks are determined to meet preset conditions, disconnecting at least one of the plurality of wireless networks, wherein the operating state of the terminal equipment and the NAT timeout duration respectively corresponding to the plurality of wireless networks meet the preset conditions and comprise the following steps: the terminal equipment operates in a background, the NAT overtime duration corresponding to a first wireless network in the wireless networks is longer than the NAT overtime duration corresponding to a second wireless network, and at least one wireless network is the second wireless network.
In the embodiment of the application, at least one of the plurality of wireless networks can be disconnected according to the running state of the terminal equipment and NAT timeout duration parameters of the plurality of wireless networks accessed in the terminal equipment. The time-out duration parameter of the wireless network is in positive correlation with the time interval of the heartbeat packets sent by the terminal equipment, and the longer the time-out duration is, the longer the terminal equipment can maintain the long connection with the server by using fewer heartbeat packets in the same time, and the electricity consumption of the terminal equipment can be saved by sending fewer heartbeat packets. On the other hand, the embodiment of the application also judges whether to disconnect the wireless network according to the running state of the terminal equipment, and only under the running state of the terminal equipment meeting the preset condition, part of the wireless network can be disconnected. Therefore, the wireless network access mode provided by the embodiment of the application can optimize the power consumption of the terminal equipment.
According to a first possible implementation manner of the first aspect, the operating state includes at least one of: the traffic usage information applied in the terminal device, the working mode of the terminal device, the electric quantity information of the terminal device, and the network information of the plurality of wireless networks.
In the embodiment, the operation states related to the electric quantity optimization of the terminal and the disconnection of the wireless network are obtained, and whether the wireless network needs to be disconnected or not can be more accurately decided.
According to a second possible implementation manner of the first aspect, the operating state of the terminal device meets a preset condition, and the method further includes at least one of the following steps:
determining that an application with a flow larger than a preset flow threshold value runs in the terminal equipment according to the flow use information of the application in the terminal equipment;
determining that the terminal equipment operates in a low-power working mode according to the working mode of the terminal equipment;
determining that the electric quantity of the terminal equipment is smaller than a preset electric quantity threshold value according to the electric quantity information of the terminal equipment;
the electric quantity consumption speed of the terminal equipment is greater than a preset power consumption speed threshold, or the electric quantity consumption speed of the terminal equipment is greater than a charging speed;
and determining that the signal intensity of the wireless networks is greater than a preset intensity threshold value according to the network information of the wireless networks, or determining that the signal stability of the wireless networks is greater than a preset stability threshold value according to the network information of the wireless networks.
In this embodiment, if a wireless network used by a large-traffic application is disconnected under the condition that the large-traffic application is running in the terminal, the application may be switched to another wireless network with traffic limitation, which causes economic loss to the user.
In this embodiment, when the terminal operates in the low power operating mode, it may be stated that the terminal needs to perform power optimization to reduce the power consumption speed of the terminal.
In this embodiment, the optimization of the power consumption is started based on the requirement of power consumption optimization, that is, under the scene that the power consumption of the terminal is small or the power consumption speed is high.
According to a third possible implementation manner of the first aspect, the NAT timeout durations respectively corresponding to the plurality of wireless networks meet a preset condition, and the method further includes:
and the difference between the NAT timeout duration corresponding to the first wireless network and the NAT timeout duration corresponding to the second wireless network is greater than a preset duration threshold.
In this embodiment, when the difference between the NAT timeout durations of the wireless networks is large, it indicates that the power consumption of a part of the wireless networks is higher than that of another part of the wireless networks when sending the heartbeat packet, and at this time, power consumption optimization of the terminal needs to be performed.
According to a fourth possible implementation manner of the first aspect, the disconnecting at least one of the plurality of wireless networks includes:
the terminal equipment runs an application with the flow rate larger than a preset flow rate threshold value;
and under the condition that the application utilizes the second wireless network for network communication, the second wireless network is disconnected after the application finishes the service or suspends the service.
In this embodiment, when it is determined that there is a large flow application performing a large flow service using a second wireless network to be disconnected, the second wireless network may be disconnected after the application completes or suspends the large flow service, so as to prevent the application from being switched to a wireless network with a limited flow, which results in economic loss for a user.
According to a fifth possible implementation manner of the first aspect, the disconnecting at least one of the plurality of wireless networks includes:
the terminal equipment runs an application with the flow rate larger than a preset flow rate threshold value;
and under the condition that the application utilizes the first wireless network to carry out network communication, the first wireless network does not limit the flow, and the second wireless network is disconnected.
In this embodiment, under the condition that it is determined that the switched wireless network does not limit the flow, the operation of the large-flow application is not affected, and the optimization of the power consumption does not need to be delayed.
According to a sixth possible implementation manner of the first aspect, the disconnecting at least one of the plurality of wireless networks includes:
the terminal sends a notification message in a popup window form, wherein the notification message comprises a message for advising a user to disconnect the second wireless network;
receiving a user input, disconnecting the second wireless network.
In this embodiment, when the terminal operates in the foreground, the notification message may be presented to the user in a pop-up window form, and a control for closing the target wireless network is provided.
According to a seventh possible implementation manner of the first aspect, the disconnecting at least one of the plurality of wireless networks includes:
and disconnecting the second wireless network, and keeping the state when the network identifier corresponding to the second wireless network is not disconnected.
In the embodiment, the state of the network identifier of the wireless network when the network identifier of the wireless network is kept on can be kept after the wireless network is disconnected, so that a user does not sense the disconnected wireless network.
In a second aspect, an embodiment of the present application provides a wireless network access apparatus, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the wireless network access method of the first aspect or one or more of the many possible implementations of the first aspect when executing the instructions.
In a third aspect, an embodiment of the present application is a non-transitory computer-readable storage medium having stored thereon computer program instructions, which, when executed by a processor, implement the wireless network access method of the first aspect or one or more of the many possible implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer program product, which includes computer readable code or a non-transitory computer readable storage medium carrying computer readable code, and when the computer readable code runs in an electronic device, a processor in the electronic device executes the wireless network access method of the first aspect or one or more of the many possible implementations of the first aspect.
These and other aspects of the present application will be more readily apparent from the following description of the embodiment(s).
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the application and, together with the description, serve to explain the principles of the application.
Fig. 1 shows a flowchart of a method for accessing a terminal device through a wireless network according to an embodiment of the present application.
Fig. 2 is a schematic structural diagram illustrating a terminal device accessing the internet through a wireless network according to an embodiment of the present application.
Fig. 3 is a flowchart illustrating a method for obtaining a NAT timeout duration according to an embodiment of the present application.
Fig. 4 shows a flowchart of a method for disconnecting a wireless network according to an embodiment of the present application.
FIG. 5 illustrates a user interface diagram provided in accordance with an embodiment of the present application.
FIG. 6 illustrates a user interface diagram provided in accordance with an embodiment of the present application.
Fig. 7 shows a schematic structural diagram of a terminal device according to an embodiment of the present application.
Fig. 8 shows a block diagram of a software structure of a terminal device according to an embodiment of the present application.
Detailed Description
Various exemplary embodiments, features and aspects of the present application will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
In the embodiments of the present application, "at least one" means one or more, and a plurality means two or more. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. It should be understood that in this application, "/" means "or" means "unless otherwise indicated. For example, A/B may represent A or B. In the present application, "and/or" is only one kind of association relation describing an associated object, and means that three kinds of relations may exist.
It should be noted that in the embodiments of the present application, the terms "first", "second", and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or order. The features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or illustrations. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present application. It will be understood by those skilled in the art that the present application may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present application.
In order to facilitate those skilled in the art to understand the technical solutions provided in the embodiments of the present application, a technical environment for implementing the technical solutions is first described below.
The terminal equipment needs to have a public network IP address when accessing the Internet, and the public network IP address has uniqueness in the global Internet. Because the number of public Network IP addresses is limited, and the public Network IP addresses are in a serious shortage state at present, a Network operator can provide an intranet IP for a user, and a plurality of terminal devices in the intranet can share one public Network IP through a Network Address Translation (NAT) protocol. Therefore, the main function of the NAT protocol is to map the intranet IP address of the terminal device to the extranet IP address, so that the terminal device can access the internet. However, the number of terminal devices served by the same network operator is huge, and in order to reduce the link load of the gateway and save the channel resources, the network operator makes the following settings: if the communication network link of the terminal equipment does not communicate for a period of time, the network link communication of the terminal equipment is disconnected, and meanwhile, the mapping relation between the intranet IP address and the extranet IP address is deleted, so that a network operator can provide the intranet IP address for other users to use.
However, many terminal device applications need to maintain a long-time connection with the backend server to acquire the messages pushed by the backend server. For example, even if the mobile phone is in the off-screen state, the user still needs to receive messages of an application such as WeChat. Based on the method, the long TCP connection can be established between the terminal equipment and the server, and the effectiveness of the long TCP connection is maintained by utilizing a heartbeat mechanism. In the heartbeat mechanism, the terminal device may send a custom message, which may also be referred to as a heartbeat packet, to the server at intervals. After receiving the heartbeat packet, the server may also return a customized message to the terminal device, which may also be referred to as a heartbeat response. As described above, the network operator sets that if the communication network link of the terminal device does not communicate for a period of time, the network operator disconnects the network link communication of the terminal device, and the period of time may become the NAT timeout duration. Based on this, the interval of sending the heartbeat packet to the server by the terminal device can be set to be slightly less than the NAT timeout duration, and has positive correlation with the NAT timeout duration.
In order to maintain connection with the background server, the application in the terminal device needs to send a heartbeat packet to the background server for a long time and receive a reply sent by the background server. The communication between the application and the background server may use various wireless networks, and the use of various wireless networks requires different communication modules in the terminal device to operate simultaneously, which results in more power consumption.
The following describes an application scenario environment according to an embodiment of the present application with reference to an actual application scenario.
In the process of using an intelligent terminal device (such as a smart phone and an intelligent wearable device), in order to ensure that the terminal device is continuously networked, a user often simultaneously starts multiple Wireless network access modes, such as a cellular network and a Wireless Fidelity (Wi-Fi) network. Based on the above description of the technical environment, even if the terminal device is in the screen-off state, the terminal device needs to continuously send heartbeat packets to the server to maintain a long connection with the server. However, the sending of the heartbeat packet and the receiving of the reply message from the server consume power, and therefore, the user finds that the power consumption of the intelligent terminal device is large even when the intelligent terminal device is not used. To the less intelligent wearing equipment of some electric storage quantities, like intelligent bracelet, intelligent wrist-watch, intelligent glasses etc. the electric quantity consumption of this part can not be ignored.
Based on the actual technical requirements similar to those described above, the wireless network access method provided by the application can respectively obtain the NAT timeout durations corresponding to the multiple wireless network access methods, and disconnect a part of wireless networks according to the NAT timeout durations. In this way, the terminal device can maintain a long connection with the server by sending fewer heartbeat packets, which can consume less power.
The technical scheme that this application embodiment provided can be applied to the terminal equipment that can insert multiple wireless network, terminal equipment can include smart phone, computer (including notebook computer, desktop computer), dull and stereotyped electronic equipment (like panel computer, electronic reader), Personal Digital Assistant (PDA), wearable electronic equipment (like intelligent bracelet, intelligent wrist-watch, intelligent glasses), intelligent household electrical appliances (sweep floor robot, TV, virtual reality equipment, air conditioner, refrigerator, lamps and lanterns, projecting apparatus, audio amplifier etc.). The Wireless Network includes a Wireless Local Area Network (WLAN), a Wireless Wide Area Network (WWAN), a Wireless Metropolitan Area Network (WMAN), and a Wireless Personal Area Network (WPAN). The WLAN may include, among other things, a network that provides wireless communication access over short distances, such as a Wi-Fi network. The WWAN may include a wireless communication network, such as a 2G/3G/4G/5G wireless network, provided over a mobile communication infrastructure. WMANs allow access users to access a fixed-site wireless network that connects multiple fixed sites in a city or region. The WPAN is a wireless network in which a portable device owned by a user person is wirelessly connected in a short distance via a communication device. The application does not limit the types of the terminal equipment and the wireless network.
An embodiment of the present application provides a wireless network access method, and specifically, as shown in fig. 1, the wireless network access method may include:
s101: the method comprises the steps of obtaining the running state of terminal equipment, wherein the terminal equipment is connected with a plurality of wireless networks simultaneously.
The method of the embodiment of the application can be applied to terminal equipment which is simultaneously accessed to a plurality of wireless networks, wherein the plurality of wireless networks can comprise two or more wireless networks. Fig. 2 shows a schematic diagram of terminal device 101 communicating with server 104, server 105, and server 106 using wireless network 102 and wireless network 103.
In the embodiment of the application, the running state of the application in the terminal equipment has an association relation with whether at least one wireless network needs to be disconnected. The operating state may include at least one of: whether the terminal equipment runs in a foreground or a background, flow use information applied in the terminal equipment, the working mode of the terminal equipment, the electric quantity information of the terminal equipment and the network information of the plurality of wireless networks.
In an embodiment of the application, the state information of whether the terminal device operates in the foreground or the background can be acquired. For the terminal device with the display screen, the terminal device running in the background may include that the terminal device is in a screen-off state, and running in the foreground may include that the terminal device is in a screen-on state. The screen-off of the display screen of the terminal device may refer to a scene in which the display card in the terminal device does not draw the user interface. Of course, in the screen-off scene, the terminal device or the application in the terminal device may run in the background, such as playing music and monitoring sleep. Of course, in other embodiments, the terminal device running in the background may further include an application that is not running in the terminal device, and the like, which is not limited herein.
The traffic usage information of the application in the terminal device may include a speed at which the application consumes traffic and a connected wireless network. In some examples, a video application in the terminal device is downloading video by using a Wi-Fi network at a downloading speed of 2M/s, and a photo application in the terminal device synchronizes photos, videos and other data by using the Wi-Fi network at an uploading speed of 810 k/s. It should be noted that, the traffic of each application in the terminal device may be determined by a traffic statistic component in the terminal device, so as to determine the application in the terminal device whose traffic is greater than the preset traffic threshold. For example, in an Android operating system, traffic statistics can be performed on the terminal device and each application in the terminal device through TrafficStats.
The operation mode of the terminal device may include one of a plurality of operation modes preset by the terminal device, for example, the operation mode may include an airplane mode, a low battery mode, a normal mode, and the like. Under a preset working mode, the terminal equipment can operate according to preset operation parameters. Of course, the preset operation mode is different for different terminal devices, and is not limited herein.
The power information of the terminal device may include at least one of a power value of the terminal device, a power consumption rate, whether charging is in progress, a charging rate, a battery capacity of the terminal device, and the like. The power information may be obtained from a battery management module in the terminal device.
The network information of the plurality of wireless networks may include signal information, function information, and the like of the plurality of wireless networks. The signal information may further include signal strength, signal stability, and the like. The signal stability may also include parameters such as signal noise, retry rate, and line break rate. The capability information may include whether the wireless network is associated with a necessary function in the terminal device, etc.
It should be noted that the operation status is not limited to the above example, and any status information related to power consumption optimization of the terminal device and disconnection of the wireless network belongs to the protection scope of the present application, and other modifications are possible for those skilled in the art in light of the technical spirit of the present application, but should be covered by the protection scope of the present application as long as the functions and effects achieved by the present application are the same as or similar to those of the present application.
S103: and acquiring NAT (network Address translation) timeout durations respectively corresponding to the wireless networks, wherein the NAT timeout durations comprise the longest duration for keeping connection of network links established by the wireless networks under the condition that communication does not occur.
In this embodiment of the application, the NAT timeout duration may include the longest duration for the network link established by the wireless network to maintain connection without communication, that is, the wireless network is disconnected when the duration for the network link established by the wireless network to not communicate is greater than the NAT timeout duration. The network link not communicating in this embodiment may include the network link not transmitting data.
In an embodiment of the present application, the NAT timeout duration may be obtained by sending a heartbeat packet to a server. Fig. 3 shows a flowchart of a method for obtaining NAT timeout duration for a wireless network. After determining which wireless network to use to establish a network link with the server, an initial value of the NAT timeout period may be obtained, and the initial value may be set to 30s, 35s, 40s, and so on. Then, the terminal device may send a heartbeat packet to the server through the network link, and start a timer, where the timing duration is the initial value. In the case that the timer expires, it may be determined whether the network link is disconnected. Under the condition that the network link is disconnected, the set initial value is too high, so that the wireless network can be used again to send the heartbeat packet to the server, the timer is started, the timing duration is reduced by 10s on the basis of the initial value, and of course, 10s is only used as a reference value, and is not limited herein. Otherwise, under the condition that the network link is kept connected, the set initial value is too low, so that the heartbeat packet can be sent to the server by using the wireless network again, the timer is started, and the timing duration is increased by 10s on the basis of the initial value. Thus, the above process may be repeatedly executed until the network link keeps connected for many times in the same timing duration, and the timing duration may be used as the NAT timeout duration. The method for determining the NAT timeout duration provided by the embodiment can be applied to wireless signals with large differences among different areas or unstable signals.
Of course, in other embodiments, the NAT timeout duration may also be obtained from a wireless network operator, for example, the NAT timeout duration obtained for a certain operator is 4 min. In addition, the NAT timeout duration of the history record can be obtained according to a user log in the terminal device, and the NAT timeout duration obtaining method is not limited.
S105: when the operating state of the terminal equipment and the NAT timeout duration respectively corresponding to the plurality of wireless networks meet the preset conditions, disconnecting at least one wireless network in the plurality of wireless networks, wherein the operating state of the terminal equipment and the NAT timeout duration respectively corresponding to the plurality of wireless networks meet the preset conditions and comprise the following steps: the terminal equipment operates in a background, the NAT timeout duration corresponding to a first wireless network in the wireless networks is longer than the NAT timeout duration corresponding to a second wireless network, and at least one wireless network is the second wireless network.
In an embodiment of the application, the determining that the operating state of the terminal device and the NAT timeout durations respectively corresponding to the plurality of wireless networks meet a preset condition includes: and judging whether the running state of the terminal equipment and NAT timeout duration respectively corresponding to the plurality of wireless networks meet preset conditions or not.
In this embodiment, the preset condition may include a condition for turning off at least one of the plurality of wireless networks. According to the description of the technical environment, the time interval of sending the heartbeat packet by the terminal equipment has positive correlation with the NAT timeout duration, and the longer the NAT timeout duration is, the longer the time interval of sending the heartbeat packet is. In one example, the obtained NAT timeout duration corresponding to the Wi-Fi network is 20s, and the NAT timeout duration corresponding to the 4G cellular mobile network is 35 s. Therefore, the time interval for sending the heartbeat packets by using the Wi-Fi network is smaller than the time interval for sending the heartbeat packets by using the 4G cellular mobile network. That is, the terminal device can send fewer heartbeat packets to maintain a long connection with the server using the 4G cellular mobile network during the same time. Based on this, in an embodiment of the present application, for the NAT timeout duration, the determining whether the NAT timeout durations respectively corresponding to the plurality of wireless networks meet a preset condition includes:
and judging whether the difference between the NAT timeout durations respectively corresponding to the wireless networks is greater than a preset duration threshold value or not.
In the embodiment of the application, at least one of the wireless networks is disconnected under the condition that the difference between the NAT timeout durations of the wireless networks is greater than the preset duration threshold. For example, in the above example, the NAT timeout durations corresponding to the Wi-Fi network and the 4G cellular mobile network are 20s and 35s, respectively, and the difference between the two is large, and the Wi-Fi network with the shorter timeout duration needs to be disconnected. On the contrary, if the NAT timeout durations of the two wireless networks are both 25s, the power consumption generated by the terminal device is the same no matter which wireless network is used for communication. In the embodiment of the present application, the preset duration threshold may be set to 3s, 4s, 5s, and the like.
The preset conditions corresponding to the different operation states provided in S101 are described below.
In an embodiment of the application, for the case that the operation state includes whether the terminal device operates in the background, the determining whether the operation state of the terminal device meets a preset condition may include:
and judging whether the terminal equipment runs in the background or not.
In this embodiment, in order to make the operation of disconnecting the wireless network imperceptible to the user, the network may be disconnected when the terminal device operates in the background. In one example, at least one wireless network may be disconnected in a terminal device off-screen state.
In an embodiment of the present application, for the case that the operation state includes traffic usage information applied in a terminal device, determining whether the operation state of the terminal device meets a preset condition includes:
and judging whether the terminal equipment runs the application with the flow larger than a preset flow threshold value or not according to the flow use information of the application in the terminal equipment.
In an actual scene, charging modes of different wireless networks are different, generally, a Wi-Fi network does not limit traffic, a 4G/5G cellular mobile network often needs to limit traffic, and certainly, according to a traffic package type selected by a user, some package types need to limit traffic, and some do not need to limit traffic. And determining whether the terminal equipment has an application with the flow larger than a preset flow threshold value according to the flow information applied in the terminal equipment. For example, before the Wi-Fi network is disconnected, the flow rate of some applications in the terminal equipment using the Wi-Fi network is determined to be greater than a preset flow rate threshold value, and the preset flow rate threshold value can be set to be 200k/s, 300k/s, 500k/s and the like. In some examples, there are some video applications in the terminal device to download video, photo applications to synchronize data such as photos or video, etc., and these applications need to consume large amount of traffic. In the case where there is an application of the above type that relies on wireless network communications to be disconnected, if the wireless network is suddenly disconnected, there is a high possibility that switching to another wireless network with traffic limitation will cause economic loss to the user.
In an embodiment of the application, for the case that the running state includes traffic usage information applied in a terminal device, the determining whether the running state of the terminal device meets a preset condition includes:
judging whether an application with the flow larger than a preset flow threshold value runs in the terminal equipment or not according to the flow use information of the application in the terminal equipment;
and under the condition that the application with the flow rate larger than the preset flow rate threshold value runs in the terminal equipment, judging whether the wireless network used by the application limits the flow rate.
In the embodiment of the application, under the condition that the large-flow application is determined to run in the terminal device, whether the switched wireless network limits the flow can be determined. The wireless network may be turned off upon determining that the switched wireless network does not need to restrict traffic. For example, the Wi-Fi network is disconnected according to the NAT timeout duration, but a lot of large-flow applications in the terminal equipment are monitored to run, and according to the setting of the terminal equipment, the terminal equipment is automatically switched to the 4G cellular mobile network under the condition that the Wi-Fi network is disconnected. Therefore, whether the 4G cellular mobile network needs to limit the flow can be determined, the Wi-Fi network can be immediately disconnected under the condition that the 4G cellular mobile network does not limit the flow, the Wi-Fi network does not need to be disconnected after the high-flow application is finished, and therefore the running of the high-flow application is not influenced, and the optimization of the power consumption does not need to be delayed. In the embodiment of the application, the terminal device may acquire information of the cellular mobile network of the user from a cellular mobile network operator, for example, acquire that the user purchases an unlimited flow package, so that closing the wireless network with a short NAT timeout duration causes the terminal device to be switched to another wireless network, and thus, economic loss of the user is not caused.
In an embodiment of the present application, for the case that the operation state includes traffic usage information applied in a terminal device, determining whether the operation state of the terminal device meets a preset condition includes:
and judging whether the terminal equipment operates in a low-power working mode or not according to the working mode of the terminal equipment.
In the embodiment of the application, under the condition that the terminal device operates in the low-power operating mode, it can be stated that the terminal device needs to perform power optimization to reduce the power consumption speed of the terminal device.
In an embodiment of the present application, for the fact that the operation state includes traffic usage information applied in a terminal device, the determining whether the operation state of the terminal device meets a preset condition includes:
the judging whether the running state of the terminal equipment meets a preset condition or not comprises the following steps:
judging whether the electric quantity of the terminal equipment is smaller than a preset electric quantity threshold value or not according to the electric quantity information of the terminal equipment;
or the electric quantity consumption speed of the terminal equipment is greater than a preset electric consumption threshold value;
or the electricity consumption speed of the terminal equipment is greater than the charging speed.
In the embodiment of the application, the optimization of the electric quantity is started from the requirement of electric quantity optimization, namely, under the scene that the electric quantity of the terminal equipment is small or the power consumption speed is high.
In an embodiment of the application, for the case that the operation status includes network information of the plurality of wireless networks, the determining whether the operation status of the terminal device meets a preset condition includes:
and respectively judging whether the wireless networks are associated with the necessary functions of the terminal equipment according to the network information of the wireless networks.
In the embodiment of the application, if the wireless network is disconnected under the condition that the wireless network is associated with the necessary functions in the terminal equipment, the necessary functions cannot be realized in the terminal equipment. The necessary functions may include functions indispensable in the terminal device. For example, for a child watch, in a normal use state, a 4G cellular mobile network is generally associated with a call function, once the 4G cellular mobile network is disconnected, the call function of the child watch is also turned off, and the call function is a basic function of the child watch, and once the call function is turned off, a call cannot be answered. For a children's watch, the connected cellular mobile network is associated with the call functionality of the watch, which, if disconnected, renders the call functionality of the watch unusable.
In an embodiment of the application, for the case that the operation status includes network information of the plurality of wireless networks, the determining whether the operation status of the terminal device meets a preset condition includes:
and respectively judging whether the signal intensity of the wireless networks is greater than a preset intensity threshold value or not or whether the signal stability is greater than a preset stability threshold value or not according to the network information of the wireless networks.
In practical applications, different wireless networks consume different power at different speeds, for example, for a 4G cellular mobile network, communication with a base station requires signal transmission and signal reception, hardware consumes power at a high speed, and especially in an environment with relatively poor signals, a device may expand a search range and enhance a transmission signal, and power consumption may be further increased. The Wi-Fi network transmits and receives signals through the wireless router, and may consume less power in a relatively stable environment. For some intelligent terminal devices with simple functions, software or hardware conditions for counting power consumption of each wireless network may not be provided, for example, for the child watch, such intelligent terminal devices may only acquire some simple network parameters of the wireless network, such as signal strength. Because the signal intensity of the wireless network and the power consumption speed are in a negative correlation relationship, the stronger the signal intensity is, the slower the power consumption speed of the corresponding wireless network is; conversely, the weaker the signal strength, the faster the power consumption speed of the corresponding wireless network. Based on this, the signal strength and/or signal stability of the wireless network that remains connected can be used as a condition for further determining whether a certain wireless network needs to be shut down.
It should be noted that the implementation manner of S105 is not limited to the above embodiments, and may also include any combination of the above embodiments, and the present application is not limited herein. And if the terminal equipment is judged to be operated in the background and the flow use information of the application in the terminal equipment is judged to be operated with the application of which the flow is larger than the preset flow threshold value.
In an embodiment of the present application, the disconnecting at least one of the plurality of wireless networks when it is determined that the operation state of the terminal device and the NAT timeout durations respectively corresponding to the plurality of wireless networks meet a preset condition includes:
and under the condition that the terminal equipment operates in the background and the difference between the NAT timeout durations corresponding to the wireless networks is larger than a preset duration threshold, disconnecting at least one wireless network in the wireless networks.
In the embodiment of the application, under the condition that the terminal equipment runs in the background and the NAT timeout durations corresponding to the wireless networks have larger difference, the wireless networks can be disconnected. Fig. 4 shows an application scenario of the embodiment, in which a terminal device in the scenario is connected to three wireless networks, namely a Wi-Fi network, a 4G cellular mobile network, and a 5G cellular mobile network. After the screen is turned off, the terminal device may acquire the NAT timeout durations of the Wi-Fi network, the 4G cellular mobile network, and the 5G cellular mobile network, respectively, as shown in fig. 4, where the NAT timeout durations of the three wireless networks are 28s, 40s, and 45s, respectively. And according to the NAT timeout duration, the terminal equipment disconnects the Wi-Fi network and the 4G cellular mobile network. In addition, the wireless network disconnected in the screen-off state can be reconnected under the condition that the terminal equipment is monitored to be switched from the screen-off state to the screen-on state, and a user can not sense disconnection of the wireless network. As shown in fig. 4, after the terminal device is turned on, for example, after the alarm clock is turned on, the terminal device is connected to the Wi-Fi network and the 4G cellular mobile network again. It follows that the process is not perceived by the user.
In an embodiment of the present application, the disconnecting at least one of the multiple wireless networks when it is determined that the operating state of the terminal device and the NAT timeout durations respectively corresponding to the multiple wireless networks meet the preset condition includes:
determining at least one target wireless network to be disconnected according to the NAT timeout duration;
and determining that an application with the flow larger than a preset flow threshold value runs in the terminal equipment, and disconnecting the target wireless network after waiting for the application to finish or suspend the high-flow service under the condition that the application utilizes the target wireless network for communication.
In an example of the application, according to two networks of a Wi-Fi network and a 4G cellular mobile network connected to a terminal device, it is determined that the NAT timeout duration of the Wi-Fi network is shorter than that of the 4G cellular mobile network, and the Wi-Fi network can be used as a target wireless network to be disconnected. However, the Wi-Fi network is disconnected after video caching and photo synchronization in the terminal equipment application are determined to be completed based on the fact that the Wi-Fi network is used for carrying out large-flow data transmission by the video application and the photo application in the terminal equipment. In another embodiment, the application with higher traffic consumption can be suspended, and the unfinished work in the application can be continuously completed under the condition that the disconnected wireless network is reconnected.
In an embodiment of the present application, the disconnecting at least one of the plurality of wireless networks when it is determined that the operation state of the terminal device and the NAT timeout durations respectively corresponding to the plurality of wireless networks meet a preset condition includes:
determining at least one first wireless network to be disconnected and at least one reserved second wireless network according to the NAT timeout duration;
and disconnecting the first wireless network when determining that the application with the flow rate larger than a preset flow rate threshold value runs in the terminal equipment, the application utilizes the target wireless network for communication, and the second wireless network does not limit the flow rate.
In an example of the application, according to two networks, namely a Wi-Fi network and a 4G cellular mobile network, connected in a terminal device, it is determined that the NAT timeout duration of the Wi-Fi network is shorter than that of the 4G cellular mobile network, and the Wi-Fi network may be used as a first wireless network to be disconnected, and the 4G cellular mobile network may be used as a second wireless network to be reserved. However, the video application and the photo application in the terminal equipment are found to be used for carrying out large-flow data transmission by utilizing the Wi-Fi network, and whether the 4G cellular mobile network limits the flow can be judged. The Wi-Fi network may be disconnected in case the 4G cellular mobile network does not restrict traffic.
In an embodiment of the present application, the disconnecting at least one of the plurality of wireless networks when it is determined that the operation state of the terminal device and the NAT timeout durations respectively corresponding to the plurality of wireless networks meet a preset condition includes:
and under the condition that the terminal equipment operates in a low-power working mode and the difference between the NAT timeout durations corresponding to the wireless networks is larger than a preset duration threshold, disconnecting at least one of the wireless networks.
In the embodiment of the application, in the low power operating mode, the total power of the terminal device is less than the preset power, power optimization is required, and at least one wireless network can be disconnected. The low power operating mode may be switched by a user, or may be automatically switched by the terminal device after monitoring the total power of the device, which is not limited herein.
In an embodiment of the present application, the disconnecting at least one of the plurality of wireless networks when it is determined that the operation state of the terminal device and the NAT timeout durations respectively corresponding to the plurality of wireless networks meet a preset condition includes:
under the condition that the difference between the NAT timeout durations corresponding to the wireless networks is determined to be larger than a preset duration threshold and at least one of the following conditions, disconnecting at least one of the wireless networks:
the electric quantity of the terminal equipment is smaller than a preset electric quantity threshold value;
the electric quantity consumption speed of the terminal equipment is greater than a preset electric consumption threshold value;
the electric quantity consumption speed of the terminal equipment is greater than the charging speed.
In the embodiment of the application, under the condition that the electric quantity in the terminal equipment is small or the electric quantity consumption speed is high or the electric quantity consumption speed is higher than the charging speed, the fact that the terminal equipment needs to optimize the electric quantity can be determined, and therefore the electric quantity can be saved by disconnecting at least one wireless network.
In an embodiment of the present application, the disconnecting at least one of the plurality of wireless networks when it is determined that the operation state of the terminal device and the NAT timeout durations respectively corresponding to the plurality of wireless networks meet a preset condition includes:
determining at least one target wireless network to be disconnected according to the NAT timeout duration;
disconnecting the target wireless network if it is determined that the target wireless network is not associated with a necessary function of a terminal device.
In the embodiment of the application, the wireless network is disconnected under the condition that the target wireless network is determined to have no necessary functions related to the terminal equipment. Otherwise, the connection of the wireless network may be maintained. For example, based on the comparison of the NAT timeout periods, it is determined to disconnect the 4G cellular mobile network in the child watch, but it is detected that the 4G cellular mobile network is associated with the call function in the child watch, and therefore, the connection of the 4G cellular mobile network may continue to be maintained.
In an embodiment of the present application, the disconnecting at least one of the plurality of wireless networks when it is determined that the operation state of the terminal device and the NAT timeout durations respectively corresponding to the plurality of wireless networks meet a preset condition includes:
determining at least one first wireless network to be disconnected and at least one reserved second wireless network according to the NAT timeout duration;
and disconnecting the first wireless network under the condition that whether the signal strength of the second wireless network is greater than a preset strength threshold value and/or whether the signal stability is greater than a preset stability threshold value is determined.
In an example of the application, according to two networks, namely a Wi-Fi network and a 4G cellular mobile network, connected in a terminal device, it is determined that the NAT timeout duration of the Wi-Fi network is shorter than that of the 4G cellular mobile network, and the Wi-Fi network may be used as a first wireless network to be disconnected, and the 4G cellular mobile network may be used as a second wireless network to be reserved. And if the acquired signal strength of the 4G cellular mobile network is greater than a preset strength threshold value, the Wi-Fi network can be closed. On the contrary, if the acquired signal strength of the 4G cellular mobile network is weaker and is smaller than the preset strength threshold, the Wi-Fi network can be reserved.
Further, in another embodiment, the wireless network may consume less power in the case of greater signal strength and greater stability. Based on the above, the signal stability of the second wireless network can be obtained to judge whether the signal stability is greater than a preset stability threshold. Based on this, the first wireless network is disconnected under the condition that the signal intensity of the second wireless network is determined to be greater than the preset intensity threshold and the signal stability is determined to be greater than the preset stability threshold. The signal stability may be determined according to at least one of network parameters such as signal noise, retry rate, and disconnection rate, which is not limited herein.
In an embodiment of the present application, the disconnecting at least one of the plurality of wireless networks when it is determined that the operation state of the terminal device and the NAT timeout durations respectively corresponding to the plurality of wireless networks meet the preset condition may include:
under the condition that the terminal equipment is determined to operate in the foreground and the difference between the NAT timeout durations corresponding to the wireless networks is larger than a preset duration threshold, sending a notification message, wherein the notification message comprises a target wireless network which is recommended to be disconnected by a user;
and receiving the operation of disconnecting the target wireless network by the user, and disconnecting the target wireless network.
In an actual application scenario, a user uses some terminal devices for a long time, and especially a smart phone keeps the terminal devices running in the foreground for a long time every day. Based on this, in the embodiment of the present application, the power consumption of the terminal device may also be optimized according to the NAT timeout durations of the plurality of wireless networks when the terminal device operates in the foreground. In this case, after determining the wireless network that needs to be disconnected, a notification message including a target wireless network that suggests the user to disconnect may be sent to the user. The user can select to close the target wireless network according to the notification message.
In some examples, the notification message may be presented in a pop-up style. As shown in fig. 5, during the use of the instant messaging application, the terminal device 400 determines that the Wi-Fi network consumes too much power according to the solutions provided in the above embodiments, and suggests the user to turn off the Wi-Fi network. Then, a popup 401 is set in the user interface, and a corresponding notification message is presented in the popup 401. Of course, a control 403 may also be set in the pop-up window 401, and after the user performs a preset operation on the control 403, the user interface may jump to the setting interface of the wireless network shown in fig. 6, and in the setting interface, the user may close the corresponding wireless network. In other embodiments, after the user determines to disconnect the wireless network through the control, the terminal device may close the corresponding wireless network in the background to simplify the user's operation.
In an embodiment of the present application, the disconnecting at least one of the plurality of wireless networks when it is determined that the operation state of the terminal device and the NAT timeout durations respectively corresponding to the plurality of wireless networks meet a preset condition includes:
and under the condition that the terminal equipment is determined to operate in the foreground and the difference between the NAT timeout durations corresponding to the wireless networks is greater than a preset duration threshold, disconnecting at least one wireless network in the wireless networks and keeping the network identifier of the at least one wireless network in the opened state.
In an actual application scenario, a user senses whether a wireless network in the terminal device is started or not as a state of a network identifier of the wireless network, and the wireless network has two different states such as whether an icon exists in a menu bar, whether the icon is in different colors, whether the icon is lighted or not, and the like when the wireless network is started and disconnected. In an embodiment of the present application, in order to make a user unaware of the disconnection of the wireless network, the network identifier state of the wireless network may be set to be the network identifier state when the network identifier state of the wireless network is turned on after the wireless network is disconnected.
The disconnecting of at least one of the plurality of wireless networks according to the embodiments of the present application may include disconnecting a wireless network with a shorter NAT timeout period, or only leaving a wireless network with a longest NAT timeout period, disconnecting all remaining wireless networks, or leaving a wireless network with a longest NAT timeout period, and disconnecting at least one remaining wireless network may include a disconnection manner determined by any NAT timeout period, which is not limited herein.
The embodiment based on S105 is not limited to the above-described example, and the embodiment based on S107 is not limited to the above-described example. In an example, the disconnecting at least one of the plurality of wireless networks when it is determined that the operation state of the terminal device and the NAT timeout durations respectively corresponding to the plurality of wireless networks meet a preset condition may further include:
under the condition that the terminal equipment is determined to operate in the background, determining at least one target wireless network to be disconnected according to the NAT timeout duration;
and determining that an application with the flow larger than a preset flow threshold value runs in the terminal equipment, and disconnecting the target wireless network after waiting for the application to finish or suspend the high-flow service under the condition that the application utilizes the target wireless network for communication.
Fig. 7 shows a schematic structural diagram of a terminal device according to an embodiment of the present application. Taking the terminal device as a mobile phone as an example, fig. 7 shows a schematic structural diagram of the mobile phone 200.
The mobile phone 200 may include a processor 210, an external memory interface 220, an internal memory 221, a USB interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 251, a wireless communication module 252, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, keys 290, a motor 291, an indicator 292, a camera 293, a display 294, a SIM card interface 295, and the like. The sensor module 280 may include a gyroscope sensor 280A, an acceleration sensor 280B, a proximity light sensor 280G, a fingerprint sensor 280H, and a touch sensor 280K (of course, the mobile phone 200 may also include other sensors, such as a temperature sensor, a pressure sensor, a distance sensor, a magnetic sensor, an ambient light sensor, an air pressure sensor, a bone conduction sensor, and the like, which are not shown in the figure).
It is to be understood that the illustrated structure of the embodiment of the present application does not specifically limit the mobile phone 200. In other embodiments of the present application, handset 200 may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 210 may include one or more processing units, such as: the processor 210 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a Neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors. Wherein the controller can be the neural center and the command center of the cell phone 200. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may hold instructions or data that have just been used or recycled by processor 210. If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 210, thereby increasing the efficiency of the system.
The processor 210 may execute the wireless network access method provided in the embodiment of the present application, so as to optimize power consumption of the wireless network. The processor 210 may include different devices, for example, when the CPU and the GPU are integrated, the CPU and the GPU may cooperate to execute the wireless network access method provided in the embodiment of the present application, for example, part of algorithms in the wireless network access method are executed by the CPU, and another part of algorithms are executed by the GPU, so as to obtain faster processing efficiency.
The display screen 294 is used to display images, video, and the like. The display screen 294 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like. In some embodiments, the cell phone 200 may include 1 or N display screens 294, N being a positive integer greater than 1. The display screen 294 may be used to display information input by or provided to the user as well as various Graphical User Interfaces (GUIs). For example, the display 294 may display a photograph, video, web page, or file, among others. As another example, the display 294 may display a graphical user interface. The graphical user interface comprises a status bar, a hidden navigation bar, a time and weather widget (widget) and an application icon, such as a browser icon. The status bar includes the name of the operator (e.g., china mobile), the mobile network (e.g., 4G), the time and the remaining power. The navigation bar includes a back key icon, a home key icon, and a forward key icon. Further, it is understood that in some embodiments, a Bluetooth icon, a Wi-Fi icon, an add-on icon, etc. may also be included in the status bar. It will also be appreciated that in other embodiments, a Dock bar may also be included in the graphical user interface, and that a commonly used application icon may be included in the Dock bar, etc. When the processor 210 detects a touch event of a finger (or a stylus, etc.) of a user with respect to an application icon, in response to the touch event, a user interface of an application corresponding to the application icon is opened and displayed on the display 294.
In the embodiment of the present application, the display screen 294 may be an integrated flexible display screen, or a spliced display screen formed by two rigid screens and a flexible screen located between the two rigid screens may be adopted.
After the processor 210 runs the wireless network access method provided by the embodiment of the present application, the terminal device may establish a connection with another terminal device through the antenna 1, the antenna 2, or the USB interface, and transmit data according to the wireless network access method provided by the embodiment of the present application and control the display screen 294 to display a corresponding graphical user interface.
The cameras 293 (front camera or rear camera, or one camera may be used as both front camera and rear camera) are used for capturing still images or video. In general, the camera 293 may include a photosensitive element such as a lens group including a plurality of lenses (convex or concave lenses) for collecting an optical signal reflected by an object to be photographed and transferring the collected optical signal to an image sensor, and an image sensor. And the image sensor generates an original image of the object to be shot according to the optical signal.
Internal memory 221 may be used to store computer-executable program code, including instructions. The processor 210 executes various functional applications and data processing of the cellular phone 200 by executing instructions stored in the internal memory 221. The internal memory 221 may include a program storage area and a data storage area. Wherein the storage program area may store an operating system, codes of application programs (such as a camera application, a WeChat application, etc.), and the like. The data storage area can store data (such as images, videos and the like acquired by a camera application) and the like created in the use process of the mobile phone 200.
The internal memory 221 may also store one or more computer programs 1310 corresponding to the wireless network access method provided by the embodiment of the present application. The one or more computer programs 1304 are stored in the memory 221 and configured to be executed by the one or more processors 210, and the one or more computer programs 1310 include instructions that can be used to perform the steps as in S105, respectively.
In addition, the internal memory 221 may include a high speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a Universal Flash Storage (UFS), and the like.
Of course, the codes of the wireless network access method provided by the embodiment of the present application may also be stored in the external memory. In this case, the processor 210 may execute the code of the wireless network access method stored in the external memory through the external memory interface 220.
The function of the sensor module 280 is described below.
The gyro sensor 280A may be used to determine the motion attitude of the cellular phone 200. In some embodiments, the angular velocity of the cell phone 200 about three axes (i.e., x, y, and z axes) may be determined by the gyro sensor 280A. I.e., the gyro sensor 280A may be used to detect the current state of motion of the handset 200, such as shaking or standing still.
When the display screen in the embodiment of the present application is a foldable screen, the gyro sensor 280A may be used to detect a folding or unfolding operation acting on the display screen 294. The gyro sensor 280A may report the detected folding operation or unfolding operation as an event to the processor 210 to determine the folded state or unfolded state of the display screen 294.
The acceleration sensor 280B can detect the magnitude of acceleration of the cellular phone 200 in various directions (typically three axes). I.e., the gyro sensor 280A may be used to detect the current state of motion of the handset 200, such as shaking or standing still. When the display screen in the embodiment of the present application is a foldable screen, the acceleration sensor 280B may be used to detect a folding or unfolding operation acting on the display screen 294. The acceleration sensor 280B may report the detected folding operation or unfolding operation as an event to the processor 210 to determine the folded state or unfolded state of the display screen 294.
The proximity light sensor 280G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The mobile phone emits infrared light outwards through the light emitting diode. The handset uses a 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 handset. When insufficient reflected light is detected, the handset can determine that there are no objects near the handset. When the display screen in the embodiment of the present application is a foldable display screen, the proximity optical sensor 280G may be disposed on a first screen of the foldable display screen 294, and the proximity optical sensor 280G may detect a folding angle or an unfolding angle of the first screen and the second screen according to an optical path difference of the infrared signal.
The gyro sensor 280A (or the acceleration sensor 280B) may transmit the detected motion state information (such as an angular velocity) to the processor 210. The processor 210 determines whether the mobile phone 200 is currently in the hand-held state or the tripod state (for example, when the angular velocity is not 0, it indicates that the mobile phone 200 is in the hand-held state) based on the motion state information.
The fingerprint sensor 280H is used to collect a fingerprint. The mobile phone 200 can utilize the collected fingerprint characteristics to realize fingerprint unlocking, access to an application lock, fingerprint photographing, fingerprint incoming call answering and the like.
The touch sensor 280K is also referred to as a "touch panel". The touch sensor 280K may be disposed on the display screen 294, and the touch sensor 280K and the display screen 294 form a touch screen, which is also called a "touch screen". The touch sensor 280K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display screen 294. In other embodiments, the touch sensor 280K can be disposed on the surface of the mobile phone 200 at a different location than the display 294.
Illustratively, the display 294 of the cell phone 200 displays a home interface that includes icons for a plurality of applications (e.g., a camera application, a WeChat application, etc.). The user clicks an icon of the camera application in the main interface through the touch sensor 280K, and the processor 210 is triggered to start the camera application and open the camera 293. Display screen 294 displays an interface, such as a viewfinder interface, for a camera application.
The wireless communication function of the mobile phone 200 can be implemented by the antenna 1, the antenna 2, the mobile communication module 251, the wireless communication module 252, the modem processor, the baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the handset 200 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 251 can provide a solution including 2G/3G/4G/5G wireless communication applied to the handset 200. The mobile communication module 251 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 251 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit the electromagnetic waves to the modem processor for demodulation. The mobile communication module 251 can also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 251 may be disposed in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 251 may be disposed in the same device as at least some of the modules of the processor 210. In this embodiment, the mobile communication module 251 may also be used for information interaction with other terminal devices.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 270A, the receiver 270B, etc.) or displays an image or video through the display screen 294. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 251 or other functional modules, independent of the processor 210.
The wireless communication module 252 may provide solutions for wireless communication applied to the mobile phone 200, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 252 may be one or more devices that integrate at least one communication processing module. The wireless communication module 252 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 210. The wireless communication module 252 may also receive a signal to be transmitted from the processor 210, perform frequency modulation on the signal, amplify the signal, and convert the signal into electromagnetic waves via the antenna 2 to radiate the electromagnetic waves. In this embodiment, the wireless communication module 252 is configured to transmit data with other terminal devices under the control of the processor 210, for example, when the processor 210 executes the … … method provided in this embodiment, the processor may control the wireless communication module 252 to send a determination request to other terminal devices, and may also receive a determination result made by other terminal devices based on the determination request, where the determination result indicates whether data to be transmitted can be transmitted to other terminal devices, and then control the display 294 to display the determination result, so as to provide visual feedback for a user, avoid erroneous operation and repeated operation, and improve operation efficiency
In addition, the mobile phone 200 can implement an audio function through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the earphone interface 270D, and the application processor. Such as music playing, recording, etc. The handset 200 may receive key 290 inputs, generating key signal inputs relating to user settings and function control of the handset 200. The cell phone 200 can generate a vibration alert (e.g., an incoming call vibration alert) using the motor 291. The indicator 292 of the mobile phone 200 may be an indicator light, which may be used to indicate a charging status, a power change, or an indication message, a missed call, a notification, etc. The SIM card interface 295 in the handset 200 is used to connect a SIM card. The SIM card can be attached to and detached from the mobile phone 200 by being inserted into the SIM card interface 295 or being pulled out from the SIM card interface 295.
It should be understood that in practical applications, the mobile phone 200 may include more or less components than those shown in fig. 7, and the embodiment of the present application is not limited thereto. The illustrated handset 200 is merely an example, and the handset 200 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The software system of the terminal device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the application takes an Android system with a layered architecture as an example, and exemplarily illustrates a software structure of a terminal device.
Fig. 8 is a block diagram of a software configuration of a terminal device according to an embodiment of the present application.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.
The application layer may include a series of application packages.
As shown in fig. 8, the application package may include phone, camera, gallery, calendar, talk, map, navigation, WLAN, bluetooth, music, video, short message, etc. applications.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 8, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like. The window manager may also be used to present the popup window and to maintain the state of the wireless network icon as on in S105.
The content provider is used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The telephone manager is used for providing a communication function of the terminal equipment. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to inform download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, text information is prompted in the status bar, a prompt tone is given, the terminal device vibrates, an indicator light flickers, and the like.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), Media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), and the like.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like. The 2D graphics engine is a drawing engine for 2D drawing. In this embodiment, when the terminal is in a screen-off state, both the three-dimensional graphics processing library and the 2D graphics engine stop drawing graphics.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
An embodiment of the present application provides a wireless network access apparatus, including: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions.
Embodiments of the present application provide a non-transitory computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method.
Embodiments of the present application provide a computer program product comprising computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when run in a processor of an electronic device, the processor in the electronic device performs the above method.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an erasable Programmable Read-Only Memory (EPROM or flash Memory), a Static Random Access Memory (SRAM), a portable Compact Disc Read-Only Memory (CD-ROM), a Digital Versatile Disc (DVD), a Memory stick, a floppy disk, a mechanical coding device, a punch card or an in-groove protrusion structure, for example, having instructions stored thereon, and any suitable combination of the foregoing.
The computer readable program instructions or code described herein may be downloaded to the respective computing/processing device from a computer readable storage medium, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers 107. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present application may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server 107. In the latter scenario, the remote computer may be connected to the user's computer through any type of Network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the internet using an internet service provider). In some embodiments, the electronic circuitry can execute computer-readable program instructions to implement aspects of the present application by utilizing state information of the computer-readable program instructions to personalize custom electronic circuitry, such as Programmable Logic circuits, Field-Programmable Gate arrays (FPGAs), or Programmable Logic Arrays (PLAs).
Various aspects of the present application are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
It is also noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by hardware (e.g., a Circuit or an ASIC) for performing the corresponding function or action, or by combinations of hardware and software, such as firmware.
While the invention has been described in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed invention, from a review of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps, and the word "a" or "an" does not exclude a plurality. A single processor or other unit may fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.
Having described embodiments of the present application, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (11)

1. A wireless network access method, comprising:
acquiring the running state of terminal equipment, wherein the terminal equipment is simultaneously connected with a plurality of wireless networks;
obtaining NAT overtime durations corresponding to the wireless networks respectively, wherein the NAT overtime durations comprise the longest duration for keeping connection of network links established by the wireless networks under the condition that communication does not occur;
when the operating state of the terminal equipment and the NAT timeout duration respectively corresponding to the plurality of wireless networks are determined to meet the preset conditions, disconnecting at least one of the plurality of wireless networks, wherein the operating state of the terminal equipment and the NAT timeout duration respectively corresponding to the plurality of wireless networks meet the preset conditions and comprise the following steps: the terminal equipment operates in a background, the NAT timeout duration corresponding to a first wireless network in the wireless networks is longer than the NAT timeout duration corresponding to a second wireless network, and at least one wireless network is the second wireless network.
2. The method of claim 1, wherein the operating condition comprises at least one of: the traffic usage information applied in the terminal device, the working mode of the terminal device, the electric quantity information of the terminal device, and the network information of the plurality of wireless networks.
3. The method according to claim 2, wherein the operation state of the terminal device meets a preset condition, and further comprises at least one of the following:
determining that an application with a flow larger than a preset flow threshold value runs in the terminal equipment according to the flow use information of the application in the terminal equipment;
determining that the terminal equipment operates in a low-power working mode according to the working mode of the terminal equipment;
determining that the electric quantity of the terminal equipment is smaller than a preset electric quantity threshold value according to the electric quantity information of the terminal equipment;
the electric quantity consumption speed of the terminal equipment is greater than a preset power consumption speed threshold, or the electric quantity consumption speed of the terminal equipment is greater than the charging speed;
and determining that the signal intensity of the wireless networks is greater than a preset intensity threshold value according to the network information of the wireless networks, or determining that the signal stability of the wireless networks is greater than a preset stability threshold value according to the network information of the wireless networks.
4. The method of claim 1, wherein the NAT timeout durations respectively corresponding to the plurality of wireless networks meet a preset condition, further comprising:
and the difference between the NAT overtime duration corresponding to the first wireless network and the NAT overtime duration corresponding to the second wireless network is greater than a preset duration threshold.
5. The method of claim 3, wherein said disconnecting at least one of the plurality of wireless networks comprises:
the terminal equipment runs an application with the flow rate larger than a preset flow rate threshold value;
and under the condition that the application utilizes the second wireless network for network communication, the second wireless network is disconnected after the application finishes the service or suspends the service.
6. The method of claim 3, wherein said disconnecting at least one of the plurality of wireless networks comprises:
the terminal equipment runs an application with the flow rate larger than a preset flow rate threshold value;
and under the condition that the application utilizes the first wireless network to carry out network communication, the first wireless network does not limit the flow, and the second wireless network is disconnected.
7. The method of claim 1, wherein said disconnecting at least one of the plurality of wireless networks comprises:
the terminal sends a notification message in a popup window form, wherein the notification message comprises a message for advising a user to disconnect the second wireless network;
receiving a user input, disconnecting the second wireless network.
8. The method of claim 1, wherein said disconnecting at least one of the plurality of wireless networks comprises:
and disconnecting the second wireless network, and keeping the state when the network identifier corresponding to the second wireless network is not disconnected.
9. A wireless network access apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to implement the method of any one of claims 1-8 when executing the instructions.
10. A non-transitory computer readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the method of any of claims 1-8.
11. A computer program product comprising computer readable code or a non-transitory computer readable storage medium carrying computer readable code, wherein when the computer readable code is run in a processor of an electronic device, the processor in the electronic device performs the method of any one of claims 1-8.
CN202011212754.5A 2020-11-03 2020-11-03 Wireless network access method and device Pending CN114449686A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011212754.5A CN114449686A (en) 2020-11-03 2020-11-03 Wireless network access method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011212754.5A CN114449686A (en) 2020-11-03 2020-11-03 Wireless network access method and device

Publications (1)

Publication Number Publication Date
CN114449686A true CN114449686A (en) 2022-05-06

Family

ID=81362094

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011212754.5A Pending CN114449686A (en) 2020-11-03 2020-11-03 Wireless network access method and device

Country Status (1)

Country Link
CN (1) CN114449686A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115278804A (en) * 2022-06-25 2022-11-01 荣耀终端有限公司 Network selection method and related equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115278804A (en) * 2022-06-25 2022-11-01 荣耀终端有限公司 Network selection method and related equipment

Similar Documents

Publication Publication Date Title
EP4024193A1 (en) Data transmission method and related devices
WO2021057868A1 (en) Interface switching method and electronic device
US20220179455A1 (en) Display method and electronic device
EP4072114A1 (en) Audio output method and terminal device
CN115297199A (en) Touch method of equipment with folding screen and folding screen equipment
CN111221845A (en) Cross-device information searching method and terminal device
CN111464987B (en) Method for displaying Bluetooth device identification and electronic device
WO2021063090A1 (en) Method for establishing application combination, and electronic device
CN114327666B (en) Application starting method and device and electronic equipment
CN115793916A (en) Method, electronic device and system for displaying multiple windows
CN116055773A (en) Multi-screen collaboration method, system and electronic equipment
CN112114733B (en) Screen capturing and recording method, mobile terminal and computer storage medium
CN114065706A (en) Multi-device data cooperation method and electronic device
US20230188832A1 (en) Device Identification Method and Related Apparatus
CN114442969A (en) Inter-device screen cooperation method and device
CN113709026B (en) Method, device, storage medium and program product for processing instant communication message
CN113391743B (en) Display method and electronic equipment
CN114449686A (en) Wireless network access method and device
CN110609650B (en) Application state switching method and terminal equipment
US20240168603A1 (en) Card Display Method, Electronic Device, and Computer-Readable Storage Medium
CN113079332B (en) Mobile terminal and screen recording method thereof
CN114500732B (en) Interface display method, electronic equipment and storage medium
CN115114607A (en) Sharing authorization method, device and storage medium
CN115113832A (en) Cross-device synchronous display control method and system
CN111787157A (en) Mobile terminal and operation response method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination