CN116347550A - Network switching method and electronic equipment - Google Patents

Network switching method and electronic equipment Download PDF

Info

Publication number
CN116347550A
CN116347550A CN202211736043.7A CN202211736043A CN116347550A CN 116347550 A CN116347550 A CN 116347550A CN 202211736043 A CN202211736043 A CN 202211736043A CN 116347550 A CN116347550 A CN 116347550A
Authority
CN
China
Prior art keywords
network
terminal device
wifi network
cellular network
terminal equipment
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.)
Granted
Application number
CN202211736043.7A
Other languages
Chinese (zh)
Other versions
CN116347550B (en
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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211736043.7A priority Critical patent/CN116347550B/en
Publication of CN116347550A publication Critical patent/CN116347550A/en
Application granted granted Critical
Publication of CN116347550B publication Critical patent/CN116347550B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/24Reselection being triggered by specific parameters
    • H04W36/30Reselection being triggered by specific parameters by measured or perceived connection quality data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • H04W36/14Reselecting a network or an air interface
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The embodiment of the application provides a network switching method and electronic equipment, and relates to the technical field of terminals. The method comprises the following steps: the terminal equipment identifies a code scanning action under the condition of accessing a WiFi network; the terminal equipment acquires WiFi network quality parameters in a first preset time period before the code scanning action is identified; when the WiFi network quality parameter does not meet the first preset condition, the terminal equipment is switched to the cellular network meeting the second preset condition; the terminal device performs a code scanning procedure in the cellular network. Therefore, when the WiFi network is accessed but the quality of the WiFi network is poor, the terminal equipment can be quickly switched to the cellular network, and the cellular network is used for completing the code scanning process, so that the use experience of a user is improved.

Description

Network switching method and electronic equipment
Technical Field
The present disclosure relates to the field of terminal technologies, and in particular, to a network switching method and an electronic device.
Background
With the development of terminal technology, the user uses terminal equipment to scan codes more and more widely, for example: the user can use the payment application of the terminal equipment to scan the payment code/collection code to complete payment transaction, the user can also use the social application of the terminal equipment to scan the personal two-dimensional code to add social friends, pay attention to public numbers and the like, and the user can also use the terminal equipment to perform activities such as code scanning, ordering, shopping and the like.
The terminal device may perform a code scanning operation when a wireless fidelity (Wireless Fidelity, wiFi) and/or cellular network is connected. And under the condition that the terminal equipment is connected with WiFi but the quality of the WiFi network is poor, the terminal equipment can possibly generate a switching process from the WiFi network to the cellular network when the code scanning is initiated. The network switching process consumes longer time, so that the code scanning time is prolonged, and the experience of a user when using the code scanning function is poor.
Disclosure of Invention
The embodiment of the application provides a network switching method and electronic equipment, which are applied to the technical field of terminals, and are characterized in that when the terminal equipment is connected to a WiFi network but the quality of the WiFi network is poor, the terminal equipment is quickly switched to a cellular network with better network quality, a code scanning flow is completed by using the cellular network, the switching time from the WiFi network to the cellular network is shortened, the smoothness of the code scanning flow executed by the terminal equipment is improved, and the use experience of a user is further improved.
In a first aspect, an embodiment of the present application provides a network switching method. The method comprises the following steps: the terminal equipment identifies a code scanning action under the condition of accessing a WiFi network; the terminal equipment acquires WiFi network quality parameters in a first preset time period before the code scanning action is identified; when the WiFi network quality parameter does not meet the first preset condition, the terminal equipment is switched to the cellular network meeting the second preset condition; the terminal device performs a code scanning procedure in the cellular network. Therefore, the terminal equipment can rapidly judge whether the WiFi network quality parameters meet the first preset conditions by using the recent WiFi network quality parameters, the time for measuring the WiFi network quality parameters is shortened, the time for switching the terminal equipment from the WiFi network to the cellular network is further shortened, and the code scanning experience of a user is improved.
In one possible implementation, the WiFi network quality parameters include: the signal strength of the WiFi network, the link quality of the WiFi network and/or the network fluency of the terminal equipment running the code scanning application. Therefore, the terminal equipment can judge the quality of the WiFi network in multiple dimensions so as to determine the quality condition of the current WiFi network, and accuracy is improved.
In one possible implementation, the signal strength of the WiFi network is related to the number of signal formats of the WiFi network; the link quality of the WiFi network is related to the channel busy rate, the packet sending delay, the channel Round Trip Time (RTT), the uplink and downlink rates and/or the packet sending failure rate of the WiFi network; the network fluency of the terminal equipment running the code scanning application is related to the uplink and downlink Transmission Control Protocol (TCP) flow, the uplink and downlink retransmission rate and/or the uplink and downlink acknowledgement character repetition rate; the first preset condition is not satisfied by the WiFi network quality parameter, including at least one of the following: the signal lattice number of the WiFi network is smaller than a first preset value, the channel busy rate of the WiFi network is larger than a second preset value, the packet sending delay of the WiFi network is larger than a third preset value, the channel detection RTT of the WiFi network is larger than a fourth preset value, the uplink and downlink speed of the WiFi network is smaller than a fifth preset value, the packet sending failure rate of the WiFi network is larger than a sixth preset value, the TCP stream of an uplink and downlink transmission control protocol is unstable, the uplink and downlink retransmission rate is larger than a seventh preset value and/or the uplink and downlink acknowledgement character repetition rate is larger than an eighth preset value. Therefore, the terminal equipment can accurately judge the quality condition of the WiFi network according to the parameters.
In one possible implementation, the terminal device includes a perception module and a decision module; before recognizing the code scanning action under the condition of accessing the WiFi network, the terminal equipment comprises the following steps: the sensing module periodically detects the quality parameters of the WiFi network and reports the quality parameters of the WiFi network to the decision module; the terminal equipment identifies a code scanning action under the condition of accessing a WiFi network, and comprises the following steps: the sensing module recognizes a code scanning action; the terminal equipment acquires WiFi network quality parameters in a first preset time period before the code scanning action is identified, and the method comprises the following steps: the decision module obtains an instruction from the perception module, which is used for indicating the decision module to judge the quality condition of the WiFi network; the decision module obtains the WiFi network quality parameters in a first preset time before the current moment. In this way, the terminal device can start to execute the network switching flow after recognizing the code scanning action.
In one possible implementation, the sensing module identifies a code sweeping action, including: the perception module recognizes that a first activity of the terminal device invokes a camera application. In this way, the terminal device can determine whether to start executing the network handover procedure based on the first activity.
In one possible implementation, before the sensing module recognizes that the first activity of the terminal device invokes the camera application, the method further includes: the terminal equipment receives triggering operation for instructing the terminal equipment to scan the scannable code; in response to the triggering operation, the terminal device initiates a first activity. In this way, the subsequent terminal device may determine whether to start performing the network handover procedure based on the first activity.
Wherein the triggering operation for instructing the terminal device to scan the scannable code may correspond to a triggering operation for the code scanning button 301 in the interface shown in a in fig. 3.
In one possible implementation, the terminal device performs a code scanning procedure in a cellular network, including: the terminal equipment switches the data stream of the code scanning application to a cellular network; the camera application of the terminal equipment uses the cellular network to finish scanning the scannable code; the method further comprises the steps of: the terminal device displays an interface of the scannable code link. In this way, the terminal device can use the cellular network to execute the code scanning flow, so that the smoothness of the terminal device when executing the code scanning flow is improved.
Wherein the scannable code may correspond to the image 304 of the scannable code in the interface shown in c in fig. 3; the interface of the scannable code link may correspond to the interface shown as d in fig. 3.
In one possible implementation, the cellular network satisfying the second preset condition includes: a cellular network pre-marked with a first identity by a terminal device; or the cellular network which can be accessed and is detected by the terminal equipment; wherein the first identity is used to characterize that the terminal device is capable of handover to the cellular network. In this way, when the cellular network is marked with the first identifier, the terminal device can quickly switch to the cellular network; alternatively, the terminal device may perform a handover to a cellular network with better network quality.
In one possible implementation, the terminal device remains active after the terminal device marks the first identity for the cellular network. In this way, the time for the terminal equipment to activate the cellular network is reduced, and the efficiency of network switching is improved.
In one possible implementation manner, the terminal device switches to the cellular network that satisfies the second preset condition, and further includes: the terminal equipment is converted into an active state from an idle state; the terminal equipment sends N times of data packets to the detection server by using a cellular network; the terminal equipment calculates the channel quality of the cellular network based on the detection result returned by the detection server; when the channel quality of the cellular network meets the channel quality requirement, the terminal equipment is switched from the WiFi network to the cellular network. In this way, the terminal equipment can switch to the cellular network with good network quality, and the smoothness of the code scanning flow executed by the terminal equipment is improved.
In one possible implementation, N is 1. In this way, the terminal device can reduce the detection times and the detection duration of the terminal device on the channel quality of the cellular network.
In one possible implementation, the cellular network channel quality includes an RTT value for the cellular network; the cellular network which is detected by the terminal equipment and can be accessed comprises: the RTT value of the cellular network is smaller than the ninth preset value. In this way, the terminal device may determine the channel quality of the cellular network based on the RTT value.
In a second aspect, embodiments of the present application provide a terminal device, which may also be referred to as a terminal (terminal), a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), or the like. The terminal device may be a mobile phone, a smart television, a wearable device, a tablet (Pad), a computer with wireless transceiving function, a Virtual Reality (VR) terminal device, an augmented reality (augmented reality, AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in unmanned driving (self-driving), a wireless terminal in teleoperation (remote medical surgery), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), or the like.
The terminal device includes: comprising the following steps: a processor and a memory; the memory stores computer-executable instructions; the processor executes computer-executable instructions stored in the memory to cause the terminal device to perform a method as in the first aspect.
In a third aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program. The computer program, when executed by a processor, implements a method as in the first aspect.
In a fourth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when run, causes a computer to perform the method as in the first aspect.
In a fifth aspect, embodiments of the present application provide a chip comprising a processor for invoking a computer program in a memory to perform a method as in the first aspect.
It should be understood that, the second aspect to the fifth aspect of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects obtained by each aspect and the corresponding possible embodiments are similar, and are not repeated.
Drawings
Fig. 1 is a schematic structural diagram of a terminal device 100 provided in an embodiment of the present application;
fig. 2 is a software architecture block diagram of a terminal device 100 provided in an embodiment of the present application;
fig. 3 is an interface schematic diagram of a network switching method according to an embodiment of the present application;
fig. 4 is a flow chart of a network switching method according to an embodiment of the present application;
fig. 5 is a flow chart of a network switching method according to an embodiment of the present application;
fig. 6 is a flow chart of a network switching method according to an embodiment of the present application;
Fig. 7 is a flow chart of a network switching method according to an embodiment of the present application;
fig. 8 is an internal interaction flow chart of a terminal device provided in an embodiment of the present application;
fig. 9 is an internal interaction flow chart of a terminal device provided in an embodiment of the present application;
fig. 10 is a schematic structural diagram of a network switching device according to an embodiment of the present application.
Detailed Description
In order to facilitate the clear description of the technical solutions of the embodiments of the present application, the following simply describes some terms and techniques related to the embodiments of the present application:
1) Wireless fidelity (wireless fidelity, wiFi): is a wireless network technology, which can connect a personal computer, a handheld device (such as iPad, mobile phone) and other terminal devices to a wireless local area network (wireless local area network, WLAN).
2) Cellular network (cellular network): a mobile network (mobile network) is a mobile communication hardware architecture, and the signal coverage of each communication base station constituting the network coverage is hexagonal, so that the whole network looks like a cell. Common cellular network types are: global system for mobile communications (global system for mobile communication, GSM) networks, code division multiple access (code division multiple access, CDMA) networks, 3G networks, frequency division multiple access (frequency division multiple access, FDMA), time division multiple access (time division multiple access, TDMA), personal digital cellular (personal digital cellular, PDC), total network access communication systems (total access communications system, TACS), advanced mobile phone systems (advanced mobile phone system, AMPS), and the like.
3) Round-trip time (RTT): refers to the time required for data to pass from one end of the network to the other and for the receiving end to acknowledge. In general, the delay may be composed of four parts, namely, a transmission delay, a propagation delay, a queuing delay and a processing delay.
4) Transmission control protocol (transmission control protocol, TCP): is a connection-oriented, reliable, byte stream based transport layer protocol.
For purposes of clarity in describing the embodiments of the present application, in the embodiments of the present application, words such as "exemplary" or "such as" are used to indicate by way of example, illustration, or description. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
The term "at … …" in the embodiment of the present application may be instantaneous when a certain situation occurs, or may be a period of time after a certain situation occurs, which is not particularly limited in the embodiment of the present application. In addition, the display interface provided in the embodiments of the present application is merely an example, and the display interface may further include more or less content.
With the development of terminal technology, the user uses terminal equipment to scan codes more and more widely, for example: the user can use the payment application of the terminal equipment to scan the payment code/collection code to complete payment transaction, the user can also use the social application of the terminal equipment to scan the personal two-dimensional code to add social friends, pay attention to public numbers and the like, and the user can also use the terminal equipment to perform activities such as code scanning, ordering, shopping and the like.
The terminal device may perform a code scanning operation when a wireless fidelity (Wireless Fidelity, wiFi) and/or cellular network is connected. And under the condition that the terminal equipment is connected with WiFi but the quality of the WiFi network is poor, the terminal equipment can possibly generate a switching process from the WiFi network to the cellular network when the code scanning is initiated. The network switching process consumes longer time, so that the code scanning time is prolonged, and the experience of a user when using the code scanning function is poor.
This is because, in a possible implementation, the terminal device is connected to a WiFi network, but the quality of the WiFi network is poor, the terminal device starts the code scanning application and scans the scannable code using the code scanning application. After the terminal equipment recognizes the code scanning action, the terminal equipment monitors the WiFi network quality for a period of time and judges whether the current WiFi network quality can support the terminal equipment to finish the code scanning flow, and the duration of the process is between 1s and 2 s.
The terminal device determines that the quality of the WiFi network is poor, and before the terminal device switches from the WiFi network to the cellular network, the terminal device activates the cellular network and then detects the channel quality of the cellular network. The terminal equipment is in an activated state, and when the terminal equipment and a base station of the cellular network have no service interaction, the terminal equipment can be converted into an idle state from the activated state, so that in a possible implementation, the terminal equipment needs to activate the cellular network when switching from the WiFi network to the cellular network. And the process of activating the cellular network may take some time.
In addition, when the terminal equipment detects the cellular network for many times, the cellular network is used to send multiple groups of data to multiple detection servers, and data such as packet loss rate, packet error rate and the like are calculated, so that the process takes a long time. Therefore, in a possible implementation, the process of switching the terminal device from the WiFi network to the cellular network takes a long time, resulting in poor user experience in code scanning.
In view of this, the embodiment of the application provides a network switching method, where a terminal device accesses a WiFi network; after recognizing the code scanning action, the terminal equipment acquires the WiFi network quality within a period of time before the code scanning action occurs; the terminal equipment keeps an activated state, and if the WiFi network quality is poor, the terminal equipment detects the channel quality of the cellular network once by using the activated cellular network; and when the channel quality of the cellular network meets the channel quality requirement, executing the flow of switching to the cellular network. In this way, the terminal equipment determines whether to switch to the cellular network according to the recent WiFi network quality parameters, so that the time for monitoring the WiFi network quality is reduced; meanwhile, the time for activating the cellular network is shortened, the detection times are reduced, and the overall time for switching the terminal equipment from the WiFi network to the cellular network is shortened, so that the code scanning use experience of a user is improved.
In this embodiment of the present application, the terminal device may also be referred to as a terminal (terminal), a User Equipment (UE), a Mobile Station (MS), a Mobile Terminal (MT), and so on. The terminal device may be a mobile phone, a smart television, a wearable device, a tablet (Pad), a computer with wireless transceiving function, a Virtual Reality (VR) terminal device, an augmented reality (augmented reality, AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in unmanned driving (self-driving), a wireless terminal in teleoperation (remote medical surgery), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation security (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), or the like.
The wearable device can also be called as a wearable intelligent device, and is a generic name for intelligently designing daily wearing and developing wearable devices by applying a wearable technology, such as glasses, gloves, watches, clothes, shoes and the like. The wearable device is a portable device that is worn directly on the body or integrated into the clothing or accessories of the user. The wearable device is not only a hardware device, but also can realize a powerful function through software support, data interaction and cloud interaction. The generalized wearable intelligent device includes full functionality, large size, and may not rely on the smart phone to implement complete or partial functionality, such as: smart watches or smart glasses, etc., and focus on only certain types of application functions, and need to be used in combination with other devices, such as smart phones, for example, various smart bracelets, smart jewelry, etc. for physical sign monitoring.
In addition, in the embodiment of the application, the terminal device may also be a terminal device in an internet of things (internet of things, ioT) system, and the IoT is an important component of future information technology development, and the main technical characteristic of the terminal device is that the article is connected with a network through a communication technology, so that an intelligent network for man-machine interconnection and internet of things interconnection is realized. The embodiment of the application does not limit the specific technology and the specific equipment form adopted by the terminal equipment.
In the embodiment of the application, the terminal equipment may include a hardware layer, an operating system layer running above the hardware layer, and an application layer running above the operating system layer. The hardware layer includes hardware such as a central processing unit (central processing unit, CPU), a memory management unit (memory management unit, MMU), and a memory (also referred to as a main memory). The operating system may be any one or more computer operating systems that implement business processes through processes (processes), such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a windows operating system. The application layer comprises applications such as a browser, an address book, word processing software, instant messaging software and the like.
In order to better understand the embodiments of the present application, the following describes the structure of the terminal device in the embodiments of the present application:
fig. 1 shows a schematic structure of a terminal device 100. The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriberidentification module, SIM) card interface 195, etc.
The sensor module 180 may include, among other things, a pressure sensor, a gyroscope sensor, a barometric sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, terminal device 100 may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processingunit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it may be called from memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuitsound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is a schematic illustration, and does not constitute a structural limitation of the terminal device 100. In other embodiments of the present application, the terminal device 100 may also use different interfacing manners, or a combination of multiple interfacing manners in the foregoing embodiments.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters.
The wireless communication function of the terminal device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. The antennas in the terminal device 100 may be used to cover single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into 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 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the terminal device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the 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 transmits the demodulated low frequency baseband signal to the 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 sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. 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 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wirelesslocal area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., applied to the terminal device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of terminal device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that terminal device 100 may communicate with a network and other devices via wireless communication techniques. Wireless communication techniques may include global system for mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (codedivision multiple access, CDMA), wideband code division multiple access (wideband code division multipleaccess, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidounavigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellitesystem, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The terminal device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrixorganic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot lightemitting diodes, QLED), or the like. In some embodiments, the terminal device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The terminal device 100 may implement a photographing function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, so that the electrical signal is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the terminal device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to realize expansion of the memory capability of the terminal device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer-executable program code that includes instructions. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data (such as audio data, phonebook, etc.) created during use of the terminal device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The processor 110 performs various functional applications of the terminal device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The terminal device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
Illustratively, the terminal device 100 may also include one or more of a key 190, a motor 191, an indicator 192, a SIM card interface 195 (eSIM card), and the like.
The software system of the terminal device 100 may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. In this embodiment, taking an Android system with a layered architecture as an example, a software structure of the terminal device 100 is illustrated. Fig. 2 is a software configuration block diagram of the terminal device 100 of the embodiment of the present application.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages.
As shown in fig. 2, the application packages may include applications such as cameras, calendars, phones, maps, music, settings, mailboxes, video, and code scanning applications.
The code scanning application is an application program supporting the code scanning scannable code function, for example, the code scanning application can be an application program such as a social application, a shopping application and a payment application.
The application framework layer provides APIs and programming frameworks for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layer may include a window manager, a content provider, a resource manager, a notification manager, an activity manager, a perception module, a decision module, an execution module, and the like.
A perception module having the ability to perceive an external fact or environment. For example, in the embodiment of the present application, the sensing module may be configured to periodically monitor a quality parameter of the WiFi network, identify a trigger operation for instructing the terminal device to scan the scannable code, obtain a detection result of the cellular network, and synchronize a corresponding instruction to the decision module.
And the decision module is used for executing the steps related to the decision. For example, in the embodiment of the present application, the decision module may be configured to determine whether the WiFi network quality parameter meets a first preset condition, determine whether the state of the terminal device is active, determine whether the cellular network channel quality meets a channel quality requirement, and instruct the execution module to execute the subsequent steps when the determination result meets the determination condition.
And the execution module is used for executing the flow of switching from the WiFi network to the cellular network according to the judging result of the decision module. For example, in embodiments of the present application, the execution module may be configured to activate the cellular network, detect cellular network channel quality, and switch the data flow of the code scanning application onto the cellular network, etc.
The window manager is used for managing window programs. The window manager may obtain the display screen size, determine if there is a status bar, lock the screen, touch the screen, drag the screen, intercept the screen, etc.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, 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, a text message is prompted in a status bar, a prompt tone is emitted, the terminal equipment vibrates, and an indicator light blinks.
The activity manager is used for managing activity-related transactions such as start, state, life cycle of an application. Wherein activity is an application component that can provide an interface for a user to interact with a terminal device through the interface, thereby completing a task.
Android runtimes include core libraries and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of 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. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and 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.
The kernel layer is a layer between hardware and software. The kernel layer may contain display drivers, camera drivers, audio drivers, sensor drivers, etc.
The network switching method provided in the embodiments of the present application is described in detail below with reference to the accompanying drawings. The term "at … …" in the embodiment of the present application may be instantaneous when a certain situation occurs, or may be a period of time after a certain situation occurs, which is not particularly limited in the embodiment of the present application.
The network switching method provided in the embodiment of the present application may be applied to the scenario shown in fig. 3, and fig. 3 is an interface schematic diagram of the network switching method provided in the embodiment of the present application, where fig. 3 shows:
in some embodiments, where the terminal device accesses a WiFi network, the user may have a need to scan for scannable codes using the terminal device. The user clicks the code scanning application in the terminal device, and the terminal device starts the code scanning application and displays the interface shown by a in fig. 3, for example, the code scanning application can be a social application, a payment application, a shopping application and the like. Taking the code scanning application as an example of the payment application, in an interface a shown in fig. 3, a terminal device displays a code scanning button 301, a signal number 302 of a WiFi network, and a signal number 303 of a cellular network, where the code scanning button 301 is used to instruct the terminal device to execute a code scanning flow; the signal grid number 302 of the WiFi network is used for representing that the quality of the WiFi network is poor in the current environment; the number of signal cells 303 of the cellular network is used to characterize that the cellular network is of better quality in the current environment.
In the interface shown in a in fig. 3, the terminal device receives a trigger operation for the code scanning button 301, and in response to the trigger operation for the code scanning button 301, the terminal device starts a camera application and enters the interface shown in b in fig. 3. In the interface shown in b of fig. 3, the terminal device displays the number of signal formats 302 of the WiFi network. It should be noted that, in the embodiment of the present application, when the camera application is started, the terminal device may identify the code scanning action and execute the network switching method in the embodiment of the present application. After the camera application is started, the terminal equipment can be switched from a WiFi network with poor network quality to a cellular network with good network quality, so that the cellular network is used for completing the code scanning flow.
After the terminal device switches to the cellular network, the terminal device may display the interface shown at c in fig. 3. In the interface shown in fig. 3 c, the terminal device displays an image 304 of the scannable code, the number of signal cells 302 of the WiFi network, and the number of signal cells 304 of the cellular network; the image 304 of the scannable code may be an image acquired by a camera of the terminal device, or may be an image read by the terminal device from an album application (or gallery application), which is not limited in the embodiment of the present application.
It can be understood that, in order to conveniently embody the network switching method provided in the embodiment of the present application, in the interface shown in b in fig. 3 and the interface shown in c in fig. 3, the terminal device displays a status bar, where the status bar may include the number of signal cells of the cellular network and/or the number of signal cells of the WiFi network. In some embodiments, the terminal device may not display the status bar after the terminal device launches the camera application.
In the embodiment of the present application, the interface shown in c in fig. 3 displays the number of signal cells 302 of the WiFi network and the number of signal cells 303 of the cellular network. However, in the practical application scenario, the terminal device displays the number of signal frames of the WiFi network, but the terminal device has been switched from the WiFi network to the cellular network, and the terminal device uses the cellular network to perform the code scanning flow shown as c in fig. 3.
In the interface shown in fig. 3 c, the terminal device scans the image 304 of the scannable code. After a period of time, the terminal device may display the interface shown as d in fig. 3. In the interface shown in d in fig. 3, the terminal device displays an interface linked by a scannable code, for example, the scannable code is a payment code, and the interface shown in d in fig. 3 displayed by the terminal device may be an interface for a user to pay to a merchant. At this time, the terminal device performs the code scanning process using the switched cellular network.
It should be noted that, the network switching method provided in the embodiment of the present application may be applicable to various code scanning scenarios, for example: the user uses the terminal equipment to scan the commodity code to check commodity information; the user uses the terminal equipment to scan and present health codes, place codes and the like; and the user uses the terminal equipment to scan the personal two-dimension code to add friends and the like. Fig. 3 in the embodiment of the present application shows an application scenario of a network switching method by way of example only, but the application scenario does not limit the network switching method in the embodiment of the present application.
The above embodiments describe the network switching method in the embodiments of the present application in conjunction with application scenarios, and the flow of the network switching method in the embodiments of the present application is described below in conjunction with fig. 4 to 9.
Exemplary, S401, the terminal device identifies a code scanning action when accessing to the WiFi network.
The code scanning action can be understood as follows: when the terminal device receives a trigger operation for a code-scanning button (for example, the code-scanning button 301 in the interface a shown in fig. 3) in the code-scanning application, the terminal device starts the camera application. In the embodiment of the application, the action of starting the camera application can be used as the code scanning action, and when the terminal equipment recognizes that the camera application is started, the code scanning action is determined to be generated.
Under the condition of accessing the WiFi network, the user can use the terminal equipment to execute the code scanning operation. When the terminal equipment identifies the code scanning action, the terminal equipment can execute the network switching method provided by the embodiment of the application.
S402, the terminal equipment acquires WiFi network quality parameters in a first preset time period before the code scanning action is identified.
The WiFi network quality parameter is used for representing the quality condition of the WiFi network, wherein the WiFi network quality parameter comprises the following components: the signal strength of the WiFi network, the link quality of the WiFi network and/or the network fluency of the terminal equipment running the code scanning application.
After the terminal equipment is accessed to the WiFi network, the terminal equipment can monitor the quality condition of the WiFi network periodically and continuously, and the quality parameters of the WiFi network are recorded. After the terminal device recognizes the code sweeping action, the terminal device may use the recent WiFi network quality parameters to characterize the current WiFi network quality condition. The terminal device may obtain a WiFi network quality parameter within a first preset duration before the code scanning action is identified; the first preset duration may be set in a user-defined manner, for example, the first preset duration is 10s.
After the terminal equipment recognizes the code scanning action, the terminal equipment can acquire the WiFi network quality parameters monitored by the terminal equipment in the first 10 seconds to judge the WiFi network quality condition.
And S403, when the WiFi network quality parameter does not meet the first preset condition, the terminal equipment is switched to the cellular network meeting the second preset condition.
The first preset condition is used for representing that the quality of the WiFi network is better, and the WiFi network can support the terminal equipment to finish the code scanning flow. When the quality parameter of the WiFi network does not meet the first preset condition, the WiFi network may not support the user to smoothly complete the code scanning process using the terminal device, thereby affecting the code scanning experience of the user. At this time, the terminal device needs to switch to the cellular network with better network quality to complete the code scanning flow.
The second preset condition is used for representing that the cellular network has better quality, and the cellular network can support the terminal equipment to finish the code scanning flow. The cellular network satisfying the second preset condition includes: a cellular network pre-marked with a first identity by a terminal device; or the cellular network which can be accessed and is detected by the terminal equipment; wherein the first identity is used to characterize that the terminal device is capable of handover to the cellular network. And under the condition that the WiFi network quality is poor, the terminal equipment can be switched from the WiFi network to the cellular network meeting the second preset condition.
S404, the terminal equipment executes a code scanning flow in the cellular network.
After the terminal device accesses the cellular network, the terminal device can switch the data stream of the code scanning application to the cellular network. The camera application of the terminal device performs scanning of the scannable code using the cellular network. For example, as shown in interface c in fig. 3, the terminal device switches to the cellular network and the camera application of the terminal device scans the image 304 of the scannable code. The terminal device displays an interface of the scannable code link, as indicated by d in fig. 3.
According to the network switching method, the terminal equipment is used for identifying the code scanning action under the condition of accessing the WiFi network; the terminal equipment acquires WiFi network quality parameters in a first preset time period before the code scanning action is identified; when the WiFi network quality parameter does not meet the first preset condition, the terminal equipment is switched to the cellular network meeting the second preset condition; the terminal device performs a code scanning procedure in the cellular network. Therefore, the terminal equipment can rapidly judge whether the WiFi network quality parameters meet the first preset conditions by using the recent WiFi network quality parameters, the time for measuring the WiFi network quality parameters is shortened, the time for switching the terminal equipment from the WiFi network to the cellular network is further shortened, and the code scanning experience of a user is improved.
The following describes the above embodiments in detail with reference to fig. 5, and fig. 5 shows a flow chart of a network switching method according to an embodiment of the present application. As shown in fig. 5:
s501, the terminal equipment receives a trigger operation for instructing the terminal equipment to scan the scannable code.
The trigger operation for instructing the terminal device to scan the scannable code may be a trigger operation for the code scanning button 301 in the interface shown in a in fig. 3.
S502, responding to a triggering operation, and enabling the terminal equipment to start a first activity.
The first activity is for pulling up a camera application of the terminal device in accordance with a trigger operation for instructing the terminal device to scan the scannable code. The first activity may be a specific activity.
S503, the terminal device recognizes that the first activity of the terminal device calls the camera application.
The terminal device may determine to generate a code-sweeping action upon recognizing that the first activity evokes the camera application. The terminal device starts to determine the quality status of the WiFi network in steps S504-S507.
S504, the terminal equipment acquires WiFi network quality parameters in a first preset time period before the code scanning action is identified.
The WiFi network quality parameters include: the signal strength of the WiFi network, the link quality of the WiFi network and/or the network fluency of the terminal equipment running the code scanning application. The terminal device may determine a WiFi network quality condition according to recent WiFi network quality parameters.
S505, the terminal equipment judges whether the signal strength of the WiFi network meets a certain condition according to the quality parameters of the WiFi network.
Illustratively, the signal strength of the WiFi network is related to the number of signal formats of the WiFi network; the terminal equipment acquires the number of signal grids of the WiFi network in a first preset time period before the code scanning action is identified. When the number of signal grids of the WiFi network is greater than or equal to a first preset value, the terminal device may determine that the signal strength of the WiFi network is better, where the first preset value may be 4. When the number of signal frames of the WiFi network is greater than or equal to 4 frames, the terminal device may continue to determine other dimensions of the quality parameters of the WiFi network, as shown in steps S506-S507.
When the number of signal grids of the WiFi network is smaller than the first preset value, the quality parameter of the WiFi network does not meet the first preset condition, the terminal device determines that the quality of the WiFi network is poor, and the terminal device may execute the network switching method provided by the embodiment of the present application, as shown in step S508.
S506, the terminal equipment judges whether the link quality of the WiFi network meets a certain condition according to the WiFi network quality parameter.
The link quality of a WiFi network is illustratively related to the channel busy rate, packet transmission delay, channel round trip delay RTT, uplink and downlink rates, and/or packet transmission failure rate of the WiFi network.
It may be appreciated that, in some embodiments, the WiFi network to which the terminal device may access is a public WiFi network, and the terminal device determines that the signal strength of the WiFi network is better after the determining procedure in step S505. But when more other devices are connected to the WiFi network, the WiFi network resources are preempted among the devices, and the link quality of the terminal device held by the user when using the WiFi network is poor. At this time, the WiFi network may not support the terminal device to smoothly perform the code scanning process.
For the above scenario, the terminal device may obtain parameters such as a channel busy rate, a packet sending delay, a channel round trip time RTT, an uplink and downlink rate, and/or a packet sending failure rate of the WiFi network within a first preset duration before identifying the code scanning action, and determine link quality of the WiFi network according to the parameters.
For example, when the channel busy rate of the WiFi network is less than or equal to a second preset value, the packet transmission delay of the WiFi network is less than or equal to a third preset value, the channel probing RTT of the WiFi network is less than or equal to a fourth preset value, the uplink and downlink rates of the WiFi network are greater than or equal to a fifth preset value, and the packet transmission failure rate of the WiFi network is less than or equal to a sixth preset value, the terminal device may determine that the link quality of the WiFi network is better; the second preset value-the sixth preset value are related to the frequency band where the WiFi network is located, and may be set in a self-defined manner, which is not limited in the embodiment of the present application. The terminal device may continue to determine other dimensions of the WiFi network quality parameter, as shown in step S507.
It will be appreciated that the parameters of the link quality of the WiFi network may be one or more of the above parameters, or may be other parameters used to characterize the link quality of the WiFi network. The embodiments of the present application are not limited in this regard.
Or when the channel busy rate of the WiFi network is greater than the second preset value, the packet sending delay of the data packet of the WiFi network is greater than the third preset value, the channel detection RTT of the WiFi network is greater than the fourth preset value, the uplink and downlink rates of the WiFi network are less than the fifth preset value, the packet failure rate of the WiFi network is greater than the sixth preset value, the quality parameter of the WiFi network does not meet the first preset condition, the terminal device determines that the quality of the WiFi network is poor, and the terminal device can execute the network switching method provided by the embodiment of the present application, as shown in step S508.
S507, the terminal equipment judges whether the network fluency of the terminal equipment running the code scanning application meets a certain condition according to the WiFi network quality parameter.
The network fluency of the terminal device running the code scanning application is related to the uplink and downlink transmission control protocol TCP flow, the uplink and downlink retransmission rate and/or the uplink and downlink acknowledgement character repetition rate.
When the uplink and downlink Transmission Control Protocol (TCP) flow stably exists, the uplink and downlink retransmission rate is smaller than or equal to a seventh preset value and/or the uplink and downlink acknowledgement character repetition rate is smaller than or equal to an eighth preset value, the terminal equipment can determine that the network smoothness of the terminal equipment running the code scanning application is higher; the seventh preset value and the eighth preset value can be set in a self-defined manner, which is not limited in the embodiment of the present application. At this time, the terminal equipment determines that the quality of the WiFi network is better, and the terminal equipment does not need to switch the WiFi network to the cellular network.
Or when the uplink and downlink transmission control protocol TCP flows are unstable, and the uplink and downlink retransmission rate is greater than the seventh preset value and/or the uplink and downlink acknowledgement character repetition rate is greater than the eighth preset value, the quality parameter of the WiFi network does not meet the first preset condition, the terminal device needs to switch the WiFi network to the cellular network, and the terminal device may execute step S508.
It may be understood that the parameter for characterizing the network fluency of the terminal device running the code scanning application may be one or more of the above parameters, or may be another parameter for characterizing the network fluency of the terminal device running the code scanning application. The embodiments of the present application are not limited in this regard.
It should be noted that, after executing steps S505 to S507, the terminal device may determine whether network handover is required according to the determination result. The above embodiment describes the method for determining the quality of the WiFi network according to the embodiment of the present application, taking the terminal device to sequentially execute steps S505 to S507 as an example. In an actual scenario, the terminal device may determine the quality of the WiFi network by combining any one or more of steps S505 to S507, and the embodiment of the present application does not limit the sequence of any step, for example, the terminal device may sequentially execute steps S505 to S507 in any sequence, or may simultaneously execute steps S505 to S507.
And S508, when the WiFi network quality parameter does not meet the first preset condition, the terminal equipment is switched to the cellular network meeting the second preset condition.
Step S508 may refer to the related description of step S403, which is not described herein.
According to the network switching method, the plurality of WiFi network quality parameters in the first preset time period before the code scanning action is identified are obtained, and whether any WiFi network quality parameter does not meet the first preset condition is judged; if yes, the terminal equipment is switched to the cellular network meeting the second preset condition. In this way, the terminal device can rapidly judge the quality condition of the WiFi network based on the data of the recent WiFi network quality parameters; meanwhile, the comprehensive WiFi network quality judging method improves accuracy of judging results.
The above embodiment describes a method for determining the quality of the WiFi network in the embodiment of the present application, and the following describes a procedure for switching the terminal device from the WiFi network to the cellular network with reference to fig. 6. Fig. 6 shows a flow chart of a network switching method according to an embodiment of the present application, as shown in fig. 6:
for example, the quality of the WiFi network accessed by the terminal device is poor, and the terminal device may execute a procedure of switching to the cellular network.
S601, the terminal equipment judges whether the terminal equipment is in an activated state or not.
The terminal device needs to be in an active state to interact with the base station of the cellular network. In a possible implementation manner, before performing the code scanning procedure according to the embodiment of the present application, the terminal device may perform other procedures using the cellular network, and the terminal device activates the cellular network based on the other procedures. The terminal device may remain active.
When the terminal device finishes steps S505-S507, the terminal device may determine whether a WiFi network needs to be handed over to the cellular network. If so, the terminal device determines the state of the terminal device, wherein the state of the terminal device may include an active state and an idle state. If the terminal device is in an active state, the terminal device executes step S602; if the terminal device is in the idle state, the terminal device performs step S603.
S602, the terminal device determines that the cellular network is pre-marked with a first identifier.
The first identity is used to characterize that the terminal device is capable of handover to the cellular network. In one possible implementation, the terminal device may mark the cellular network while performing other procedures using the cellular network; if the cellular network quality is good, the terminal equipment marks a first identifier for the cellular network; if the cellular network is of poor quality, the terminal device marks the cellular network with a second identity. In the embodiment of the application, the forms of the first mark and the second mark are not limited. In this way, the time to re-probe the cellular network channel quality can be shortened.
In one possible implementation, the terminal device remains active after the terminal device marks the first identity for the cellular network. The terminal device is illustratively changed from the idle state to the active state when the terminal device executes other processes; after the terminal device determines that the cellular network quality is good, the terminal device uses the cellular network to execute other processes and marks the cellular network with the first identifier. After the terminal equipment finishes other processes, no service interaction exists between the terminal equipment and the base station corresponding to the cellular network, at this time, the terminal equipment is not converted from an active state to an idle state, but the terminal equipment keeps the active state, and the process of releasing the bearer and/or connection between the terminal equipment and the core network is not executed. Subsequently, when the terminal equipment needs to use the cellular network to execute a code scanning flow, the terminal equipment can quickly determine the channel quality of the cellular network according to the first identifier; meanwhile, the terminal equipment in the activated state can be quickly accessed to the cellular network.
When the cellular network is pre-marked with the first identity, the terminal device may perform step S606.
Or S603, when the terminal device is in the idle state, the terminal device transitions from the idle state to the active state.
When the terminal equipment is in an idle state, no connection exists between the terminal equipment and a base station corresponding to the cellular network, and the terminal equipment needs to enter an active state to perform service interaction with the base station corresponding to the cellular network. The terminal device transitions from an idle state to an active state.
S604, the terminal equipment sends N times of data packets to the detection server by using a cellular network.
The detection server is used for interacting with the terminal equipment by using the cellular network to obtain the channel quality of the cellular network. After the terminal equipment enters an active state, the terminal equipment can detect the channel quality of the cellular network. The terminal device may use the cellular network to send N data packets to the probe server for N probes.
And S605, the terminal equipment calculates the channel quality of the cellular network based on the detection result returned by the detection server.
After the terminal device obtains the detection result, the parameter for reflecting the channel quality of the cellular network can be calculated according to the detection result, and the parameter for reflecting the channel quality of the cellular network can be packet loss rate, packet error rate, RTT value or the like.
In the network handover method provided in the embodiment of the present application, the efficiency of detecting the cellular network may be improved by reducing the detection frequency, and for example, the value of N may be a smaller value, for example, the value of N is 1. In the embodiment of the application, the terminal equipment uses the cellular network to send a data packet to the detection server once, receives the detection result of the time returned by the detection server, and calculates the detection result of the time to obtain the channel quality of the cellular network.
In order to shorten the overall handover time from the WiFi network to the cellular network, in the embodiment of the present application, the RTT value of the primary detection result is used as an index for evaluating the channel quality of the cellular network. For example, when the RTT value of the cellular network is smaller than the ninth preset value, the terminal device determines that the channel quality of the cellular network is good, where the ninth preset value may be set in a customized manner, for example, the ninth preset value may be 150ms.
And S606, the terminal equipment is switched from the WiFi network to the cellular network.
In a possible implementation, the terminal device may switch to the cellular network pre-marked with the first identity.
In another possible implementation, the terminal device may switch to a cellular network that meets the channel quality requirements.
Meeting the channel quality requirement may be that the RTT value of the cellular network is less than a ninth preset value; and when the RTT value of the cellular network is smaller than the ninth preset value, the terminal equipment is switched from the WiFi network to the cellular network. Other parameters may also be used by embodiments of the present application to characterize cellular network channel quality, which embodiments of the present application do not limit.
According to the network switching method provided by the embodiment of the application, whether the terminal equipment is in an activated state is judged through the terminal equipment; the terminal equipment determines that the cellular network is pre-marked with a first identifier; or under the condition that the terminal equipment is in an idle state, the terminal equipment is converted into an active state from the idle state; the terminal equipment sends N times of data packets to the detection server by using a cellular network; the terminal equipment calculates the channel quality of the cellular network based on the detection result returned by the detection server; the terminal device switches from the WiFi network to the cellular network, so that when the cellular network is pre-marked with the first identifier, the terminal device can be directly switched to the cellular network; or after the terminal equipment can activate the cellular network, the channel quality of the cellular network is detected, so that the time for switching the terminal equipment to the cellular network is shortened, the time for executing the code scanning flow by the terminal equipment is shortened, and the code scanning experience of a user is improved.
In this embodiment of the present application, when the terminal device executes the above embodiment, it may occur that the determination result does not meet the determination condition for continuing to execute the WiFi network switching cellular network, and at this time, the terminal device may stop executing the flow of the WiFi network switching cellular network based on the interrupt mechanism. For example, the terminal device may set a flag bit for the determination result when executing the determination step in the network handover method of the embodiment of the present application; for example, when the determination result satisfies the determination condition, the terminal device may set the flag bit to the first value, and the terminal device may continue to execute the subsequent flow; when the determination result does not meet the determination condition, the terminal device may set the flag bit to the second value, and reset the flag bit in the executed flow, so as to stop executing the subsequent flow and reset the executed flow.
The specific flow of the network handover method and the interruption mechanism in the embodiment of the present application are described below with reference to fig. 7, where the specific flow is as shown in fig. 7:
in an exemplary embodiment, S701, the terminal device identifies a code scanning action when accessing to the WiFi network.
Step S701 may refer to the related description of step S401, and will not be described herein.
S702, the terminal equipment judges whether the WiFi network quality parameter meets a first preset condition.
Step S702 may refer to the related descriptions of steps S505-S507, which are not repeated here.
When the WiFi network quality parameter of the terminal device does not meet the first preset condition, the terminal device may execute step S703. Alternatively, when the terminal device WiFi network quality parameter meets the first preset condition, the terminal device may execute step S711.
S703, the terminal equipment judges whether the terminal equipment is in an activated state.
Step S703 may refer to the related description of step S601, which is not described herein.
When the terminal device is in the active state, the terminal device may perform step S704. Alternatively, the terminal device may perform step S705 when the terminal device is in an idle state.
S704, the terminal device determines whether the cellular network is pre-marked with the first identification.
Step S704 may refer to the related description of step S602, which is not described herein.
The terminal device may perform step S710 when the cellular network is pre-marked with the first identity.
Alternatively, the terminal device may perform step S711 when the cellular network is pre-marked with the second identification.
The second identifier can be used for representing that the channel quality of the cellular network is poor, and the cellular network cannot support the smooth execution of the code scanning flow of the terminal equipment. At this point the terminal device no longer performs a handover to the cellular network.
S705, the terminal equipment is converted from an idle state to an active state.
Step S705 may refer to the related description of step S603, and will not be described herein.
S706, the terminal equipment judges whether the activation is successful.
When the terminal device succeeds in activating the cellular network, the terminal device may perform step S707. Alternatively, the terminal device may perform step S711 when the terminal device fails to activate the cellular network.
S707, the terminal equipment detects the channel quality of the cellular network.
Step S707 may refer to the related description of step S604, which is not described herein.
S708, the terminal equipment judges whether the detection duration of the detection result returned by the detection server is overtime.
When the detection duration does not expire, the terminal device may execute step S709. Alternatively, when the probe duration times out, the terminal device may perform step S711.
S709, the terminal equipment judges whether the channel quality of the cellular network meets the channel quality requirement.
Step S709 may refer to the related description of step S606, and will not be described herein.
When the cellular network channel quality meets the channel quality requirement, the terminal device may perform step S710. Alternatively, the terminal device may perform step S711 when the cellular network channel quality does not meet the channel quality requirement.
S710, the terminal equipment is switched from the WiFi network to the cellular network.
Step S710 may refer to the related description of step S606, and will not be described herein.
Or, S711, the terminal device stops executing the flow of switching from the WiFi network to the cellular network.
It will be appreciated that when the terminal device obtains the following determination result, the terminal device may stop performing the procedure of switching from the WiFi network to the cellular network, for example:
optionally, when the WiFi network quality parameter meets a first preset condition, the terminal device may stop executing the procedure of switching from the WiFi network to the cellular network. It will be appreciated that the WiFi network is of better quality and the terminal device does not need to switch to the cellular network.
Optionally, in the process of activating the cellular network by the terminal device, the data flow of the code scanning application of the terminal device is already established on the cellular network due to the original network acceleration characteristic or other characteristics of the terminal device; or the activated cellular network has been marked by the terminal device as a second identity; or the terminal device fails to activate the cellular network. At this point, the terminal device may stop performing the flow of the handover from the WiFi network to the cellular network.
Optionally, in the process that the terminal equipment detects the channel quality of the cellular network, the terminal equipment obtains a detection result overtime; or the detected channel quality parameters of the cellular network do not meet the channel quality requirements. At this point, the terminal device may stop performing the flow of the handover from the WiFi network to the cellular network.
According to the network switching method provided by the embodiment of the application, when the terminal equipment executes the flow of switching the WiFi network to the cellular network, the terminal equipment judges whether the judging result of each flow meets the judging condition. When the judging result meets the judging condition, the terminal equipment continues to execute the subsequent steps; and when the judging result does not meet the judging condition, the terminal equipment stops executing the flow of switching from the WiFi network to the cellular network. Thus, the accuracy of the terminal equipment executing the network switching method of the embodiment of the application can be ensured while the time of the terminal equipment executing the flow of switching the cellular network from the WiFi network is shortened.
The following describes an internal interaction flow of the terminal device for executing the network handover method provided in the embodiment of the present application with reference to fig. 8 and fig. 9.
As shown in fig. 3, the frame layer of the terminal device may include: the system comprises a sensing module, a decision module and an execution module. The sensing module can be used for monitoring the quality parameters of the WiFi network, identifying triggering operation for indicating the terminal equipment to scan the scannable code, acquiring the detection result of the cellular network, synchronizing the corresponding instruction to the decision module and the like. The decision module may be configured to execute the step for determining in the network handover method according to the instruction issued by the awareness module. The execution module may be configured to execute relevant steps in the network handover method for handover of the cellular network from the WiFi network according to the determination result of the decision module.
The flow of determining the quality of the WiFi network performed by the terminal device will be described with reference to fig. 8. Fig. 8 is a schematic diagram of an internal interaction flow of a network switching method according to an embodiment of the present application. As shown in fig. 8:
the sensing module periodically detects the WiFi network quality parameter and reports the WiFi network quality parameter to the decision module.
After the terminal equipment is accessed to the WiFi network, the sensing module of the terminal equipment can periodically acquire the quality parameters of the WiFi network. The sensing module synchronizes the WiFi network quality parameters to the decision module. The decision module can store the history WiFi network quality parameters synchronized by the sensing module.
S802, the terminal equipment receives a trigger operation for instructing the terminal equipment to scan the scannable code.
S803, in response to the triggering operation, the terminal device starts a first activity.
S804, the sensing module recognizes the code scanning action.
The perception module recognizes that a first activity of the terminal device evokes a camera application.
Steps S802-S804 may refer to the related descriptions of steps S501-S503, which are not described herein.
S805, the decision module obtains an instruction from the perception module for instructing the decision module to determine the quality condition of the WiFi network.
After recognizing the code scanning action, the sensing module can issue an instruction to the decision module to inform the decision module to start to judge the quality condition of the WiFi network.
S806, the decision module obtains the WiFi network quality parameters within a first preset time period before the code scanning action is identified.
Illustratively, the decision module may obtain the WiFi network quality parameters within 10s before the code sweeping action is identified. In one possible implementation, the historical WiFi network quality parameters may be pre-stored in the decision module; the historical WiFi network quality parameters can also be pre-stored in the storage module, and when the sensing module recognizes the code scanning action, the decision module can acquire the WiFi network quality parameters in a period of time before the current moment from the storage module. The embodiment of the application does not limit the acquisition mode of the historical WiFi network quality parameters.
S807, the decision module determines that the WiFi network quality parameter does not meet a first preset condition.
The first preset condition is not satisfied by the WiFi network quality parameter, including at least one of the following: the signal lattice number of the WiFi network is smaller than a first preset value, the channel busy rate of the WiFi network is larger than a second preset value, the packet sending delay of the WiFi network is larger than a third preset value, the channel detection RTT of the WiFi network is larger than a fourth preset value, the uplink and downlink speed of the WiFi network is smaller than a fifth preset value, the packet sending failure rate of the WiFi network is larger than a sixth preset value, the TCP stream of an uplink and downlink transmission control protocol is unstable, the uplink and downlink retransmission rate is larger than a seventh preset value and/or the uplink and downlink acknowledgement character repetition rate is larger than an eighth preset value.
In a possible implementation manner, when the decision module of the terminal device determines that the WiFi network quality parameter does not meet any of the above preset values, the decision module of the terminal device may execute step S808 to instruct the execution module to execute a procedure of switching from the WiFi network to the cellular network.
S808, the decision module informs the execution module of an instruction for instructing the execution module to execute the switching process from the WiFi network to the cellular network.
The decision module, upon receiving the instruction, may prepare to perform a handoff procedure from the WiFi network to the cellular network.
In the network switching method provided by the embodiment of the application, the sensing module periodically detects the quality parameters of the WiFi network and reports the quality parameters of the WiFi network to the decision module; the terminal equipment receives triggering operation for instructing the terminal equipment to scan the scannable code; in response to the triggering operation, the terminal device initiates a first activity; the sensing module recognizes a code scanning action; the decision module obtains an instruction from the perception module, which is used for indicating the decision module to judge the quality condition of the WiFi network; the decision module acquires WiFi network quality parameters in a first preset time period before the code scanning action is identified; the decision module determines that the WiFi network quality parameter does not meet a first preset condition; the decision module notifies the execution module of an instruction for instructing the execution module to execute a WiFi network to cellular network handover procedure. Therefore, the terminal equipment can quickly determine whether to execute a process of switching from the WiFi network to the cellular network based on the historical WiFi network quality parameters and the first preset condition, and the efficiency of network switching is improved.
In the embodiment of the application, after determining that the procedure of switching from the WiFi network to the cellular network needs to be executed, the terminal device may detect whether the channel quality of the cellular network is suitable for access. In some embodiments, the terminal device may pre-mark the first identifier for the cellular network when executing other procedures, and then the terminal device may directly switch to the cellular network with better channel quality. In other embodiments, the terminal device does not mark the cellular network with the first identifier, and the terminal device needs to detect the channel quality of the cellular network after the terminal device changes from the idle state to the active state.
The following takes the terminal device to execute the switching process from the WiFi network to the cellular network, and the terminal device is in an idle state as an example, and the internal interaction process of the terminal device in this scenario is described with reference to fig. 9. Fig. 9 is a schematic diagram of an internal interaction flow of a network switching method according to an embodiment of the present application. As shown in fig. 9:
after the terminal device finishes step S808, the terminal device may continue to perform step S901.
The S901, execution module requests the decision module to query the status of the terminal device.
S902, the decision module determines that the terminal equipment is in an idle state.
When the terminal device is in an idle state, the terminal device needs to activate the cellular network and determine the channel quality of the cellular network. As shown in steps S903-S908.
S903, the execution module obtains an instruction for indicating the switching state of the terminal equipment, which is reported by the decision module.
S904, the execution module changes the terminal equipment from the idle state to the active state.
S905, the execution module sends a data packet to the detection server once.
S906, the sensing module acquires a detection result returned by the detection server and reports the detection result to the decision module.
S907, the decision module determines that the cellular network channel quality meets the channel quality requirement.
Illustratively, the decision module calculates an RTT value for the cellular network based on the detection result returned by the detection server; when the RTT value of the cellular network is less than or equal to 150m, the terminal device may perform step S908.
S908, the decision module informs the execution module to execute the procedure of switching from the WiFi network to the cellular network.
S909, the execution module switches the data flow of the code scanning application to the cellular network.
After the terminal device is handed over to the cellular network, further comprising:
s910, the camera application of the terminal device completes scanning the scannable code using the cellular network.
Alternatively, the terminal device may acquire an image of the scannable code based on a camera, or acquire an image of the scannable code in an album application. The terminal device scans the image of the scannable code using the cellular network to complete the scanning of the scannable code.
S911, the terminal equipment displays an interface of the scannable code link.
Wherein the interface of the scannable code link may correspond to the interface shown as d in fig. 3.
The network switching method of the embodiment of the present application has been described above, and the device for executing the network switching method provided by the embodiment of the present application is described below. Those skilled in the art will understand that the methods and apparatuses may be combined and referred to, and the related apparatuses provided in the embodiments of the present application may perform the steps in the network handover method described above.
As shown in fig. 10, fig. 10 is a schematic structural diagram of a network switching device provided in an embodiment of the present application, where the network switching device may be a terminal device in an embodiment of the present application, or may be a chip or a chip system in the terminal device.
As shown in fig. 10, the network switching apparatus 1000 may be used in a communication device, a circuit, a hardware component, or a chip, and includes: a display unit 1001, and a processing unit 1002. Wherein the display unit 1001 is used for supporting the step of displaying performed by the network switching apparatus 1000; the processing unit 1002 is configured to support the network switching apparatus 1000 to perform steps of information processing.
In a possible implementation, the network switching device 1000 may also include a communication unit 1003. Specifically, the communication unit is configured to support the network switching device 1000 to perform the steps of transmitting data and receiving data. The communication unit 1003 may be an input or output interface, pin or circuit, etc.
In a possible embodiment, the network switching device may further include: a storage unit 1004. The processing unit 1002 and the storage unit 1004 are connected by a line. The storage unit 1004 may include one or more memories, which may be one or more devices, devices in a circuit, for storing programs or data. The storage unit 1004 may exist independently and be connected to the processing unit 1002 provided in the network switching device through a communication line. The memory unit 1004 may also be integrated with the processing unit 1002.
The storage unit 1004 may store computer-executed instructions of the method in the terminal device to cause the processing unit 1002 to execute the method in the above-described embodiment. The storage unit 1004 may be a register, a cache, a RAM, or the like, and the storage unit 1004 may be integrated with the processing unit 1002. The storage unit 1004 may be a read-only memory (ROM) or other type of static storage device that may store static information and instructions, and the storage unit 1004 may be independent of the processing unit 1002.
The network switching method provided by the embodiment of the application can be applied to the electronic equipment with the communication function. The electronic device includes a terminal device, and specific device forms and the like of the terminal device may refer to the above related descriptions, which are not repeated herein.
The embodiment of the application provides a terminal device, which comprises: comprising the following steps: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to cause the terminal device to perform the method described above.
The embodiment of the application provides a chip. The chip comprises a processor for invoking a computer program in a memory to perform the technical solutions in the above embodiments. The principle and technical effects of the present invention are similar to those of the above-described related embodiments, and will not be described in detail herein.
Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The computer program realizes the above method when being executed by a processor. The methods described in the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer readable media can include computer storage media and communication media and can include any medium that can transfer a computer program from one place to another. The storage media may be any target media that is accessible by a computer.
In one possible implementation, the computer readable medium may include RAM, ROM, compact disk-read only memory (CD-ROM) or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium targeted for carrying or storing the desired program code in the form of instructions or data structures and accessible by a computer. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (Digital Subscriber Line, DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes optical disc, laser disc, optical disc, digital versatile disc (Digital Versatile Disc, DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The present embodiments provide a computer program product comprising a computer program which, when executed, causes a computer to perform the above-described method.
Embodiments of the present application are described 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 flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing detailed description of the invention has been presented for purposes of illustration and description, and it should be understood that the foregoing is by way of illustration and description only, and is not intended to limit the scope of the invention.

Claims (15)

1. A network switching method, applied to a terminal device, the method comprising:
the terminal equipment identifies a code scanning action under the condition of accessing a WiFi network;
the terminal equipment acquires WiFi network quality parameters in a first preset time period before the code scanning action is identified;
when the WiFi network quality parameter does not meet the first preset condition, the terminal equipment is switched to a cellular network meeting the second preset condition;
the terminal device executes a code scanning flow in the cellular network.
2. The method of claim 1, wherein the WiFi network quality parameters include: the signal strength of the WiFi network, the link quality of the WiFi network and/or the network fluency of the terminal equipment running the code scanning application.
3. The method according to claim 1 or 2, wherein the signal strength of the WiFi network is related to the number of signal formats of the WiFi network; the link quality of the WiFi network is related to the channel busy rate, the packet sending delay, the channel Round Trip Time (RTT), the uplink and downlink rates and/or the packet sending failure rate of the WiFi network; the network fluency of the terminal equipment running the code scanning application is related to uplink and downlink Transmission Control Protocol (TCP) flow, uplink and downlink retransmission rate and/or uplink and downlink acknowledgement character repetition rate;
The WiFi network quality parameter not meeting the first preset condition includes at least one of the following: the signal lattice number of the WiFi network is smaller than a first preset value, the channel busy rate of the WiFi network is larger than a second preset value, the packet sending delay of the WiFi network is larger than a third preset value, the channel detection RTT of the WiFi network is larger than a fourth preset value, the uplink and downlink rates of the WiFi network are smaller than a fifth preset value, the packet sending failure rate of the WiFi network is larger than a sixth preset value, the TCP stream of the uplink and downlink transmission control protocol is unstable, the uplink and downlink retransmission rate is larger than a seventh preset value and/or the uplink and downlink acknowledgement character repetition rate is larger than an eighth preset value.
4. A method according to any of claims 1-3, characterized in that the terminal device comprises a perception module and a decision module; before recognizing the code scanning action under the condition of accessing the WiFi network, the terminal equipment comprises:
the sensing module periodically detects the WiFi network quality parameters and reports the WiFi network quality parameters to the decision module;
the terminal equipment identifies a code scanning action under the condition of accessing a WiFi network, and comprises the following steps: the sensing module recognizes the code scanning action;
The terminal equipment obtains the WiFi network quality parameters in a first preset time period before the code scanning action is identified, and the method comprises the following steps: the decision module obtains an instruction from the perception module for instructing the decision module to determine the quality condition of the WiFi network; and the decision module acquires the WiFi network quality parameters in a first preset time before the current moment.
5. The method of claim 4, wherein the sensing module identifying the code sweeping action comprises:
the perception module recognizes that a first activity of the terminal device invokes a camera application.
6. The method of claim 4 or 5, further comprising, before the perception module recognizes that the first activity of the terminal device invokes a camera application:
the terminal equipment receives triggering operation for instructing the terminal equipment to scan a scannable code;
in response to the trigger operation, the terminal device initiates the first activity.
7. The method according to any of claims 1-6, wherein the terminal device performs a code scanning procedure in the cellular network, comprising:
The terminal equipment switches the data flow of the code scanning application to the cellular network;
the camera application of the terminal device using the cellular network to complete scanning a scannable code;
the method further comprises the steps of: and the terminal equipment displays an interface of the scannable code link.
8. The method according to any of claims 1-7, wherein the cellular network satisfying the second preset condition comprises: a cellular network pre-marked with a first identity by the terminal device; or the terminal equipment detects the accessible cellular network; wherein the first identity is used to characterize that the terminal device is capable of handover to the cellular network.
9. The method of claim 8, wherein the terminal device remains active after the terminal device marks the first identity for the cellular network.
10. The method of claim 8, wherein the terminal device switches to a cellular network that satisfies a second preset condition, further comprising:
the terminal equipment is converted from an idle state to an active state;
the terminal equipment uses the cellular network to send N times of data packets to a detection server;
The terminal equipment calculates the channel quality of the cellular network based on the detection result returned by the detection server;
and when the channel quality of the cellular network meets the channel quality requirement, the terminal equipment is switched from the WiFi network to the cellular network.
11. The method of claim 10, wherein N is 1.
12. The method according to claim 10, wherein the cellular network channel quality comprises RTT values for the cellular network; the cellular network which is detected by the terminal equipment and can be accessed comprises: and the RTT value of the cellular network is smaller than that of a cellular network with a ninth preset value.
13. A terminal device, comprising: a processor and a memory;
the memory stores computer-executable instructions;
the processor executing computer-executable instructions stored in the memory to cause the terminal device to perform the method of any one of claims 1-12.
14. A computer readable storage medium storing a computer program, which when executed by a processor performs the method according to any one of claims 1-12.
15. A computer program product comprising a computer program which, when run, causes a computer to perform the method of any of claims 1-12.
CN202211736043.7A 2022-12-30 2022-12-30 Network switching method and electronic equipment Active CN116347550B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211736043.7A CN116347550B (en) 2022-12-30 2022-12-30 Network switching method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211736043.7A CN116347550B (en) 2022-12-30 2022-12-30 Network switching method and electronic equipment

Publications (2)

Publication Number Publication Date
CN116347550A true CN116347550A (en) 2023-06-27
CN116347550B CN116347550B (en) 2023-10-31

Family

ID=86884743

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211736043.7A Active CN116347550B (en) 2022-12-30 2022-12-30 Network switching method and electronic equipment

Country Status (1)

Country Link
CN (1) CN116347550B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN204761724U (en) * 2015-05-28 2015-11-11 上海精吉通讯技术有限公司 A mobile terminal for sweeping sign indicating number
US20150373574A1 (en) * 2012-12-13 2015-12-24 Devicescape Software, Inc. Systems and methods for quality of experience measurement and wireless network recommendation
CN105554831A (en) * 2016-01-28 2016-05-04 努比亚技术有限公司 Network switching device and method
CN107277876A (en) * 2017-08-04 2017-10-20 广东欧珀移动通信有限公司 Method for switching network, device and terminal device
CN108419279A (en) * 2018-02-08 2018-08-17 四川速宝网络科技有限公司 Network switching system
CN108702637A (en) * 2016-02-18 2018-10-23 高通股份有限公司 Technology for disposing the data stall in WLAN
US20190373525A1 (en) * 2018-06-01 2019-12-05 Apple Inc. Method and System to Support Seamless Wi-Fi to Cellular Handoff on Power Constrained Device
US20210105691A1 (en) * 2019-10-03 2021-04-08 Apple Inc. WLAN to Cellular Handover Techniques for Voice Calls
CN112867074A (en) * 2020-12-30 2021-05-28 深圳酷派技术有限公司 Data transmission method, electronic device and storage medium
CN115243330A (en) * 2021-04-25 2022-10-25 中国联合网络通信集团有限公司 Method, terminal and storage medium for automatically switching WiFi and cellular network
WO2022222651A1 (en) * 2021-04-20 2022-10-27 荣耀终端有限公司 Method for switching wi-fi network and cellular network, and electronic device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150373574A1 (en) * 2012-12-13 2015-12-24 Devicescape Software, Inc. Systems and methods for quality of experience measurement and wireless network recommendation
CN204761724U (en) * 2015-05-28 2015-11-11 上海精吉通讯技术有限公司 A mobile terminal for sweeping sign indicating number
CN105554831A (en) * 2016-01-28 2016-05-04 努比亚技术有限公司 Network switching device and method
CN108702637A (en) * 2016-02-18 2018-10-23 高通股份有限公司 Technology for disposing the data stall in WLAN
CN107277876A (en) * 2017-08-04 2017-10-20 广东欧珀移动通信有限公司 Method for switching network, device and terminal device
CN108419279A (en) * 2018-02-08 2018-08-17 四川速宝网络科技有限公司 Network switching system
US20190373525A1 (en) * 2018-06-01 2019-12-05 Apple Inc. Method and System to Support Seamless Wi-Fi to Cellular Handoff on Power Constrained Device
US20210105691A1 (en) * 2019-10-03 2021-04-08 Apple Inc. WLAN to Cellular Handover Techniques for Voice Calls
CN112867074A (en) * 2020-12-30 2021-05-28 深圳酷派技术有限公司 Data transmission method, electronic device and storage medium
WO2022222651A1 (en) * 2021-04-20 2022-10-27 荣耀终端有限公司 Method for switching wi-fi network and cellular network, and electronic device
CN115243330A (en) * 2021-04-25 2022-10-25 中国联合网络通信集团有限公司 Method, terminal and storage medium for automatically switching WiFi and cellular network

Also Published As

Publication number Publication date
CN116347550B (en) 2023-10-31

Similar Documents

Publication Publication Date Title
KR102444085B1 (en) Portable communication apparatus and method for displaying images thereof
US20230094272A1 (en) Notification Processing System, Method, and Electronic Device
WO2020000448A1 (en) Flexible screen display method and terminal
CN112351412A (en) Content connection method, system and electronic equipment
CN114449599B (en) Network link switching method based on electronic equipment position and electronic equipment
US20230422154A1 (en) Method for using cellular communication function, and related apparatus and system
WO2020024108A1 (en) Application icon display method and terminal
CN116156417A (en) Equipment positioning method and related equipment thereof
CN116347550B (en) Network switching method and electronic equipment
WO2020051916A1 (en) Method for transmitting information and electronic device
CN117009005A (en) Display method, automobile and electronic equipment
CN116709016A (en) Multiplying power switching method and multiplying power switching device
CN114172860B (en) Mail processing method and device
CN116095223B (en) Notification display method and terminal device
CN116389884B (en) Thumbnail display method and terminal equipment
CN116232959B (en) Network quality detection method and device
CN114390569B (en) Method and device for measuring synchronous signal block and mobile terminal
CN115297530B (en) Network connection method and device
CN116382728B (en) Propagation name display method and terminal equipment
CN115087134B (en) Bluetooth connection method and electronic equipment
CN116405594B (en) Voice communication method and device
CN116089056B (en) Method for image drawing and related device
CN115017495B (en) Timing verification method, electronic device, and readable storage medium
CN116321265B (en) Network quality evaluation method, electronic device and storage medium
CN116095224B (en) Notification display method and terminal device

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
GR01 Patent grant
GR01 Patent grant