Network search method and electronic device
This disclosure provides network search methods and electronic devices. One method includes: A terminal device accesses a network of a first communications radio access technology (RAT), determines that a network anomaly occurs, where the network anomaly includes: no network or a fall into a lower RAT and searches for a network of a target communications RAT, where the target communications RAT is a communications RAT that is not lower than the first communications RAT; and the terminal device is connected to the network of the target communications RAT.
1 . A network search method, comprising:
accessing, by a terminal device, a network of a first communications radio access technology (RAT), wherein the terminal device is configured to perform wireless communications;
determining, by the terminal device, that a network anomaly occurs, wherein the network anomaly comprises: no network or a fall into a lower RAT;
detecting, by the terminal device based on currently collected data and a historical exit parameter, a second time point at which the terminal device has exited an underground garage, wherein the historical exit parameter comprises historical data collected by the terminal device to represent that the terminal device moves out of the underground garage, wherein the historical exit parameter comprises at least one of: an attitude angle of the terminal device indicating a specific climbing motion when exiting the underground garage, a curve of the attitude angle changing with time that corresponds to a garage exit pattern, a climbing start time point when the terminal device begins an upward movement pattern typical of garage exits, or collected cell information comprising cell identifiers and signal strength information detected when the terminal device historically moves out of the underground garage;
searching, by the terminal device, for a network of a target communications RAT at a first time point, wherein the target communications RAT is a communications RAT that is not lower than the first communications RAT; and
connecting, by the terminal device, to the network of the target communications RAT,
wherein the terminal device is in an underground garage scenario, the second time point is a time point at which the terminal device detects that it has exited an underground garage, and the first time point is a time point after the second time point at which the terminal device starts searching the network of the target communications RAT.
2 . The method according to claim 1 , wherein the terminal device is in a connected mode, and wherein the searching, by the terminal device, for a network of a target communications RAT comprises:
searching, by the terminal device, for a first cell, wherein a communications RAT of the first cell is the target communications RAT, a second cell is a neighboring cell of a third cell and configured by a network device, and the third cell is a cell connected to the terminal device when the terminal device falls into a lower RAT.
3 . The method according to claim 2 , wherein the first cell is a cell found by the terminal device in a legacy network search process.
4 . The method according to claim 1 , wherein the terminal device is in an idle mode, and wherein the searching, by the terminal device, for a network of a target communications RAT comprises:
searching, by the terminal device, for the network of the target communications RAT in every preset time interval.
5 . The method according to claim 1 , wherein the search for the network of the target communications RAT is performed after a first time interval after the second time point.
6 . The method according to claim 1 , wherein the search for the network of the target communications RAT is performed after a second time interval after the terminal device drops from a network or falls into a lower RAT.
7 . The method according to claim 1 , wherein before searching for the network of the target communications RAT, the method further comprises:
determining, by the terminal device, at least one target communications RAT based on the first communications RAT.
8 . The method according to claim 1 , wherein searching for the network of the target communications RAT comprises one of:
searching, by the terminal device, exclusively for the network of the target communications RAT;
searching, by the terminal device, for the network of the target communications RAT continuously for at least twice; or
searching, by the terminal device, for the network of the target communications RAT at a same frequency within a preset time period.
9 . The method according to claim 1 , wherein the search for the network of the target communications RAT starts before a historical time point at which the terminal device successfully accesses the network of the target communications RAT after the network anomaly occurs.
10 . The method according to claim 9 , wherein the search for the network of the target communications RAT starts between a historical maximum failure time point and a historical minimum success time point wherein the historical minimum success time point is an earliest historical moment at which the terminal device attempts to search for the network of the target communications RAT and successfully finds the network of the target communications RAT after the network anomaly occurs, wherein the historical maximum failure time point is a latest historical moment at which the terminal device attempts to search for the network of the target communications RAT and fails to find the network of the target communications RAT after the network anomaly occurs, wherein the historical minimum success time point is after the historical maximum failure time point and before the historical time point at which the terminal device successfully accesses the network of the target communications RAT, and wherein the historical maximum failure time point is after the terminal device is dropped from a network or falls into a lower RAT.
11 . The method according to claim 1 , wherein the method further comprises:
in response to detecting that the terminal device is currently located in a first fence corresponding to an underground garage, determining, by the terminal device, that the terminal device is underground; or
determining, based on motion data collected by the terminal device, that the terminal device is underground.
12 . The method according to claim 1 , wherein the cell information comprises at least one of cell identifier information, cell signal strength information, or cell signal strength change information, wherein the cell identifier information comprises cell identifiers that are of one or more cells and that are detected when the terminal device historically leaves the underground garage, the signal strength information comprises cell signal strengths that are of the one or more cells and that are detected when the terminal device historically leaves the underground garage, wherein the signal strength change information comprises a change value between a first signal strength and a second signal strength, wherein the first signal strength is a signal strength that is of a first cell and that is detected within a first preset time period before the terminal device historically leaves the underground garage, and wherein the second signal strength is a signal strength of the first cell and detected within a second preset time period after the terminal device historically leaves the underground garage;
determining, by the terminal device, a success time point at which the terminal device finds the network of the target communications RAT;
determining, by the terminal device, that a time difference between the historical minimum success time point and the historical maximum failure time point is greater than a threshold; and
updating, by the terminal device, the historical minimum success time point to the success time point.
13 . A terminal device configured to perform wireless communications, comprising:
one or more processors;
a memory; and
one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprise instructions for execution by the terminal device to perform operations comprising:
accessing a network of a first communications radio access technology (RAT);
determining that a network anomaly occurs, wherein the network anomaly comprises: no network or a fall into a lower RAT;
detecting, based on currently collected data and a historical exit parameter, a second time point at which the terminal device has exited an underground garage, wherein the historical exit parameter comprises historical data collected by the terminal device to represent that the terminal device moves out of the underground garage, wherein the historical exit parameter comprises at least one of: an attitude angle of the terminal device indicating a specific climbing motion when exiting the underground garage, a curve of the attitude angle changing with time that corresponds to a garage exit pattern, a climbing start time point when the terminal device begins an upward movement pattern typical of garage exits, or collected cell information comprising cell identifiers and signal strength information detected when the terminal device historically moves out of the underground garage;
searching for a network of a target communications RAT at a first time point, wherein the target communications RAT is a communications RAT that is not lower than the first communications RAT; and
connecting to the network of the target communications RAT,
wherein the terminal device is in an underground garage scenario, the second time point is a time point at which the terminal device detects that it has exited an underground garage, and the first time point is a time point after the second time point at which the terminal device starts searching the network of the target communications RAT.
14 . A chip, wherein the chip is coupled to a memory in a terminal device configured to perform wireless communications, and wherein the chip is configured to invoke a computer program stored in the memory to perform operations comprising:
accessing a network of a first communications radio access technology (RAT);
determining that a network anomaly occurs, wherein the network anomaly comprises: no network or a fall into a lower RAT;
detecting, based on currently collected data and a historical exit parameter, a second time point at which the terminal device has exited an underground garage, wherein the historical exit parameter comprises historical data collected by the terminal device to represent that the terminal device moves out of the underground garage, wherein the historical exit parameter comprises at least one of: an attitude angle of the terminal device indicating a specific climbing motion when exiting the underground garage, a curve of the attitude angle changing with time that corresponds to a garage exit pattern, a climbing start time point when the terminal device begins an upward movement pattern typical of garage exits, or collected cell information comprising cell identifiers and signal strength information detected when the terminal device historically moves out of the underground garage;
searching for a network of a target communications RAT at a first time point, wherein the target communications RAT is a communications RAT that is not lower than the first communications RAT; and
connecting to the network of the target communications RAT,
wherein the terminal device is in an underground garage scenario, the second time point is a time point at which the terminal device detects that it has exited an underground garage, and the first time point is a time point after the second time point at which the terminal device starts searching the network of the target communications RAT.
15 . The method according to claim 10 , wherein the search for the network of the target communications RAT starts between the historical maximum failure time point and the historical minimum success time point.
16 . The terminal device according to claim 13 , wherein the terminal device is in a connected mode, and wherein the searching for the network of the target communications RAT comprises:
searching for a first cell, wherein a communications RAT of the first cell is the target communications RAT, a second cell is a neighboring cell of a third cell and configured by a network device, and the third cell is a cell connected to the terminal device when the terminal device falls into a lower RAT.
17 . The terminal device according to claim 13 , wherein
the terminal device exits an underground garage at a first time point, and wherein the search for the network of the target communications RAT is performed after a first time interval after the first time point.
18 . The terminal device according to claim 13 , wherein the search for the network of the target communications RAT starts before a historical time point at which the terminal device successfully accesses the network of the target communications RAT after the network anomaly occurs.
19 . The terminal device according to claim 18 , wherein the search for the network of the target communications RAT starts between a historical maximum failure time point and a historical minimum success time point, wherein the historical minimum success time point is an earliest historical moment at which the terminal device attempts to search for the network of the target communications RAT and successfully finds the network of the target communications RAT after the network anomaly occurs, wherein the historical maximum failure time point is a latest historical moment at which the terminal device attempts to search for the network of the target communications RAT and fails to find the network of the target communications RAT after the network anomaly occurs, wherein the historical minimum success time point is after the historical maximum failure time point and before historical time point at which the terminal device successfully accesses the network of the target communications RAT, and wherein the historical maximum failure time point is after the terminal device is dropped from a network or falls into a lower RAT.
20 . The terminal device according to claim 13 , wherein the cell information comprises at least one of cell identifier information, cell signal strength information, or cell signal strength change information, wherein the cell identifier information comprises cell identifiers that are of one or more cells and that are detected when the terminal device historically leaves the underground garage, the signal strength information comprises cell signal strengths that are of the one or more cells and that are detected when the terminal device historically leaves the underground garage, wherein the signal strength change information comprises a change value between a first signal strength and a second signal strength, wherein the first signal strength is a signal strength that is of a first cell and that is detected within a first preset time period before the terminal device historically leaves the underground garage, and wherein the second signal strength is a signal strength of the first cell and detected within a second preset time period after the terminal device historically leaves the underground garage;
determining, by the terminal device, a success time point at which the terminal device finds the network of the target communications RAT;
determining, by the terminal device, that a time difference between the historical minimum success time point and the historical maximum failure time point is greater than a threshold; and
updating, by the terminal device, the historical minimum success time point to the success time point.