Patent Description:
With popularization of a <NUM> network, users have an increasingly intense requirement for a data access speed. Due to a great difference between <NUM>, <NUM>, and <NUM> network architectures, in most scenarios, a data service connection speed and network access speed of <NUM> are higher than those of <NUM>, which are higher than those of <NUM>. Therefore, when accessing a network by using mobile data, most common users require that terminal devices camp on a higher network RAT, to meet a higher access speed.

Currently, in the 3GPP (3rd Generation Partnership Project, 3rd generation partnership project) protocol, there are three means of switching between RATs: hand over (handover, connected mode), redirection (redirection, connected mode), and reselection (reselection, idle mode). Based on an actual network configuration status, in some areas with a high RAT (<NUM>/<NUM>), UE remains in a low-RAT network for a long time because a network configuration is improper or switching is not triggered. For this problem, vendors, such as Qualcomm, have respective related solutions.

However, most UEs cannot determine whether the terminal device is in a moving state and whether a neighboring network has coverage of a high-RAT network. For such UE, a periodic search mode is designed, that is, a round of searching for a <NUM>/<NUM> network is autonomously initiated when a specific timer expires. This mode cannot be effectively combined with actual user experience. For example, if a user does not move, blind searching may waste power; when the user actually moves to an area with <NUM>/<NUM> coverage, searching is not performed in a timely manner because a timer has not expired.

<CIT> discloses a UE initiated evolved packet core and IP multimedia subsystem network usage optimization algorithm for LTE capable smartphones connected to a wireless LAN network.

<CIT> discloses improved network access and a mobile station configured for the same.

Therefore, this application attempts to combine a characteristic of an intelligent terminal system with a user experience scenario, to initiate searching for a high-RAT network when a user "has a need", thereby meeting a tradeoff between user experience and power consumption as far as possible.

According to a first aspect, a method is provided as defined in claim <NUM>. The method includes: A terminal device connects to a first hotspot, performs a data service by using the first hotspot, and when the terminal device is disconnected from the first hotspot, starts searching for a high-priority network, where the terminal device stores a high-priority network list, and searching is performed in descending order of priorities in the high-priority network list. In this way, the terminal device can trigger a search for a high-priority network more quickly.

According to a first possible implementation of the first aspect, that the terminal device is disconnected from the first hotspot specifically includes: The terminal device leaves an area covered by a signal of the first hotspot, or a signal strength of the first hotspot is less than a threshold. In this way, the terminal device can trigger a search for a high-priority network more quickly in a plurality of scenarios.

According to a second possible implementation of the first aspect, when the terminal device is disconnected from the first hotspot, the terminal device does not start searching for a high-priority network, where the terminal device stores a search record of searching for the high-priority network by the terminal device when the terminal device is disconnected from the first hotspot, and the search record identifies that when the terminal device is disconnected from the first hotspot, the terminal device does not camp on the high-priority network or a signal strength of the high-priority network is less than a threshold. According to the method, a search failure probability can be reduced based on the search record.

According to a third possible implementation of the first aspect, the connecting, by a terminal device, to a first hotspot, and performing a data service by using the first hotspot specifically includes: The terminal device connects to the first hotspot, and performs the data service by using the first hotspot, where the terminal device is at a first location. The starting, by the terminal device when the terminal device is disconnected from the first hotspot, searching for a high-priority network specifically includes: When the terminal device is disconnected from the first hotspot, the terminal device starts searching for a high-priority network, where the terminal device is at a second location. The first location is an area that can be covered by a signal of the first hotspot. The second location is an area that cannot be covered by the signal of the first hotspot or an area in which a signal strength of the first hotspot is less than a threshold. According to the method, the terminal device can switch between hotspot connections based on a signal-covered area.

According to any one of the implementations of the first aspect, the high-priority network is a highest-RAT network supported by the terminal device or a preset highest-RAT network, and the high-priority network is a <NUM> or <NUM> network. The high-priority network is a highest-RAT network supported by the terminal device or a preset highest-RAT network. The terminal device stores network parameters of the first hotspot and network parameters of the second hotspot. The network parameter signal includes a strength, signal quality, a registration success rate, and a packet loss rate. The terminal device records first-hotspot information and second-hotspot information of the first location. The recording specifically includes recording SSIDs, BSSIDs, signal strengths, signal quality, registration success rates, and encryption and authentication manners of the first hotspot and the second hotspot. The terminal device sets the first hotspot as a high-priority network based on the first-hotspot information and the first-hotspot information. In this way, a high-priority network can be set.

According to a second aspect of the invention, a terminal device is provided, including: a touchscreen, where the touchscreen includes a touch-sensitive surface and a display; one or more processors; a memory; a plurality of application programs; and one or more computer programs. The one or more computer programs are stored in the memory. The one or more computer programs include an instruction. When the instruction is executed by the terminal device, the terminal device is enabled to perform the method of the first aspect.

According to a third aspect, a computer readable storage medium is provided, including an instruction. When the instruction is executed on an electronic device, the electronic device is enabled to perform the method of the first aspect.

After a terminal device is switched on or powered on, or performs cell reselection, the terminal device first searches for an available public land mobile network (Public Land Mobile Network, PLMN). After finding the available PLMN network, the terminal device can obtain a corresponding cell service, and camp on a cell.

In some embodiments, a terminal device prestores a PLMN list, and in the list, a plurality of PLMN networks are arranged in order of priorities, as shown in the following table. A PLMN <NUM>, a PLMN <NUM>, and a PLMN <NUM> may be operator names, for example, Sprint and T-mobile.

During network registration, the terminal device may search for a network based on the priorities in the PLMN list, and attempt to camp on a high-priority network.

If the terminal device has accessed a VPLMN (Visited PLMN, visited PLMN), but the VPLMN is not a PLMN with a highest priority under a same country code, the UE needs to periodically initiate searching for a PLMN, to find a better PLMN for camping. For example, the terminal device is registered with the network operator Sprint, but can find only a network of T-Mobile in a current cell. Although a country code is the same, the mobile network cannot provide a service that can be used by the terminal. Therefore, the terminal device needs to periodically perform searching to find whether there is a China Unicom network, so as to be handed over back to an HPLMN (Home PLMN, home PLMN) as soon as possible to enjoy a service provided by China Unicom. For another example, when the terminal device moves to a location B from a location A, and the location B supports signal coverage of a network of a higher RAT (for example, <NUM>), the terminal device triggers searching for a high-priority network, and attempts to camp on the <NUM> network. This may be understood as that the location A and the location B are different cells.

In some embodiments, a terminal device camps on a VPLMN, and starts an HPLMN timer to return to an HPLMN or a high-priority PLMN as soon as possible. After the HPLMN timer expires, the terminal device attempts to search for a high-priority network.

In addition, searching for a high-priority network is mostly used by the terminal device to return to a high-priority network mode. If an access mode of an HPLMN high-priority network is preferentially enabled by using an NVM (Non-volatile memory, NVM for short), and the terminal device currently does not camp on a high-priority network access mode, even if the terminal device currently camps on an HPLMN, searching for a high-priority network is still initiated. This is mainly for a case in which the terminal device is in a <NUM>/<NUM> network and no neighboring cell is configured for the network. In this case, the terminal device can still return to LTE (Long Term Evolution, long term evolution) by performing background searching, instead of merely relying on reselection.

In some embodiments, a terminal device may extend to searching for networks of other access points, for example, Wi-Fi, Bluetooth, and NR.

It may be understood that "searching for a high-priority network" is merely a term used in the embodiments of this application. A meaning represented by the term is described in the embodiments of this application, and a name of the term does not constitute any limitation on the embodiments of this application. During specific implementation, "searching for a high-priority network" may be implemented by using various network search functions provided by existing mobile phone manufacturers, for example, background search (Background research, "background search" for short) functions of Qualcomm and Huawei. In some embodiments of this application, "searching for a high-priority network" may also be referred to as "searching for a network", "a search for a high-priority network", "background searching", "a background search", "background searching for a network", and "network searching".

<FIG> is a first schematic diagram of searching for a high-priority network according to a possible implementation of this application.

As shown in <FIG>, an embodiment of this application provides a method for searching for a high-priority network by a terminal device. In a possible design, the high-priority network is a highest-RAT network supported by the terminal device, for example, a <NUM> network. In a possible design, the high-priority network may be alternatively set by a user. For example, the terminal device can support a <NUM> network, but in consideration of traffic and the like, the user sets the terminal device to preferentially connects to a <NUM> network at present. In this case, the high-priority network is a <NUM> network. Specific steps are as follows.

Step <NUM>: The terminal device determines whether a network on which the terminal device camps is a high-priority network, and performs a next step (step <NUM>) if the network is not a high-priority network, or may not start background searching (step <NUM>) if determining that the current network is a high-priority network.

In some embodiments, when an RAT of a network on which the terminal device camps changes, the terminal device determines whether the terminal device is in a high-priority network. For example, when the terminal device is handed over from a <NUM> network to a <NUM> network, the terminal device may obtain a current network RAT or type, for example, an Android device may use a function int getNetworkType(), where the function can be used to indicate the current network type of the terminal device, and NETWORK_TYPE_LTE indicates a <NUM> network. In this way, the terminal device determines whether a network on which the terminal device camps is a high-priority network. In some embodiments, the terminal device may alternatively detect, in real time, whether the terminal device is in a non-high-priority network.

In some other embodiments, the terminal device may set a maximum quantity (for example, <NUM>) of searches for a high-priority network. After the maximum quantity of background searches is reached, the terminal device may pause searching (for example, may wait for <NUM> minute before starting searching), or may stop searching (that is, stop searching for a high-priority network), or may suspend searching for a high-priority network (suspend searching for a high-priority network, and after a specific condition is met, may restart searching). When determining that the maximum quantity of searches for a high-priority network is not reached, the terminal device proceeds to the next step (step <NUM>). When a quantity of background searches reaches the maximum quantity of background searches, the terminal device does not start background searching.

Step <NUM>: The terminal device starts a high-priority network search timer, and after the high-priority network search timer expires, the terminal device enables a background search function (<NUM>). In some embodiments, the high-priority network search timer may have different settings. For example, duration of the high-priority network search timer for the first time is <NUM> minutes, and the first search for a high-priority network lasts for <NUM> minutes; duration of the high-priority network search timer for the second time is <NUM> minutes, and the second search for a high-priority network lasts for <NUM> minutes.

Step <NUM>: The terminal device starts searching for a high-priority network, where background search duration may be set, for example, to <NUM> seconds.

In some embodiments, after the high-priority network search timer (which may also be referred to as a "background search timer" or "background searching timer") expires, the terminal device determines whether the terminal device is currently in an idle state. If the terminal device is in the idle state, the terminal device starts searching for a high-priority network. If the device is not currently in the idle state, until the terminal device enters the idle state, the terminal device does not start searching for a high-priority network. This prevents the terminal device from searching for a high-priority network in the idle state. Therefore, power consumption is reduced.

In some embodiments, trigger duration may be configured by using an NVM (Non-volatile memory, NVM for short). For example, first-time trigger duration is <NUM> minutes. In a possible design, the background search timer may periodically trigger background searching for a network, thereby reducing power consumption.

<FIG> is a second schematic diagram of background searching according to another embodiment of this application.

As shown in <FIG>, in some embodiments, background searching for a high-priority network may be alternatively triggered by determining that Wi-Fi is in a disconnected state. In some embodiments, the Wi-Fi disconnected state may not be caused by a user operation (turning off a Wi-Fi switch), for example, may be caused by a network fault or leaving an effective range of signal coverage of a current Wi-Fi access point.

In some embodiments, searching for a high-priority network may be alternatively triggered when a terminal device is connected to a network of poor quality, for example, a signal strength, signal quality, or a packet loss rate is less than a threshold.

When detecting that Wi-Fi is in the disconnected state, a terminal device may directly start searching for a high-priority network, that is, a trigger condition of searching for a high-priority network may not depend on a background search timer. In some embodiments, if a high-priority network is found, the terminal device attempts to camp on and register with the high-priority network; if no high-priority network is found, the background search timer may still be used as the background search trigger condition.

In some embodiments, when Wi-Fi is disconnected, if the background search timer expires, or a maximum quantity of background searches is reached, or a non-first background search times out, that is, background searching has been performed, background searching is not re-triggered in this case.

In some embodiments, when Wi-Fi is disconnected, if the terminal device triggers background searching, but at this moment, the background search timer expires, or a maximum quantity of background searches is reached, or a non-first background search times out, that is, background searching has been performed, background searching is not re-triggered in this case.

In some embodiments, when Wi-Fi is disconnected, if the terminal device triggers background searching, the background search timer may pause or stop timing.

In some embodiments, when Wi-Fi is disconnected, if the terminal device triggers background searching, the background search timer may still perform timing.

In some embodiments, after background searching is started, where the background search trigger condition may be that Wi-Fi is disconnected or the timer expires, if no high-priority network is found, triggering may still be performed by using the background search timer.

According to this embodiment, when a user leaves a Wi-Fi hotspot coverage area, a probability of camping on a high-priority network can be increased, and a time for returning to a high-RAT network can be shortened, so that better network access experience can be obtained.

In consideration of user experience, a requirement for a high-priority network is not intense when Wi-Fi is connected; when Wi-Fi is disconnected, mobile data needs to be used for user data service sending and receiving, and therefore, a requirement for a high RAT such as <NUM>/<NUM> is more intense. Therefore, when Wi-Fi is disconnected, user experience may be improved by increasing a possibility of camping on a high-RAT network, and shortening a time for returning to a high-RAT network.

In this implementation, a Wi-Fi hotspot may also be extended to hotspots of other types, for example, NR (<NUM> access network), an LTE base station, and Bluetooth.

<FIG> is a third schematic diagram of background searching according to implementations of this application.

As shown in <FIG>, embodiments of this application provide a manner of learning with a combination of a Wi-Fi module, an AI (Artificial intelligence, artificial intelligence) module, and a modem module to determine a success probability of searching for a high-RAT network after Wi-Fi is disconnected, so as to optimize searching for a high-priority network.

Each time a different Wi-Fi hotspot is disconnected, a terminal device searches for a high-priority network, and records and learns a network search result. The AI module is used for recording the search result, for example, as shown in Table <NUM>.

The terminal device records a quantity of successful network searches, a quantity of failed network searches, and a network search success probability after background searching is triggered each time.

The terminal device determines, based on a historical result of searching for a high-priority network, whether to start searching for a high-priority network. After performing recording or learning for a plurality of times, the terminal device may determine, based on currently disconnected Wi-Fi, whether a high-RAT network can be found. For example, the terminal device is currently connected to Wi-Fi-<NUM> and performs a data interaction service. When the terminal is disconnected from Wi-Fi-<NUM>, the terminal device starts searching for a high-priority network, as described in <FIG>. However, the terminal device finds, based on a historical search record, that a success rate of starting background searching after Wi-Fi-<NUM> is disconnected is <NUM>. In this case, background searching may not be started.

In some embodiments, if it is determined, based on a historical record, that no high-RAT network is found, the terminal device may not trigger background searching, for example, for Wi-Fi-<NUM>.

Whether to initiate background searching, for example, for Wi-Fi-<NUM> or Wi-Fi-<NUM>, is determined based on a probability, in a historical record, of successfully finding a high-RAT network.

In some embodiments, whether to initiate background searching is determined based on a background network search probability and a total quantity of searches. For example, for Wi-Fi <NUM>, although a network search success probability is <NUM>%, a total quantity of network searches is only <NUM>. In this case, learning continues, and network searching may not be initiated.

The foregoing record table is merely for ease of understanding. In a possible design, the record table may be alternatively in a form of a packet, information, data, or the like.

When the terminal device leaves a Wi-Fi coverage area, a probability of camping on a high-RAT network can be increased, and a time for returning to a high-RAT network can be shortened, so that better network access experience can be obtained. Considering that habitual use locations of most users are comparatively concentrated, a success rate of searching for a high-RAT network can be effectively increased through machine learning. If there is no high-RAT network in an actual environment, a waste of power caused by unnecessary searching is also avoided.

<FIG> is a fourth schematic diagram of background searching according to a possible implementation of this application.

A method for determining, by using a sensor, behaviors of a terminal entering and leaving an elevator, and triggering background searching for a high-priority network is provided. In some embodiments, the sensor may include a barometer, an accelerometer, and the like.

Step <NUM>: A terminal device determines an elevator mode, that is, determines behaviors of the terminal device entering and leaving an elevator.

For example, a walking state is identified by using an accelerometer; a weightless state and an overweight state in the elevator are identified by means of, for example, detecting acceleration and deceleration by using the accelerometer, and detecting a change in atmospheric pressure by using a barometer; and the walking state is compared with the overweight or weightless state, so as to identify a behavior of entering the elevator and a behavior of leaving the elevator. The elevator mode can be accurately identified after a plurality of times of learning.

After identifying the elevator mode, when detecting that the terminal device moves out of the elevator, the terminal device sends the state to a modem or an AP.

Step <NUM>: The modem or the AP determines that a network on which the terminal device camps is a non-high-priority network, and triggers searching for a high-priority network.

Step <NUM>: The terminal device starts searching for a high-priority network. Specifically, the terminal device starts a high-priority network search timer, and after the high-priority network search timer expires, the terminal device enables a high-priority network search function. In some embodiments, the high-priority network search timer may have different settings. An example is as follows:.

Duration of the high-priority network search timer for the first time is <NUM> minutes, and the first search for a high-priority network lasts for <NUM> minutes; duration of the high-priority network search timer for the second time is <NUM> minutes, and the second search for a high-priority network lasts for <NUM> minutes.

The modem feeds back a high-priority network search result to an AI module, and the AI module records and learns the search result for determining of a high-RAT search when leaving the elevator next time.

As shown in step <NUM> in the figure, in some embodiments, when it is determined that the mobile device moves out of the elevator, background searching for a high-RAT network may not be started, for example, if it is found, based on a historical record, that there is no high-RAT network in a current environment, or the terminal device is currently located in a high-RAT network.

The terminal device records a search result of each started background search for a high-priority network, as shown in steps <NUM> and <NUM>.

In a possible design, when it is identified that the terminal device moves out of the elevator, and a current network is not a high-priority network, if it happens that the background search timer expires, or a maximum quantity of background searches is reached, or a non-first background search times out, that is, background searching has been performed, background searching is not re-triggered in this case.

In a possible design, when it is identified that the terminal device moves out of the elevator, and a current network is not a high-priority network, if the terminal device triggers background searching for a high-priority network, but at this moment, the background search timer expires, or a maximum quantity of background searches is reached, or a non-first background search times out, that is, background searching has been performed, background searching is not re-triggered in this case.

In a possible design, when it is identified that the terminal device moves out of the elevator, and a current network is not a high-priority network, if the terminal device triggers background searching for a high-priority network, the background search timer may pause or stop timing.

In a possible design, when it is identified that the terminal device moves out of the elevator, and a current network is not a high-priority network, if the terminal device triggers background searching for a high-priority network, the background search timer may still perform timing.

<FIG> is a fifth schematic diagram of background searching according to a possible implementation of this application.

As shown in <FIG>, information about wireless access points such as Wi-Fi, LTE, NR, and Bluetooth access points may be collected at a location of a terminal. The information includes SSIDs (Service Set Identifier), BSSs (Basic Service Set), signal strengths, signal quality, registration success rates, encryption and authentication manners, and other network parameters of the access points. It should be noted that "a location" in this application may be a cell covered by a signal of an access point, may be a location covered based on a GPS (Global Positioning System) signal, may be a virtual space obtained through clustering based on recorded network status information, or may be based on a physical space, for example, a room. This is not limited in this application.

In a possible design, one location may have a plurality of wireless access points. For example, a bedroom may be covered by signals of different hotspots, including a base station, Wi-Fi, and the like.

In a possible design, the terminal device may record and learn access point information of a location, and recommend a high-priority access point thereof. For example, the high-priority access point may be set based on a specific network parameter, for example, a signal strength or signal quality. When the terminal device moves to a bedroom from a dining room, if it is detected that a recommended access point for the bedroom is Wi-Fi <NUM>, the terminal device may be automatically connected to the Wi-Fi <NUM> access point.

In a possible design, as shown in <FIG>, the terminal device may also display a pop-up box to remind a user of an access point signal coverage list.

A quantity of five-pointed stars may be used to denote network quality of an access point (that is, an identifier indicating network quality of an access point is a five-pointed star). A larger quantity of five-pointed stars indicates better quality of an access point that the terminal device registers with or is connected to. Certainly, in this embodiment of the present invention, a form of an identifier indicating network quality of an access point to which the terminal device is connected is described by using merely an example herein. In an actual application scenario, an identifier of network quality when the terminal accesses a network by using an online hotspot may be alternatively presented in another form. This is not specifically limited in this embodiment of the present invention.

A user interface may further display an identifier of a recommended access point for connection and a network type of an access point that cannot be connected.

The user interface may also display information such as an SSID, a signal strength, and signal quality of each access point, and may also display a current high-priority access point in an emphasized manner. The emphasized displaying may be implemented in a manner such as highlighting or text displaying. This is not limited in this application.

In a possible design, as shown in <FIG>, alternatively, a pop-up box may be used to inform a user of a high-priority access point at a current location, and request the user to confirm whether to connect to the high-priority access point. The terminal device may determine, based on a selection of the user, whether to connect to the high-priority access point.

In a possible design, a recommended high-priority access point network may be a network of an access point whose network parameter meets a preset condition, for example, a signal strength or signal quality is greater than a threshold, where the threshold may be an empirical value.

In some embodiments, signals such as a Wi-Fi signal, a <NUM> signal, an LTE signal, and an NR signal may be collected based on information such as a geographical location, service traffic, or camping duration of the terminal device, including signal quality, a signal strength, and an application smoothness degree. For example, camping duration of the terminal device at a location A exceeds a threshold. For another example, the terminal device requires large service traffic at a location B. It should be noted that the locations A and B herein are not limited in this application. Each of A and B may be a room, may be an open field, may be an area covered by a signal of an access point, or may be a virtual space obtained through clustering based on information about wireless access points such as Wi-Fi, LTE, NR, and Bluetooth access points.

After collecting signal coverage information of a location or space, the terminal device may establish a signal fingerprint database of the location. It may be understood that, based on such a signal fingerprint database, it can be determined that the terminal device currently moves to a location or space, and signal fingerprint database information of the current location can be obtained. This may also be understood as follows: A virtual space is obtained through clustering based on signal fingerprint database information. For example, the terminal device has collected signal fingerprint database information of a location A, and when the terminal device arrives at the location A again, the terminal device obtains signals such as a Wi-Fi signal, a <NUM> signal, an LTE signal, and an NR signal at the location A. The terminal device may compare signal information of any one or more access points with a signal fingerprint database, obtain a high-RAT network or a network whose signal is optimal at the location A, and attempt to camp on and register with the network.

As shown in <FIG>, the terminal device may collect signals, including LTE and Wi-Fi signals, in a bedroom, a dining room, and a bathroom. The LTE signals include LTE <NUM>×<NUM> and LTE <NUM>×<NUM> signals, and the Wi-Fi signals include Wi-Fi <NUM> and Wi-Fi <NUM> signals. In a possible design, parameter information such as signal quality, a registration success probability, and a recommended signal of each room may be recorded. For example, when the mobile terminal moves to the bedroom from the dining room, the mobile terminal obtains LTE and Wi-Fi signals, for example, obtains a Wi-Fi <NUM> signal and determines that signal quality is intermediate, and further obtains a Wi-Fi <NUM> signal and determines that signal quality is comparatively poor. The mobile terminal compares information about the obtained Wi-Fi signals with fingerprint database information stored in the terminal device, determines that the mobile terminal enters the bedroom, and recommends Wi-Fi <NUM> to the terminal device for connection.

In some embodiments, when the terminal device moves to the dining room, the terminal device may obtain parameter information of LTE <NUM>×<NUM>, LTE <NUM>×<NUM>, Wi-Fi <NUM>, and Wi-Fi <NUM> in real time. For example, a signal strength of LTE <NUM>×<NUM> is <NUM> dB. When it is determined that the parameter information of the LTE <NUM>×<NUM>, LTE <NUM>×<NUM>, Wi-Fi <NUM>, and Wi-Fi <NUM> hotspots is the same as that previously collected by the terminal device, or signal parameters are within a predetermined range, Wi-Fi <NUM> is recommended to the terminal device for connection.

In some embodiments, the terminal device may store information such as Wi-Fi information, LTE information, and NR information collected indoors, or the information may be stored on a cloud or a server.

In some embodiments, when it is detected that the terminal device moves to the dining room from the bedroom, the terminal device connects to a Wi-Fi <NUM> network. Similarly, when it is detected that the terminal device moves to the bathroom from the dining room, the terminal device preferentially connects to an LTE <NUM>×<NUM> network.

A specific implementation procedure is shown in <FIG>.

An AI learning module may establish a signal fingerprint database of a location by collecting a signal of the location, and may record a highest-RAT network of the location, and set the highest-RAT network to be of a highest priority. In a possible design, signal fingerprint database information may also be extended to information about various access points. An access point with a comparatively good signal is recommended to the terminal device for connection.

When the mobile terminal moves to a location B from a location A, the mobile terminal compares information about an obtained signal with fingerprint database information, and determines a recommended network, that is, a high-priority network, of the current location B. When the terminal device is in a non-high-RAT network, the terminal device starts searching for a high-RAT network.

The AI module also stores and records a result of each background search.

Indoor coverage information of signals such as cellular, Wi-Fi, and BT signals is collected by using an intelligent terminal, signal fingerprints are clustered into a virtual space through intelligent learning, and a signal strength, signal quality, and an application smoothness degree of each space during ordinary use of the terminal (a collection phase) are accumulated. Subsequently (during an identification phase), after entering a space, the terminal can determine, based on historical statistics about a signal strength, signal quality, and an application smoothness degree, whether the space is covered by a high-RAT network. In this way, the terminal can quickly camp on a high-RAT network without searching for a high-RAT or fullband network.

<FIG> is a schematic diagram of a terminal device according to a possible implementation of this application.

As shown in <FIG>, an AP needs to include a sensor module (integrating modules such as a barometer and an accelerometer), AI (configured to integrate a machine learning algorithm), and a Wi-Fi module; a modem implements a communications protocol of the terminal device, and provides functions such as searching for a network, camping, registration, and service initiation.

To enable interworking of wireless communication between the terminal device and a base station (for example, an eNodeB), each of the terminal device and the base station may be logically divided, based on an OSI (Open System Interconnection Reference Model) framework, into three protocol layers: a physical layer (namely, a PHY layer), a data link layer (namely, a DLC layer), an application layer, and a non-access stratum. The physical layer is mainly used to provide a wireless physical channel for transmission of a higher layer service, and this layer is mainly implemented by the network-side base station. The non-access stratum (Non-Access Stratum, NAS) serves as a function layer between a core network and the terminal device. The non-access stratum is relative to an access stratum. Protocol layers below an RRC layer may be collectively referred to as the access stratum. Signaling of the access stratum paves the way for signaling interaction of the non-access stratum. The non-access stratum supports signaling and data transmission between the core network and the terminal device, and mainly includes authentication and security control functions. The application layer is mainly used to directly connect to an application program, and provide a common network application service.

The data link layer may be further divided into three sublayers: a media access control layer, or "MAC layer" for short, which mainly provides an interface between a radio link control layer and the physical layer; the radio link control (Radio Link Control) layer, or "RLC layer" for short, which mainly provides segmentation and retransmission services for the terminal device and control data; and a packet data convergence protocol (Packet Data Converge Protocol) layer, or "PDCP layer" for short, which is mainly used to process a radio resource control message on a control plane and an Internet protocol packet on a user plane. The application layer mainly refers to the radio resource control (Radio Resource Control) layer, hereinafter referred to as "RRC layer" for short. A main function of the RRC layer is to allocate a radio resource and send related signaling. A main part of control signaling between the terminal device and a UTRAN (UMTS Terrestrial Radio Access Network) is an RRC message. The RRC message carries all parameters required for establishment, modification, and release of MAC layer and physical layer protocol entities, and also carries some signaling of the non-access stratum.

On condition that indoor signal coverage is comparatively stable, the AI module identifies a virtual space through intelligent learning based on a signal fingerprint collected by the terminal. In this way, searching for a high-RAT network can be quickly triggered when the terminal moves to a place with a high-RAT network of comparatively good quality. This improves user experience.

A terminal device <NUM> in the embodiments of this application may be a terminal device, a tablet computer, a PDA (Personal Digital Assistant, personal digital assistant), a POS (Point of Sales, point of sale), a vehicle-mounted computer, a TV, a wearable device, an AR device, a VR device, or the like.

For example, the terminal device <NUM> is a mobile phone. <FIG> is a block diagram of a partial structure of the terminal device <NUM> related to the embodiments of this application. Referring to <FIG>, the terminal device <NUM> includes components such as an RF (Radio Frequency, radio frequency) circuit <NUM>, a memory <NUM>, another input device <NUM>, a display screen <NUM>, a sensor <NUM>, an audio circuit <NUM>, an I/O subsystem <NUM>, a processor <NUM>, and a power supply <NUM>. A person skilled in the art may understand that the terminal device structure shown in <FIG> does not constitute a limitation on the terminal device, and the terminal device may include more or fewer components than those shown in the figure, or combine some components, or split some components, or have a different component arrangement. A person skilled in the art may understand that the display screen <NUM> belongs to a user interface (UI, User Interface), and the terminal device <NUM> may include more or fewer user interfaces than those shown in the figures.

The following specifically describes each constituent part of the terminal device <NUM> with reference to <FIG>.

The RF circuit <NUM> may be configured to receive and send information, or receive and send signals in a call process, and in particular, receive downlink information from a base station and then send the downlink information to the processor <NUM> for processing. In addition, the RF circuit <NUM> sends uplink data to the base station. Usually, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, an LNA (Low Noise Amplifier, low noise amplifier), a duplexer, and the like. In addition, the RF circuit <NUM> may further communicate with a network and another device through wireless communication. The wireless communication may be performed by using any communications standard or protocol, including but not limited to GSM (Global System of Mobile communication, global system for mobile communications), GPRS (General Packet Radio Service, general packet radio service), CDMA (Code Division Multiple Access, code division multiple access), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), LTE (Long Term Evolution, long term evolution), email, SMS (Short Messaging Service, short message service), and the like.

The memory <NUM> may be configured to store a software program and module. The processor <NUM> performs various function applications and data processing of the terminal device <NUM> by running the software program and module stored in the memory <NUM>. The memory <NUM> may mainly include a program storage area and a data storage area. The program storage area may store an operating system, an application program required by at least one function (for example, a sound playback function and an image playback function), and the like. The data storage area may store data (for example, audio data or a phone book) and the like created based on use of the terminal device <NUM>. In addition, the memory <NUM> may include a high-speed random access memory, and may further include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, or another non-volatile solid-state storage device.

The another input device <NUM> may be configured to receive digital or character information that is entered, and generate key signal input related to user setting and function control of the terminal device <NUM>. Specifically, the another input device <NUM> may include but is not limited to one or more of a physical keyboard, a function key (for example, a volume control key or an on/off key), a trackball, a mouse, a joystick, and an optical mouse (the optical mouse is a touch-sensitive surface that does not display a visual output, or is an extension of a touch-sensitive surface formed by a touchscreen). The another input device <NUM> is connected to an another-input-device controller <NUM> of the I/O subsystem <NUM>, and performs signal interaction with the processor <NUM> under control of the another-device-input controller <NUM>.

The display screen <NUM> may be configured to display information entered by a user or information provided for a user, and various menus of the terminal device <NUM>, and may further receive user input. Specifically, the display screen <NUM> may include a display panel <NUM> and a touch panel <NUM>. The display panel <NUM> may be configured in a form of an LCD (Liquid Crystal Display, liquid crystal display), an OLED (Organic Light-Emitting Diode, organic light-emitting diode), or the like. The touch panel <NUM>, also referred to as a touchscreen, a touch-sensitive screen, or the like, may collect a contact or non-contact operation performed by the user on or near the touch panel <NUM> (for example, an operation performed by the user on the touch panel <NUM> or near the touch panel <NUM> by using any suitable object or accessory such as a finger or stylus, also including a motion sensing operation, where the operation includes operation types such as a single-point control operation and a multi-point control operation), and drive a corresponding connection apparatus according to a preset program. Optionally, the touch panel <NUM> may include two parts: a touch detection apparatus and a touch controller. The touch detection apparatus detects a touch position and posture of the user, detects a signal brought by a touch operation, and transmits the signal to the touch controller. The touch controller receives touch information from the touch detection apparatus, converts the touch information into information that can be processed by the processor, sends the information obtained through conversion to the processor <NUM>, and can receive and execute a command sent by the processor <NUM>. In addition, the touch panel <NUM> may be implemented in a plurality of types, such as a resistive type, a capacitive type, an infrared type, and a surface acoustic wave type, or the touch panel <NUM> may be implemented by using any technology developed in the future. Further, the touch panel <NUM> may cover the display panel <NUM>. The user may perform an operation on or near the touch panel <NUM> that covers the display panel <NUM>, based on content displayed on the display panel <NUM> (the displayed content includes but is not limited to a soft keyboard, a virtual mouse, a virtual key, an icon, and the like). After detecting a touch operation on or near the touch panel <NUM>, the touch panel <NUM> transmits the touch operation to the processor <NUM> by using the I/O subsystem <NUM>, to determine a touch event type to determine user input. Then, the processor <NUM> provides a corresponding visual output on the display panel <NUM> based on the touch event type by using the I/O subsystem <NUM>. In <FIG>, the touch panel <NUM> and the display panel <NUM> are used as two independent components to implement input and onput functions of the terminal device <NUM>. However, in some embodiments, the touch panel <NUM> and the display panel <NUM> may be integrated to implement input and output functions of the terminal device <NUM>.

The terminal device <NUM> may further include at least one sensor <NUM>, for example, a light sensor, a motion sensor, and another sensor. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor may adjust luminance of the display panel <NUM> based on brightness of ambient light, and the proximity sensor may turn off the display panel <NUM> and/or a backlight when the terminal device <NUM> moves to an ear. As a type of motion sensor, an accelerometer sensor may detect magnitudes of acceleration in various directions (generally on three axes), may detect a magnitude and direction of gravity in a static state, and may be used for an application identifying a posture of the terminal device (such as switching between landscape orientation and portrait orientation, a related game, and magnetometer posture calibration) and a function related to vibration identification (such as a pedometer and knocking). For other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor that may be further configured for the terminal device <NUM>, details are not described herein.

The audio circuit <NUM>, a loudspeaker <NUM>, and a microphone <NUM> may provide an audio interface between the user and the terminal device <NUM>. The audio circuit <NUM> may transmit, to the loudspeaker <NUM>, a signal converted from received audio data, and the loudspeaker <NUM> converts the signal into a sound signal for outputting. In addition, the microphone <NUM> converts a collected sound signal into a signal, and the audio circuit <NUM> receives the signal, converts the signal into audio data, and then outputs the audio data to the RF circuit <NUM> to send the audio data to, for example, another terminal device, or outputs the audio data to the memory <NUM> for further processing.

The I/O subsystem <NUM> is configured to control a peripheral input/output device, and may include the another-device-input controller <NUM>, a sensor controller <NUM>, and a display controller <NUM>. Optionally, one or more another-input-control-device controllers <NUM> receive a signal from the another input device <NUM> and/or send a signal to the another input device <NUM>. The another input device <NUM> may include a physical button (a press button, a rocker button, or the like), a dial, a slider switch, a joystick, a click scroll wheel, and an optical mouse (the optical mouse is a touch-sensitive surface that does not display a visual output, or is an extension of a touch-sensitive surface formed by a touchscreen). It should be noted that the another-input-control-device controller <NUM> may be connected to any one or more of the foregoing devices. The display controller <NUM> in the I/O subsystem <NUM> receives a signal from the display screen <NUM> and/or sends a signal to the display screen <NUM>. After the display screen <NUM> detects user input, the display controller <NUM> converts the detected user input into interaction with a user interface object displayed on the display screen <NUM>, that is, implements man-machine interaction. The sensor controller <NUM> may receive a signal from one or more sensors <NUM> and/or send a signal to the one or more sensors <NUM>.

The processor <NUM> is a control center of the terminal device <NUM>, is connected to all parts of the entire terminal device by using various interfaces and lines, and executes various functions and data processing of the terminal device <NUM> by running or executing the software program and/or module stored in the memory <NUM> and by invoking data stored in the memory <NUM>, so as to perform overall monitoring on the terminal device. Optionally, the processor <NUM> may include one or more processing units. Preferably, an application processor and a modem processor may be integrated into the processor <NUM>. The application processor mainly performs processing of an operating system, a user interface, an application program, and the like. The modem processor mainly performs processing of wireless communication. It may be understood that, alternatively, the modem processor may not be integrated into the processor <NUM>.

The terminal device <NUM> further includes the power supply <NUM> (for example, a battery) that supplies power to each component. Preferably, the power supply may be logically connected to the processor <NUM> by using a power management system, to implement functions such as charging management, discharging management, and power consumption management by using the power management system.

In some embodiments, whether the terminal device is currently in an elevator mode may be detected by using a sensor such as a barometer or gyroscope of the terminal device, so as to trigger a modem or an AP to search for a high-priority network.

In some embodiments, the processor <NUM> may include the AI module or an embedded neural-network processor (neural-network process units, NPU), and may be configured to record all records of each search for a high-priority network.

The technical solutions in the embodiments of this application may be applied to various communications systems, for example, a global system for mobile communications (Global System of Mobile Communication, GSM) system, a code division multiple access (Code Division Multiple Access, CDMA) system, a wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA) system, a general packet radio service (General Packet Radio Service, GPRS) system, a long term evolution (Long Term Evolution, LTE) system, an LTE frequency division duplex (Frequency Division Duplex, FDD) system, an LTE time division duplex (Time Division Duplex, TDD) system, a universal mobile telecommunications system (Universal Mobile Telecommunications System, UMTS), a worldwide interoperability for microwave access (Worldwide Interoperability for Microwave Access, WiMAX) communications system, a future <NUM>th generation (<NUM>th Generation, <NUM>) system, and a new radio (New Radio, NR) system.

Claim 1:
A method for searching for a high-priority network by a terminal device (<NUM>), wherein the terminal device comprises a Wi-Fi module, wherein the terminal device is connected to a first hotspot by using Wi-Fi and performs a data service, and the method comprises:
starting searching (<NUM>, <NUM>) for, by the terminal device, a high-priority network when the terminal device is disconnected from the first hotspot, wherein the terminal device stores a high-priority network list, and searching is performed in descending order of priorities in the high-priority network list;
characterized in that that the terminal device comprises an AI module and a modem module to determine a success probability of searching for a high-RAT network after Wi-Fi is disconnected;
wherein each time a different Wi-Fi hotspot is disconnected, the terminal device searches for a high-priority network, and records (<NUM>) the search result using the AI module;
wherein the recording (<NUM>) the search result includes a quantity of successful network searches, a quantity of failed network searches, and a network search success probability;
wherein searching (<NUM>, <NUM>) for a high-priority network is initiated based on the success probability, in a historical record, of successfully finding a high-priority network.