WO2023124791A1 - 蜂窝网络的控制方法和电子设备 - Google Patents

蜂窝网络的控制方法和电子设备 Download PDF

Info

Publication number
WO2023124791A1
WO2023124791A1 PCT/CN2022/136477 CN2022136477W WO2023124791A1 WO 2023124791 A1 WO2023124791 A1 WO 2023124791A1 CN 2022136477 W CN2022136477 W CN 2022136477W WO 2023124791 A1 WO2023124791 A1 WO 2023124791A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
cellular
cellular network
network
request
Prior art date
Application number
PCT/CN2022/136477
Other languages
English (en)
French (fr)
Inventor
陈冲
林大伟
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023124791A1 publication Critical patent/WO2023124791A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W36/00Hand-off or reselection arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/18Selecting a network or a communication service
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0251Power saving arrangements in terminal devices using monitoring of local events, e.g. events related to user activity
    • H04W52/0258Power saving arrangements in terminal devices using monitoring of local events, e.g. events related to user activity controlling an operation mode according to history or models of usage information, e.g. activity schedule or time of day

Definitions

  • the embodiments of the present application relate to the technical field of terminal equipment, and in particular, to a method for controlling a cellular network and electronic equipment.
  • the present application provides a cellular network control method and electronic equipment.
  • this method when the last application that has applied for and used the cellular network is detected, it is switched from the foreground to the background operation, and when no application data is generated for a certain period of time, the access to the cellular network can be disconnected to prevent unapplied
  • the application of the cellular network continues to use the cellular network applied for by the above-mentioned application when the electronic device has a Wi-Fi connection, thereby saving the power of the mobile phone in a dual-network environment.
  • an embodiment of the present application provides a method for controlling a cellular network, which is applied to an electronic device, and the electronic device performs data interaction with an application server through a Wi-Fi network and a cellular network, wherein the cellular network is controlled by the first
  • the first application and the second application perform data interaction with the respective application servers through the cellular network.
  • the methods include:
  • the data of the second application is exchanged with the application server of the second application through the Wi-Fi network.
  • an application in the electronic device can use a network to perform data interaction with the application server at the same time, then different applications in the electronic device can perform data interaction with their respective application servers through the Wi-Fi network and the cellular network respectively.
  • the above data interaction may be used to represent uplink data interaction, or downlink data interaction, or uplink and downlink data interaction.
  • the first application using the cellular network is used to indicate that the first application can use the cellular network to communicate with the first The application server of the application performs data interaction.
  • the cellular network is applied for by the first application, and the first application and the unapplied cellular network
  • the second application is used. After the first application running in the foreground is switched to the background in response to a user operation, it is detected that the first application has not generated application data within the preset time period of running in the background, and is the last application and uses the cellular In order to prevent the second application that has not applied for the cellular network from continuing to use the cellular network applied for by the first application when the electronic device has a Wi-Fi connection, thereby saving dual network
  • the battery power of the mobile phone in the environment is not limited to use the cellular network applied for by the first application.
  • the method further includes:
  • a pathway to the cellular network connecting the electronic device A pathway to the cellular network connecting the electronic device.
  • the method further includes: after connecting the electronic device to the cellular network, exchanging data of the first application with an application server of the first application through the cellular network.
  • this application does not limit the timing of exchanging the data of the first application through the cellular network.
  • the specific timing is determined by the business requirements of the first application.
  • the first application needs to be connected to the Internet to exchange data with the application server , which can be implemented over a cellular network.
  • the method further includes:
  • the first cellular request is used to apply for the cellular network
  • the first data structure is used to store a cellular request of a preset application, where the preset application is an application that has applied for the cellular network.
  • the method further includes:
  • the method further includes:
  • the method further includes:
  • the a second cell of a third application requests deletion from said first data structure
  • the second cellular request is used to apply for the cellular network.
  • the third application when it is detected that the third application keeps running in the background and has not generated application data within the preset period of time, there are applications other than the third application that have applied for the cellular network and also use the cellular network application.
  • the method before deleting the second cellular request of the third application from the first data structure, the method further includes:
  • the second cellular request is backed up to a second data structure.
  • the method further includes:
  • the method further includes:
  • the first cellular request is deleted from the second data structure.
  • the method further includes:
  • the second cellular request is deleted from the second data structure.
  • the method further includes:
  • the first cellular request is deleted from the second data structure.
  • the electronic device displays a first icon representing the Wi-Fi network and a second icon representing the cellular network;
  • the second icon Before disconnecting the access of the cellular network of the electronic device, the second icon includes a second uplink identifier, and/or, a second downlink identifier;
  • the second uplink identifier is used to indicate that the electronic device uploads data to the application server through the cellular network
  • the second downlink identifier is used to indicate that the electronic device downloads data from the application server through the cellular network.
  • the first icon after disconnecting the access to the cellular network of the electronic device, the first icon includes the first uplink identifier, and/or, the second a downline mark, the second icon does not include the second upline mark and the second downline mark;
  • the first uplink identifier is used to indicate that the electronic device uploads data to the application server through the Wi-Fi network
  • the first downlink identifier is used to indicate that the electronic device downloads data from the application server through the Wi-Fi network.
  • the second icon after the path connecting the cellular network of the electronic device, the second icon includes the second uplink identifier, and/or, the second Downlink ID.
  • the embodiment of the present application provides an electronic device.
  • the electronic device includes: a memory and a processor, the memory is coupled to the processor; the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device performs the first aspect And the method in any one of the implementation manners of the first aspect.
  • the embodiment of the present application provides a computer-readable medium, which is used to store a computer program, and when the computer program is run on an electronic device, the electronic device executes the method according to the first aspect and the first aspect.
  • the method in any one of the embodiments.
  • the embodiment of the present application provides a chip, the chip includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from the memory of the electronic device and send signals to the processing The signal is sent by the processor, and the signal includes computer instructions stored in the memory; when the processor executes the computer instructions, the electronic device executes the first aspect and any one of the implementation manners of the first aspect. Methods.
  • FIG. 1 is one of the structural schematic diagrams of electronic equipment shown exemplary
  • FIG. 2 is a schematic diagram of a software structure of an exemplary electronic device
  • Fig. 3a is a schematic diagram of network interaction of a mobile phone shown exemplary
  • Fig. 3b is a schematic diagram of the interaction process of each module of the mobile phone shown exemplary
  • FIG. 4 is a schematic diagram of a cellular state and an application state exemplarily shown
  • Fig. 5a is a schematic flowchart of a cellular network control method exemplarily shown
  • Fig. 5b is a schematic flowchart of a cellular network control method exemplarily shown
  • FIG. 6 is a schematic flowchart of a cellular network control method exemplarily shown
  • FIG. 7 is a schematic flowchart of a cellular network control method exemplarily shown.
  • FIG. 8 is a schematic flowchart of a cellular network control method exemplarily shown
  • FIG. 9 is a schematic diagram of an exemplary application scenario
  • FIG. 10 is a schematic diagram of an exemplary application scenario
  • Fig. 11 is a schematic diagram of a cellular state and an application state exemplarily shown in an embodiment of the present application;
  • Fig. 12 is a schematic diagram illustrating a cellular state and an application state of an embodiment of the present application.
  • Fig. 13 is a schematic diagram of a cellular state and an application state exemplarily shown in an embodiment of the present application;
  • Fig. 14 is a schematic structural diagram of the device provided by the embodiment of the present application.
  • first and second in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of objects.
  • first target object, the second target object, etc. are used to distinguish different target objects, rather than describing a specific order of the target objects.
  • words such as “exemplary” or “for example” are used as examples, illustrations or illustrations. Any embodiment or design scheme described as “exemplary” or “for example” in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Rather, the use of words such as “exemplary” or “such as” is intended to present related concepts in a concrete manner.
  • multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
  • FIG. 1 shows a schematic structural diagram of an electronic device 100 .
  • the electronic device 100 shown in FIG. 1 is only an example of an electronic device.
  • the electronic device 100 may be a terminal, or may be called a terminal device, and the terminal may be a cellular phone (cellular phone), that is, a mobile phone , which is not limited in this application.
  • the electronic device 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have different component configurations.
  • the various components shown in FIG. 1 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
  • the electronic 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 charging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2.
  • Mobile communication module 150 wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, And a subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, bone conduction sensor 180M, etc.
  • the processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU) wait. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit, NPU
  • the controller may be the nerve center and command center of the electronic device 100 .
  • the controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
  • a memory may also be provided in the processor 110 for storing instructions and data.
  • the memory in 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 use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
  • processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB universal serial bus
  • the USB interface 130 is an interface conforming to the USB standard specification, specifically, it can be a Mini USB interface, a Micro USB interface, a USB Type C interface, and the like.
  • the USB interface 130 can be used to connect a charger to charge the electronic device 100 , and can also be used to transmit data between the electronic device 100 and peripheral devices. It can also be used to connect headphones and play audio through them. This interface can also be used to connect other electronic devices, such as AR devices.
  • the interface connection relationship between the modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 100 .
  • the electronic device 100 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
  • the charging management module 140 is configured to receive a charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 140 can receive charging input from the wired charger through the USB interface 130 .
  • the charging management module 140 may receive a wireless charging input through a wireless charging coil of the electronic device 100 . While the charging management module 140 is charging the battery 142 , it can also supply power to the electronic device through the power management module 141 .
  • the power management module 141 is used for connecting the battery 142 , the charging management module 140 and the processor 110 .
  • the power management module 141 receives the input from the battery 142 and/or the charging management module 140 to provide power for the processor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and the wireless communication module 160 .
  • the power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle times, and battery health status (leakage, impedance).
  • the power management module 141 may also be disposed in the processor 110 .
  • the power management module 141 and the charging management module 140 may also be set in the same device.
  • the wireless communication function of the electronic device 100 can be realized 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.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 100 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 100 .
  • the mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
  • the mobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves and radiate them through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 150 may be set in the processor 110 .
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be set in the same device.
  • a 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 to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
  • the application processor outputs sound signals through audio equipment (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194 .
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent from the processor 110, and be set in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), global navigation satellite, etc. applied on the electronic device 100.
  • System global navigation satellite system, GNSS
  • frequency modulation frequency modulation, FM
  • near field communication technology near field communication, NFC
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 .
  • the wireless communication module 160 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology.
  • the electronic device 100 realizes the display function through the GPU, the display screen 194 , and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are 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 screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
  • the electronic device 100 may include 1 or N display screens 194 , where N is a positive integer greater than 1.
  • the electronic device 100 can realize the shooting function through the ISP, the camera 193 , the video codec, the GPU, the display screen 194 and the application processor.
  • Camera 193 is used to capture still images or video.
  • the object generates an optical image through the lens and projects it to the photosensitive element.
  • the external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, so as to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.
  • the internal memory 121 may be used to store computer-executable program codes including instructions.
  • the processor 110 executes various functional applications of the electronic device 100 and the control method of the cellular network in the embodiment of the present application by executing the instructions stored in the internal memory 121 .
  • the internal memory 121 may include an area for storing programs and an area for storing data.
  • the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like.
  • the storage data area can store data created during the use of the electronic device 100 (such as audio data, phonebook, etc.) and the like.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the electronic device 100 can implement audio functions through the audio module 170 , the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playback, recording, etc.
  • the audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal.
  • the audio module 170 may also be used to encode and decode audio signals.
  • the audio module 170 may be set in the processor 110 , or some functional modules of the audio module 170 may be set in the processor 110 .
  • the keys 190 include a power key, a volume key and the like.
  • the key 190 may be a mechanical key. It can also be a touch button.
  • the electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100 .
  • the motor 191 can generate a vibrating reminder.
  • the motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
  • touch operations applied to different applications may correspond to different vibration feedback effects.
  • the motor 191 may also correspond to different vibration feedback effects for touch operations acting on different areas of the display screen 194 .
  • Different application scenarios for example: time reminder, receiving information, alarm clock, games, etc.
  • the touch vibration feedback effect can also support customization.
  • the indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like.
  • the SIM card interface 195 is used for connecting a SIM card.
  • the SIM card can be connected and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 .
  • the electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards may be the same or different.
  • the SIM card interface 195 is also compatible with different types of SIM cards.
  • the SIM card interface 195 is also compatible with external memory cards.
  • the electronic device 100 interacts with the network through the SIM card to implement functions such as calling and data communication.
  • the electronic device 100 adopts an eSIM, that is, an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100 .
  • the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.
  • the embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 .
  • FIG. 2 is a block diagram of the software structure of the electronic device 100 according to the embodiment of the present application.
  • the layered architecture of the electronic device 100 divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces.
  • the Android system is divided into four layers, which are respectively the application program layer, the application program framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer from top to bottom.
  • the application layer can consist of a series of application packages.
  • the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer includes some predefined functions.
  • the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a connection service module (ConnectivityService, CS) and a power consumption control module.
  • a window manager a content provider
  • a view system a phone manager
  • a resource manager a connection service module (ConnectivityService, CS) and a power consumption control module.
  • CS connection service module
  • a window manager is used to manage window programs.
  • the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc.
  • Content providers are used to store and retrieve data and make it accessible to applications.
  • Said data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on.
  • the view system can be used to build applications.
  • a display interface can consist of one or more views.
  • a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
  • the phone manager is used to provide communication functions of the electronic device 100 . For example, the management of call status (including connected, hung up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify the download completion, message reminder, etc.
  • the notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window.
  • prompting text information in the status bar issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
  • connection service module is used to manage the network connection of the electronic device, and the specific processing process will be described in detail in the following embodiments.
  • the power consumption control module is used to manage the state of the application program and control the connection service module, and runs during the whole process of the electronic device from startup to shutdown.
  • the system library and runtime layer includes the system library and the Android Runtime (Android Runtime).
  • a system library can include multiple function modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
  • the 3D graphics library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc.
  • the Android runtime includes core libraries and a virtual machine.
  • the Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in virtual machines.
  • the virtual machine executes the java files of the application program layer and the application program framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of various commonly used audio and video formats, as well as still image files, etc.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing, etc.
  • 2D graphics engine is a drawing engine for 2D drawing.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer includes at least a display driver, a camera driver, an audio driver, a sensor driver, and a Modem (modem).
  • modem Modem
  • the components contained in the system framework layer, system library and runtime layer shown in FIG. 2 do not constitute a specific limitation on the electronic device 100 .
  • the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • Figure 3a is a schematic diagram of the network interaction of the mobile phone shown exemplary
  • Figure 3b is a schematic diagram of the interaction process of each module of the mobile phone according to the embodiment of the present invention shown exemplary
  • Figure 4 is a schematic diagram of the interaction associated with Figure 3a and Figure 3b Schematic diagram of cellular state and application state.
  • Cell disconnected state used to indicate that the cellular channel between the mobile phone and the base station is disconnected
  • Cellular connection status used to indicate that the cellular channel between the mobile phone and the base station is connected
  • the application is in the active state (may be referred to as the active state for short): it is used to indicate that the application is in the running state.
  • the active state may include but is not limited to running in the foreground or running in the background.
  • foreground operation may include but not limited to:
  • the foreground interface of the mobile phone in FIG. 9 (1) only includes the news interface 501 of the browser application, and the browser application is the only application running in the foreground.
  • the application corresponding to the application interface in the picture-in-picture is running in the foreground, or the application corresponding to the application interface in the floating window is running in the foreground.
  • the application is in a frozen state (which can be referred to as a frozen state for short): one way can describe the frozen state as a doze (drowse, dormant) state; the other way can also be that after the application enters the background (as a background application), it remains in the background During the predetermined period of running, there is no data interaction with any module (for example, the CPU is no longer called), so no application data is generated to describe the state of the application.
  • a frozen state which can be referred to as a frozen state for short
  • the application data is used to represent any data generated by the application program.
  • the music application may continue to perform data interaction with the audio driver to generate audio data. For example, if the music application continues to play music in the background, the music application is still active in the background, which belongs to the situation of running in the background.
  • the browser application does not generate application data for more than 30 seconds after switching from the foreground to the background, it can be determined that the browser application is in a frozen state in the background, which belongs to the situation of not running in the background.
  • the application installed in the mobile phone defaults to interact with the server through the Wi-Fi network connected to the mobile phone, and does not apply for the cellular network, making the cellular network of the mobile phone In cellular disconnection state.
  • the mobile phone is connected to the router through Wi-Fi data according to the method shown in Figure 3a(1), but not connected to the base station through a cellular channel.
  • the cellular state is the cellular disconnected state during the time period ⁇ t1.
  • the application program 1 and the application program 2 of the mobile phone are both active, for example, the application program 1 and the application program 2 are both running in the foreground, and use the Wi-Fi network to communicate with the server for data.
  • the application program 1 needs to apply for the use of the cellular network because it meets the preset conditions.
  • the preset conditions may include but are not limited to: business needs, Wi-Fi -Fi signal quality is poor, and the Wi-Fi channel is occupied more, resulting in slower data transmission, and encrypted data needs to be transmitted.
  • the application program 1 may send a first cellular request to the connection service module (hereinafter referred to as the connection service module).
  • the connection service module hereinafter referred to as the connection service module
  • connection service module may store the received first cell request from application 1 in a first data structure, wherein the first data structure may be used to store the cell request of the application actively applying for a cell.
  • the request sequence number of the cellular request of each application is unique, and the request sequence numbers of the cellular requests of different applications are different.
  • the data structures described herein may include, but are not limited to: linked lists, arrays, vectors, XML files, variables, key-value pairs, queues, stacks , trees, heaps, hash tables, etc.
  • the first data structure here may be a linked list, and the cellular request may be stored in the linked list.
  • the first cellular request may include but not limited to the following parameters: the type of the applied network (here, a cellular network), the application type identifier used to identify the application type of the application program 1 (for example, whether it is a third-party application), package name etc.
  • the type of the applied network here, a cellular network
  • the application type identifier used to identify the application type of the application program 1 for example, whether it is a third-party application
  • package name etc.
  • the connection service module may instruct the Modem to establish a cellular connection
  • the Modem can respond to the instruction to enable the radio frequency related to the cellular, so that the cellular connection is established between the Modem and the base station.
  • the Modem may send a command for enabling a cellular-related radio frequency to the modem processor at the hardware side, and the modem processor may send a radio frequency signal to establish a cellular connection with the base station.
  • the mobile phone not only connects to the router through Wi-Fi data, but also establishes a cellular connection with the base station (that is, the cellular channel between the mobile phone and the base station is in a connected state), so that the mobile phone supports dual network communication.
  • the mobile phone after time t1, the mobile phone not only connects to the router through Wi-Fi data, but also establishes a cellular connection with the base station. For example, after the application program 1 applies for a cellular at time t1, the cellular state of the mobile phone is switched from the cellular disconnected state to the cellular connected state.
  • the application program 1 applies for a cellular connection to establish a cellular connection between the mobile phone and the base station, that is, the cellular channel between the Modem of the mobile phone and the base station is opened and is in a connected state.
  • the connection service module can control to switch the network path used by the application program 1 from being connected to the Wi-Fi channel to being connected to the cellular channel, and the application program 1 can use the cellular channel for data communication at time t1.
  • the application program 2 can use the Wi-Fi path for data communication;
  • the quality is poor, the default condition can also include other conditions listed above, which will not be repeated here), using the cellular network, but the application program 2 does not send a cellular request to the connection service module, but sends a monitoring request to the connection service module .
  • the monitoring request is used to monitor whether the cellular path between the Modem and the base station is opened, that is, to monitor the cellular state; the connection service module can respond to the monitoring request to monitor whether the cellular path between the Modem and the base station is opened, if not opened, then The connection service module continues to monitor the Modem; if the connection service module monitors from the Modem that the radio frequency related to the cellular has been turned on, it means that a cellular connection has been established between the Modem and the base station, and the cellular path between the mobile phone and the base station has been opened.
  • the connection service module can transfer the network path used by application program 2 from the network path used by application program 2 to Wi -Fi access connection, switch to cellular access connection. It can be seen from Fig. 4 that the application program 2 starts to use the cellular channel for data communication from time t2.
  • the application program 2 can also send a monitoring request to the connection service module after it is started, and then the application program 2 can start using the cellular channel at the time t1 when the application program 1 applies for the cellular network. data communication.
  • the connection service module can store the cellular status value, and The status value is updated according to the change of the cellular status.
  • the application program 1 applies for a cellular connection to establish a cellular connection between the mobile phone and the base station.
  • the connection service module can determine whether the cellular path between the Modem and the base station is opened from the stored cellular state value.
  • the connection service module can obtain the cellular state information without monitoring.
  • the application program 1 switches from the active state to the frozen state. For example, when the browser application is running in the foreground, the user switches the browser application to the background by clicking the home button of the mobile phone. If the browser application does not generate any data in the background for more than 30 seconds, it is determined that application 1 is at this moment (ie t3 time) in a frozen state.
  • the application program 1 can use the cellular channel for data communication during the time period t1-t3, and after the application program 1 is frozen at time t3, the application program 1 no longer needs to use the cellular channel for data communication.
  • the application program 1 applies for the cellular network at time t1
  • the cellular status of the mobile phone is always in the connected state. Even if the application program 1 switches from the active state to the frozen state at the time t3, the cellular status does not change.
  • the application program 2 can continue to use the cellular channel for data communication after the time t2, so that after the time t3, the application program 2 continues to use the cellular channel to cause the problem of continuous power consumption of the cell.
  • the dual-network concurrent scenario when some applications apply for the cellular network and use the cellular network, after the applications that apply for the cellular network are frozen, some applications that do not apply for the cellular network will use the cellular network for data interaction with the application server. The problem of increased power consumption of mobile phones.
  • the map application and the video application are originally using the Wi-Fi network for data communication.
  • the map application applies for the cellular network due to business needs, so that the cellular channel of the mobile phone is opened, and the network used by the map application is changed from the Wi-Fi network.
  • Switch to the cellular network then after the user switches the map application from the foreground to the background, if the map application does not generate any interactive data within a period of time after entering the background, for example, the map application does not interact with the CPU and does not trigger any action , it means that the Maps app is frozen in the background, causing the Maps app to stop using the cellular network.
  • the cellular channel of the mobile phone has been turned on, and the video application can switch the network from the Wi-Fi network to the cellular network without applying for the cellular network.
  • the video application can consume less time. Excessive cellular traffic, resulting in continuous power consumption of mobile phones.
  • an embodiment of the present invention provides a cellular network control method.
  • Fig. 5a is a schematic flowchart of an overall flow of a method for controlling a cellular network provided by an embodiment of the present application.
  • connection service module detects that the application program 1 is switched from the active state to the frozen state, and executes S601;
  • connection service module detects that the application program 1 is the last application that switches from the active state to the frozen state among the preset applications that have applied for the cellular network.
  • application 1 is the last application that has applied for and used the cellular network, wherein application 1 may have applied for and used the cellular network in the active state before switching from the active state to the frozen state.
  • the method may further include: S602.
  • connection service module backs up the first cellular request of the application program 1 in the first data structure.
  • the method may further include: S603.
  • connection service module deletes the first cellular request from the first data structure.
  • connection service module instructs the Modem to disconnect the cellular connection.
  • connection service module After the application program 1 is in the frozen state, the connection service module detects that the application program 1 switches from the frozen state to the active state, and can execute S701.
  • the connection service module instructs the Modem to establish a cellular connection.
  • connection service module After the application program 1 is in the frozen state, the connection service module detects that the application program 1 is switched from the frozen state to the closed state (that is, the process of the application program 1 is closed), and S801 may be executed.
  • connection service module deletes the first cellular request of the backup application 1.
  • connection service module restores the backup cellular request to the first data structure, and deletes the backup cellular request.
  • connection service module may rewrite the backed-up cellular requests of all applications that have applied for the cellular network into the first data structure, and delete all the backed-up cellular requests of applications that have applied for the cellular network.
  • connection service module instructs the Modem to establish a cellular connection.
  • 5b to 8 are schematic flowcharts of cellular network control methods provided by various embodiments of the present application.
  • FIG. 5a The method in FIG. 5a will be described in detail below with reference to FIG. 5b to FIG. 8 .
  • the connection service module judges whether there is a Wi-Fi data connection in the mobile phone
  • connection service module can determine whether the mobile phone is connected to the router through the Modem.
  • the mobile phone is connected to the router through a Modem, it means that the mobile phone has a Wi-Fi data connection; if the Modem of the mobile phone is not connected to the router, it means that the mobile phone does not have a Wi-Fi data connection;
  • the application in the mobile phone can exchange data with the application server through the Wi-Fi network.
  • the mobile phone can not only pass The Wi-Fi network interacts with the application server for data, and it can also interact with the application server through the cellular network, so that the mobile phone is in a dual-network connection environment.
  • application 1 has applied for the cellular network
  • application 1 and the server of application 1 interact through the cellular network
  • application 3 and application 4 perform data interaction with their respective application servers through the Wi-Fi network.
  • the mobile phone does not have a Wi-Fi data connection
  • the mobile phone uses the method of the embodiment of this application to control the cellular network
  • the state of the mobile phone will change due to the application of the cellular network. (that is, switching from the active state to the frozen state) and the disconnection of the cellular connection with the base station is not conducive to the user's use of the cellular network. Therefore, the mobile phone does not control the cellular network, and the process ends directly.
  • the connection service module may store a Wi-Fi status value, which includes a status value indicating whether there is a Wi-Fi data connection between the mobile phone and the router, for example, including a status value indicating the Wi-Fi connection status and Status value representing the Wi-Fi disconnected state. Then the connection service module can determine whether there is a Wi-Fi data connection in the mobile phone by querying the stored Wi-Fi status value.
  • connection service module determines whether there is a Wi-Fi data connection in the mobile phone is not limited to the above examples, and may also include other known ways of judging.
  • connection service module determines that the mobile phone has a Wi-Fi data connection, for example, when the mobile phone is connected to the router at home and can access the Internet wirelessly, then the connection service module can switch from the active state to the frozen state in the application program 1 In the case of , go to execute S101, otherwise, end directly.
  • connection service module can obtain the information that the application program 1 switches from the active state to the frozen state from the power consumption control module.
  • the connection service module can obtain various status information about the application from the power consumption control module.
  • the application program 1 may keep running in the background, or may not generate any action without generating application data and thus remain in a frozen state.
  • the power consumption control module detects that the application program 1 switches from the foreground to the background and keeps running in the background for a predetermined period of time (for example, 30s, which can be set according to actual needs, this application does not limit it)
  • no application data is generated.
  • the manner of determining that the application is switched from the active state to the frozen state is not limited to this example.
  • the power consumption control module detects that the application program 1 switches from the active state to the frozen state, it can notify the connection service module of the state change of the application program 1 .
  • FIG. 9 is a schematic diagram of an exemplary application scenario.
  • the mobile phone displays a news interface 501 of a browser application.
  • the news interface 501 includes one or more controls.
  • the implementation of the controls may include but not limited to: icons, buttons, windows, layers, etc.
  • the controls in the news interface 501 include but are not limited to a network icon 502, a battery icon, and a time icon.
  • both the Wi-Fi network switch and the 5G cellular network switch in the mobile phone system settings are turned on, and correspondingly, the network icon 502 may include a 5G cellular network icon 5021 and a Wi-Fi network icon 5022 .
  • the Wi-Fi network switch is turned off, the Wi-Fi network icon 5022 is no longer displayed in the network icon 502; optionally, if the 5G cellular network switch is turned off, the 5G cellular network icon 502 is no longer displayed.
  • Network icon 5021 if the Wi-Fi network switch is turned off, the Wi-Fi network icon 5022 is no longer displayed in the network icon 502; optionally, if the 5G cellular network switch is turned off, the 5G cellular network icon 502 is no longer displayed.
  • Network icon 5021 if the Wi-Fi network switch is turned off, the Wi-Fi network icon 5022 is no longer displayed in the network icon 502; optionally, if the 5G cellular network switch is turned off, the 5G cellular network icon 502 is no longer displayed.
  • the cellular network indicated by the cellular network icon may also be a 2G, 3G, 4G cellular network, or a cellular network higher than 5G level, which is not limited in this application.
  • the video application is using the Wi-Fi network for data communication
  • the cellular network was applied for and used, so that the mobile phone established a cellular connection with the 5G base station.
  • the 5G cellular network icon 5021 also includes an uplink and downlink identifier 50211 of the 5G cellular network.
  • both the uplink and downlink identifiers 50211 of the 5G cellular network and the uplink and downlink identifiers 50221 of the Wi-Fi network can be replaced with uplink identifiers or downlink identifiers.
  • the uplink identifier is used to indicate that the network data uploaded from the mobile phone to the application server is included
  • the downlink identifier is used to indicate the network data downloaded from the application server to the mobile phone
  • the uplink and downlink identifiers are used to identify the two directions including the mobile phone and the application server. network data interaction.
  • the user can slide upwards on the news interface 501 from the bottom edge of the news interface 501 in the direction of the arrow, and the mobile phone can receive the sliding operation, and in response to the sliding operation, the display interface of the mobile phone will Switch from the news interface 501 to the program interface 503 shown in FIG. 9(2).
  • the program interface 503 may include one or more controls, and the specific implementation manner of the controls may include but not limited to: icons, buttons, windows, layers, and the like.
  • the program interface 503 includes, but is not limited to: the thumbnail 504 of the news interface 501 of the browser application, and the thumbnail 506 of the communication interface of the information application.
  • the applications in the program interface 503 are not limited to the two applications exemplified here. Including more applications; the delete icon 505 displayed below each thumbnail in the program interface 503; the application icon and application name displayed above the thumbnail, for example, the application name corresponding to the thumbnail 504 is a browser, and the thumbnail
  • the application name corresponding to 506 is information; the floating window control 507 displayed above the thumbnail; and the network icon 502, the battery icon and the time icon.
  • the network icon 502 and its internal icons, as well as the battery icon and the time icon reference may be made to the description in FIG. 9(1), which will not be repeated here.
  • the delete icon 505 displayed below the thumbnail 504 is used to close all the processes of the started applications in the program interface 503 in response to user operations.
  • the floating window control 507 above the thumbnail 504 of the browser application is used to display the news interface 501 of the browser application in the floating window in response to user operations.
  • the user performs a finger click operation on the thumbnail 506 of the communication interface of the information application, and the mobile phone can respond to the finger click operation to switch the information application from the background application to the foreground application to run, while the browser application is switched from the foreground application to the background application, and the display interface of the mobile phone is switched from the program interface 503 to the communication interface 508 of the information application as shown in FIG. 9 (3).
  • the background application can generate application data and be in an active state, for example, a video application is downloading a video; the background application can also be in a frozen state without generating any data stream, for example, in Figure 9 (3), the browser application is switched from the foreground application for background applications.
  • the communication interface 508 may include one or more controls, and the specific implementation manner of the controls may include but not limited to: icons, buttons, windows, layers, and the like.
  • the communication interface 508 includes, but is not limited to, a network icon 502, a battery icon, a time icon, and the like.
  • a network icon 502 for the explanation of the network icon 502 and the specific icons inside it, as well as the battery icon and the time icon, reference may be made to the description of FIG. 9(1), which will not be repeated here.
  • the browser application may not switch from the active state to the frozen state immediately. It can be seen from Fig. 9(1), Fig. 9(2) and Fig. 9(3) that the 5G cellular network icon 5021 still displays the uplink and downlink signs 50211.
  • the connection service module can determine that the browser application switches from the active state to the frozen state.
  • the method continues to include:
  • connection service module judges whether the application program 1 has applied for the cellular network
  • the connection service module can also determine whether the application program 1 is a third-party application.
  • the application program 1 is a third-party application and has applied for a cellular network, go to S102.
  • connection service module can determine whether the application program 1 is a third-party application according to the preset application list or according to the system-level application type identification of the application program.
  • the preset application list may include package name information of third-party applications, or package name information of system applications, so that the package name of application 1 may be compared with the package name in the preset application list to determine Determine whether the application 1 belongs to a third-party application;
  • the third-party application may also have the above-mentioned application type identifier, which is used to identify whether the application is a third-party application.
  • an application pre-installed on the mobile phone that cannot be deleted may be used as a system application, and applications other than the system application may be used as third-party applications.
  • connection service module can determine whether the application program 1 is a third-party application by acquiring the application type identifier of the application program 1 .
  • connection service module For the connection service module to determine whether application 1 has applied for a cellular network, refer to the process of applying for a cellular network for application 1 in FIG. A cellular request is saved to the first data structure. Then the connection service module can determine whether the application program 1 has applied for a cellular network by querying whether the first cellular request of the application program 1 exists in the first data structure. If the first cellular request of application 1 exists in the first data structure, the connection service module determines that application 1 has applied for the cellular network; on the contrary, if the first cellular request of application 1 does not exist in the first data structure, the connection service module The service module determines that the application program 1 has not applied for the cellular network.
  • connection service module can determine the cellular request initiated by the application program 1 according to the request serial number of the cellular request stored in the first data structure.
  • connection service module determines that application 1 is not a third-party application, for example, it is a system application, or that application 1 has not applied for a cellular network, or that application 1 is a system application and If you have not applied for a cellular network, go directly to the application program 1 in a frozen state, that is, you do not need to do the processing of the method of the embodiment of this application.
  • the connection service module in the embodiment of the application will recycle the cellular network that the third-party application has applied for and disconnect Cellular connection, to avoid the problem of power consumption caused by other applications that have not applied for the cellular network to use the cellular network.
  • the business faced is at the system level, and the business at the system level is more critical.
  • the connection service module may not recycle the cellular connection and control the disconnection of the cellular connection for the system application.
  • the process of reclaiming the cellular connection by the connection service module may include deleting the cellular request from the original first data structure by the connection service module.
  • connection service module determines that the application program 1 is not only a third-party application, but also has applied for a cellular network, go to S102;
  • connection service module may not judge whether Application 1 is a third-party application.
  • the connection service module may not judge whether Application 1 is a third-party application.
  • regardless of whether Application 1 is a third-party application as long as the application is dynamically switched from active to Before the frozen state, the cellular network has been applied in the active state, and the method of the embodiment of the present application can recycle the applied cellular request and control the disconnection of the cellular connection.
  • connection service module backs up the first cellular request of the application program 1 from the original first data structure to the second data structure;
  • the second data structure may be a linked list.
  • the connection service module can back up the first cellular request from the original linked list to another linked list.
  • connection service module when application 1 applies for a cell to the connection service module in the active state, the connection service module can save the first cell request of application 1 to the original first data structure; After the status, the connection service module can back up the first cellular request from the first data structure to the second data structure.
  • connection service module backing up the first cellular request to the second data structure is that after the application program 1 switches from the frozen state to the active state, the connection service module can use the backed up first cellular request to restore the recovered cellular request , and re-establish the disconnected cellular connection between the mobile phone and the base station.
  • the process of restoring the cellular connection by the connection service module may include: the connection service module rewrites the deleted cellular request from the original first data structure into the first data structure.
  • the first data structure and the second data structure may be the same type of data structure or different types of data structures.
  • data structures may include, but are not limited to: linked lists, arrays, vectors, XML files, variables, key-value pairs, queues, stacks, trees, heaps, hash tables, and the like.
  • the first data structure and the second data structure are of different types, for example, the first data structure may be a linked list, and the second data structure may be a queue.
  • first data structure and the second data structure are of the same type, for example, the first data structure may be a linked list, and the second data structure may be another linked list.
  • the connection service module may save the application's cell request in the first data structure. Only when there is a cellular request in the first data structure, the cellular connection between the mobile phone and the base station will be established; on the contrary, if there is no cellular request in the first data structure, the cellular connection between the mobile phone and the base station needs to be disconnected.
  • connection service module deletes the first cellular request from the original first data structure
  • connection service module may delete the first cellular request of the application program 1 from the first data structure.
  • the first data structure in the connection service module may include one or more data structures.
  • the types of the multiple first data structures may be the same or different.
  • the first data structure may be a linked list, and if multiple first data structures are of the same type, then the first cellular request may be stored in one or more linked lists.
  • the plurality of first data structures may include but not limited to: a first linked list in the connection service module, nai (also a linked list) corresponding to the first cellular request, and networkFactory (a linked list).
  • connection service module when the connection service module deletes the first cellular request from the original first data structure, it may delete the information about the first cellular request stored in the original linked lists. Exemplarily, the connection service module may delete the first cellular request from the first linked list, remove the nai corresponding to the first cellular request in the second linked list, and remove the networkFactory including the first cellular request in the third linked list.
  • connection service module judges whether the first cellular request is the last cellular request
  • each application that actively applies for the cellular network can send the application’s cellular request to the connection service module when applying for the cellular network, so that the connection service Cellular requests of multiple applications may be stored in the first data structure of the module.
  • the connection service module can perform the judgment step of S104 before disconnecting the cellular connection.
  • the connection service module may determine whether there is a cellular request in the first data structure by querying the first data structure. If there is no cellular request in the first data structure, the connection service module may determine that the first cellular request is the last cellular request, in other words, all applications actively applying for the cellular network have switched from the active state to the frozen state; if If there is at least one cellular request in the first data structure, the connection service module can determine that the first cellular request is not the last cellular request, in other words, there are other applications except application 1 that have applied for the cellular network in the active state And use the cellular network to interact with the application server for data, and these other applications are still active.
  • connection service module needs to traverse each first data structure to determine whether there is no cellular request in any of the first data structures. If there is no cellular request, it is determined that the first cellular request is the last cellular request.
  • connection service module judges that the first cell request is the last cell request, that is, all the applications applying for the cell have switched from the active state to the frozen state, the connection service module can instruct the Modem to close the cellular network, in other words, disconnect the Modem from the base station between cellular connections.
  • connection service module judges that besides the first cellular request, there is also a cellular request in the first data structure, that is, not all applications applying for the cellular network are in the frozen state, then directly enter the application program 1 is in the frozen state, and this application no longer do processing.
  • the connection service module can disconnect the cellular connection between the mobile phone and the base station, so as to ensure that after some applications applying for cellular are frozen, other active applications will not be affected.
  • a cellular application that has applied for use of the cellular network.
  • connection service module judges that the first cellular request is the last cellular request, then execute S106;
  • connection service module when there are multiple applications actively applying for a cell, after the first application actively applies for a cell, a cellular path is established between the Modem and the base station.
  • other applications for example, application program 3
  • the connection service module does not need to instruct the Modem to establish a cellular connection with the base station.
  • the connection service module can connect the network channel used by the application program 3 to the above-established cellular channel, so that the application program 3 uses the cellular network to perform data interaction with the application server.
  • the application determines that the cellular channel between the mobile phone and the base station has been opened, it will directly use the cellular channel without actively applying to the connection service module.
  • the number of applications actively applying for the cellular network generally does not exceed 3.
  • the method according to the embodiment of the present application may further include S105.
  • connection service module judges whether the network satisfies the first preset condition
  • connection service module when the connection service module determines that the first cellular request is the last cellular request, before instructing the Modem to disconnect the cellular connection with the base station, the connection service module can perform the network evaluation represented in this step, only when the network If the evaluation condition is met, the connection service module will execute S106; otherwise, it will directly jump to application 1 which is in a frozen state, and this application will not be processed.
  • the assessment content may include but not limited to at least one of the following:
  • Evaluation content 1 The connection service module judges whether the mobile phone network can switch from the dual connection of Wi-Fi and cellular to the single connection of Wi-Fi. Considering that switching from dual connection to single connection, there may be situations where the network cannot be switched normally, so it is necessary to evaluate whether the network can be switched normally;
  • Evaluation content 2 The connection service module judges whether the Wi-Fi single connection is available.
  • the Wi-Fi signal quality is extremely poor, and the mobile phone cannot use the Wi-Fi connection for data communication. That is to say, although the mobile phone is connected to the Wi-Fi of a local area network, the Wi-Fi network may not be able to perform network communication, making the Wi-Fi connection of the mobile phone unavailable;
  • the Wi-Fi data switch in the system settings may be disabled during the process of connecting the service module to execute the process shown in Figure 5b. The user shuts down, making the Wi-Fi connection unavailable.
  • connection service module will execute S106 only when the connection service module evaluates that the network can normally switch from the dual connection to the single connection, and the single connection is available.
  • the connection service module before the connection service module instructs the Modem to disconnect the cellular connection between the mobile phone and the base station, the connection service module can perform network evaluation, and only instruct the Modem to Disconnect the cellular connection to the base station. It can ensure that when the mobile phone switches from the dual connection of Wi-Fi and cellular to the single connection of Wi-Fi, the disconnection of the cellular connection will not affect the communication of the Wi-Fi channel, and the mobile phone can use the Wi-Fi channel for network communication, ensuring The mobile phone will not be affected by the disconnection of the cellular connection when surfing the Internet under Wi-Fi.
  • connection service module instructs the Modem to disconnect the cellular connection
  • connection service module may call rematch to implement this step.
  • rematch is used to send a command indicating disconnection of the cellular connection to the Modem.
  • the Modem after the Modem receives the above command sent by the connection service module, it can turn off the radio frequency related to the cell, thereby disconnecting the cell connection between the Modem of the mobile phone and the base station.
  • the cellular network will occupy resources, which will cause the application to use the cellular connection and cause a lot of power consumption of the mobile phone. Reduce some unnecessary applications to use the cellular network, thereby reducing the problem of increased power consumption caused by applications using the cellular network.
  • the mobile phone can recycle the cellular request of the application and disconnect the cellular connection between the mobile phone and the base station, so that the application is frozen After that, other applications that have not applied for the cellular network cannot continue to use the cellular connection, thereby saving the power consumption caused by the application using the cellular network, and achieving the effect of saving the power of the mobile phone.
  • the cellular network control method shown in FIG. 5b can be used to control the cellular network of the mobile phone.
  • FIG. Schematic diagram of state and application state.
  • FIG. 11 For ease of understanding, see FIG. 11 in comparison with FIG. 4 , and for the similarities between FIG. 11 and FIG. 4 , you can directly refer to the description of FIG. 4 , which will not be described in detail below.
  • the changes of the cellular state and application state in Fig. 11 are introduced below.
  • only one application that is, the application program 1 ) actively applies for the cellular network during the time period from t0 to t3 .
  • Both the application program 1 and the application program 2 are in an active state during the time period t0 ⁇ t1, such as running in the foreground or running in the background. If application 1 and application 2 use the network for data interaction with their respective application servers, they can use the Wi-Fi channel for data communication during the time period t0 ⁇ t1. Therefore, during the time period t0 ⁇ t1, the cellular status is cellular disconnected state;
  • application program 1 applies for a cell, so that the cell starts to be in a connected state at time t1. Then application 1 can start to use the actively applied cellular path for data communication at time t1;
  • the application program 2 starts to use the cellular path applied for by the application program 1 to perform data communication.
  • the application program 2 which originally used the Wi-Fi channel for data communication, started to use the established cellular connection between the Modem and the base station to communicate with the application server of the application program 2 without applying for a cellular network. communication.
  • application 2 can continue to use the cellular channel established by application 1 for cellular communication for data communication until application 1 switches from the active state to the frozen state;
  • the application 1 switches from the active state to the frozen state, for example, the application 1 switches from running in the foreground to running in the background, and after running in the background for a period of time, no application data is generated for more than 30 seconds.
  • the first cellular request of application 1 is the last cellular request, and the connection service module can not only delete the first cellular request of application 1 from the original first data structure , in order to achieve the purpose of reclaiming the cellular application, and also control the Modem to disconnect the cellular connection with the base station.
  • the cell is in the cell disconnected state.
  • App 2 can only use the cellular path applied for by App 1 for data communication during the time period t2 ⁇ t3, and cannot switch to the frozen t3 of App 1 After the time, continue to use the cellular channel for data communication, wherein, if the application program 2 needs to use the network at time t3, it can use the Wi-Fi network to perform data interaction with its application server.
  • the mobile phone can disconnect the cellular connection of the mobile phone when the application program 1 is switched from the active state to the frozen state, so as to avoid the power consumption caused by other applications that have not applied for the cellular connection to continue to use the cellular connection, thereby generating power consumption benefits.
  • the cellular network control method shown in FIG. 5b can be used to control the cellular network of the mobile phone.
  • FIG. Schematic diagram of cellular state and application state.
  • Application 1, application 2, and application 3 are all active during the time period t0 ⁇ t1. For example, application 1 and application 2 are running in the foreground, and application 3 is running in the background. If application 1 and application 2 1. If the application program 3 uses the network, they can use the Wi-Fi channel for data communication during the time period t0-t1. Then during the time period from t0 to t1, the cellular state of the mobile phone is the cellular disconnected state;
  • Application 1 applies for a cellular network at time t1, so that the cellular state of the mobile phone is in the cellular connection state from time t1, and application 1 starts to use the actively applied cellular channel for data communication at time t1;
  • the application program 2 applies for the cellular network. Since the application program 1 has already applied for the cellular network before the time t2, a cellular connection is established between the Modem and the base station. In addition, after the application 2 applies for the cellular at time t2, the application 2 can reuse the cellular connection established between the Modem and the base station due to the application 1 applying for the cellular to perform data communication.
  • the application program 3 starts to use the above-mentioned cellular connection for data communication;
  • the application program 1 is switched from the active state to the frozen state, and when the mobile phone is processed according to the flow in Fig. 1 cell request) is not the last cell request. Then the mobile phone will not disconnect the cellular connection between the Modem and the base station at the time t4, but only recycle the first cellular request, so the application program 3 can continue to use the cellular channel for data communication after the time t4; Application 1 uses the cellular channel for data communication during the period from time t1 when applying for the cellular network to time t4 when switching to the frozen state.
  • the application 2 switches from the active state to the frozen state, then when the mobile phone processes according to the flow in Figure 5b, since the application 1 and the application 2 that actively apply for the cellular network are switched from the active state during the time period t0 to t5 To the frozen state, the mobile phone can determine that the second cellular request of application 2 is the last cellular request that has not been recovered. At time t5, the mobile phone can disconnect the cellular connection between the Modem and the base station. Wherein, the cellular state of the mobile phone is the cellular connection state during the period of time t1-t5, but after time t5, the cellular state of the mobile phone is the cellular disconnection state.
  • the cellular state of the mobile phone is the cellular disconnected state, then the cellular path between the mobile phone and the base station has been disconnected.
  • the application program 3 uses the cellular path for data communication during the time period from t3 to t5.
  • the application program 3 cannot continue to use the cellular channel for data communication after time t5;
  • the application program 2 uses the cellular channel for data communication during the time period from t2 to t5.
  • the mobile phone starts to generate power consumption gains at time t5 when application 2 switches from the active state to the frozen state, until any one of the application 1 and application 2 recovers from the frozen state to the active state.
  • FIG. 6 is a schematic flowchart of a cellular network control method according to an embodiment of the present invention. Referring to FIG. 6 , after the flow in FIG. In the case of switching to the active state, the process shown in FIG. 6 can be executed.
  • the way the application enters the active state may include restarting the application process to enter the active state after the application process is closed, and may also include re-entering the foreground or running in the background after being frozen in the background to be in the active state.
  • the application that switches from the frozen state to the active state performs the recovery of the cellular connection and the opening of the cellular channel.
  • the power consumption control module can acquire the state information of the application program 1, and after the application program 1 switches from the frozen state to the active state, the power consumption control module can notify the connection service module of the state change of the application program 1.
  • the power consumption control module detects that the application program 1 has no data interaction with other modules in the background for more than 30s, the power consumption control module detects that the application program 1 is switched to the foreground, and then it can be determined that the application program 1 is switched from the frozen state to the active state. .
  • FIG. 10 is a schematic diagram of an exemplary application scenario, following the application scenario in Fig. 9, it can be seen that the browser application is in a frozen state after Fig. 9 (4) state.
  • FIG. 10(1) is a schematic diagram following FIG. 9(4).
  • the mobile phone displays the communication interface 508 of the information application.
  • the controls included in the communication interface 508 refer to the description in FIG. 9(4), and details will not be repeated here.
  • the program interface 509 may include one or more controls, and the specific implementation of the controls may include, but not limited to: icons, buttons, windows, layers, and the like.
  • the program interface 509 includes but is not limited to: the thumbnail 510 of the communication interface of the post-information application, and the thumbnail 511 of the news interface of the browser application.
  • the applications in the program interface 509 are not limited to the two applications exemplified here. More applications may be included; the delete icon 505 displayed below each thumbnail in the program interface 509; the application icon and application name displayed above the thumbnail, for example, the application name corresponding to the thumbnail 510 is information, and the thumbnail The application name corresponding to 11 is a browser; a floating window control 507 displayed above the thumbnail; and a network icon 502, a battery icon and a time icon.
  • the network icon 502 and the specific icons inside it, the battery icon and the time icon reference may be made to the description in FIG. 10(1), which will not be repeated here.
  • the delete icon 505 displayed below the thumbnail 510 is used to close the processes of all the started applications in the program interface 503 in response to user operations.
  • the floating window control 507 above the thumbnail 510 of the information application is used to display the display interface (here, the communication interface) of the information application in the floating window in response to user operations.
  • the user performs a finger click operation on the thumbnail 511 of the news interface of the browser application, and then the mobile phone can respond to the finger click operation to stop the browser application from being in the background.
  • the frozen state that produces any data is switched to the state of foreground operation (ie active state), and the display interface of the mobile phone is also switched from the program interface 509 to the news interface 501 of the browser application as shown in Figure 10 (3).
  • the connection service module in the mobile phone can execute the process shown in Figure 6 to instruct the Modem to establish a cellular connection with the base station, and activate the cellular radio frequency in the Modem After that, the cellular channel between the mobile phone and the base station can be opened.
  • the execution speed is very fast. From the user's perspective, after switching from Figure 10(2) to Figure 10(3), the user can directly see in the displayed Figure 10(3)
  • the 5G cellular network icon 5021 has displayed an uplink and downlink identifier 50211, which may indicate that the mobile phone and the base station are exchanging 5G cellular data through the cellular connection established between them.
  • the connection service module of the mobile phone can execute S201;
  • connection service module determines whether the application program 1 has backed up the cellular request
  • connection service module can also determine whether the application program 1 is a third-party application.
  • connection service module As for the specific manner of judging whether the application program 1 is a third-party application by the connection service module, reference may be made to the specific introduction in FIG. 5 b , which will not be repeated here.
  • connection service module can realize it by querying whether there is a cellular request of application 1 in the second data structure. If the connection service module determines that the second data structure If the first cellular request of application 1 exists in the structure, it means that the connection service module has backed up the cellular request of application 1. If the first cellular request of application 1 does not exist in the second data structure of the connection service module, it means that the connection service module The module has not backed up the cellular request of application 1.
  • connection service module executes S202; otherwise, it goes directly to the application program 1 is active, ending the process.
  • connection service module if the connection service module has backed up the cellular request of the application 1, the connection service module executes S202; otherwise, it directly goes to the application 1 is active, and ends the process.
  • connection service module writes the backup first cellular request into the original first data structure
  • connection service module can use the first cellular request backed up in the second data structure to rewrite the first cellular request into the first data structure to recover the cellular request.
  • connection service module deletes the backup first cellular request
  • connection service module may delete the cellular request about the application 1 backed up in the second data structure, that is, the first cellular request, to save storage space.
  • connection service module determines whether the cell is in a connection state
  • the state value of the cell can be stored in the connection service module. For example, if the value of the state value is 1, it means that the state of the cell is connected to the cell, and if the value of the state value is 0, it means that the state of the cell is disconnected ( i.e. not connected).
  • the connection service module can determine whether the cell is currently in the connection state by querying the state value.
  • the connection service module When the connection service module obtains the state value of the cell, it can obtain it from the Modem. Wherein, after the Modem turns on the radio frequency related to the cellular, the cellular connection is established between the Modem and the base station, then the Modem can report the information indicating that the cellular state is the cellular connection state to the connection service module; After related radio frequency, the cellular connection between the Modem and the base station is disconnected, then the Modem can report the information indicating that the cellular is disconnected to the connection service module. Wherein, the Modem can report the latest cellular state to the connection service module when the state of the cell changes, so that the connection service module can store the state value of the cell.
  • connection service module determines that the cellular state is the cellular connection state, it means that after the application 1 is frozen, there are other applications actively applying for the cellular, so that the cellular path between the Modem and the base station is blocked. Open, the cellular state is the cellular connection state, then the connection service module does not need to instruct the Modem to establish a cellular connection with the base station;
  • connection service module when the connection service module determines that the cellular state is the cellular disconnected state (that is, not in the connected state), it means that after the application program 1 is frozen, the cellular connection is still disconnected without being reconnected. If it is enabled, then the connection service module can execute S206 to instruct the Modem to establish a cellular connection.
  • connection service module may execute S205 to perform network evaluation.
  • connection service module judges whether the network satisfies the second preset condition
  • the network evaluation in this step can be performed. If the network evaluation meets the conditions, the connection service module can execute S206, otherwise, it directly jumps to the active state of the application program 1, and the application is no longer processed, and ends directly.
  • connection service module when the connection service module conducts network assessment, it may include but not limited to at least one of the following:
  • the connection service module judges whether the network can be switched from a single cellular connection to a dual connection of Wi-Fi and cellular. Among them, due to switching from a single connection to a dual connection, there may be situations where the network cannot be switched normally. Therefore, it is necessary to evaluate whether it is possible Do normal switching of the network;
  • connection service module judges that the network of the mobile phone cannot be switched from a single cellular connection to a dual connection of Wi-Fi and cellular, it determines that the network does not meet the second preset condition.
  • connection service module judges whether the cellular switch in the system setting is on
  • the connection service module judges whether the data network of the mobile phone is available.
  • connection service module determines that the network does not meet the second preset condition.
  • the connection service module can perform network evaluation.
  • the single connection of the cellular is switched to the dual connection of Wi-Fi and cellular, and the cellular switch in the system settings is on, and the data network of the mobile phone is available, then the connection service module can instruct the Modem to establish a cellular connection between the Modem and the base station, So that the cellular connection can be established normally, and when the mobile phone switches from the single connection of Wi-Fi to the dual connection of Wi-Fi and cellular, the establishment of the cellular connection will not affect the communication of the Wi-Fi channel, and the mobile phone can continue to use Wi-Fi
  • the channel is used for network communication to ensure that the mobile phone's Internet access under Wi-Fi is not affected by the establishment of a cellular connection.
  • connection service module instructs the Modem to establish a cellular connection
  • the connection service module may call rematch to implement this step.
  • rematch is used to send a command indicating establishing a cellular connection to the Modem.
  • the Modem After the Modem receives the above-mentioned command sent by the connection service module, it can turn on the radio frequency related to the cell to establish the cellular connection between the Modem of the mobile phone and the base station, and to start the cellular channel between the mobile phone and the base station for data communication.
  • the mobile phone after the application switches from the active state to the frozen state, the mobile phone can promptly recycle the cellular request of the application, and when all the applications that have applied for cellular are switched from the active state to the frozen state, the mobile phone can Close the cellular channel with the base station to reduce the power consumption caused by the application using the cellular channel; after the application that has applied for the cellular channel recovers from the frozen state to the active state, the mobile phone can return the cellular request received by the application release; and when the cell is not connected, the cell phone can re-establish the cell connection with the base station, so as to ensure that the application that has actively applied for the cell can continue to use the cell network.
  • the cellular network control method shown in FIG. 6 can be used to control the cellular network of the mobile phone.
  • FIG. Schematic diagram of state and application state.
  • FIG. 13 in comparison with FIG. 11 , and FIG. 11 is the same or similar to FIG. 13 , and the principles are similar, and will not be described in detail below.
  • the change of the application status and the cellular status during the time period t0-t3 is the same as that of FIG. 11 , and reference can be made to the introduction of FIG. 11 .
  • application 1 switches from the active state to the frozen state at time t3, for example, application 1 switches from the foreground to the background, and no application data is generated; then, application 1 switches from the frozen state to switch from the active state to the active state, for example, application 1 switches from not generating application data in the background to generating application data in the background;
  • the mobile phone can reconnect the cellular connection that was disconnected with the base station before time t4.
  • the connection service module can instruct the Modem to establish a cellular connection with the base station, then after the t4 moment, the cellular connection between the Modem and the base station is established again, and from the t4 moment, the cellular state of the mobile phone is a cellular connection state;
  • the application program 2 can monitor whether the Modem has established a cellular connection with the base station through the connection service module, then at time t4, after the cellular connection between the Modem and the base station is established, App 2 can continue to use the cellular connection for cellular data communications.
  • the connection service module controls the connection between the mobile phone and the base station.
  • the cellular channel is set to be disconnected, so that the mobile phone can generate power consumption benefits in the time period of t3-t4.
  • Application closing also known as application is closed
  • the closing of the application can be triggered by the user, for example, the user actively closes the foreground application or the background application to close the application; or the system triggers, For example, the system automatically shuts down a process because the process does not respond.
  • the state before the application is closed may include an active state or a frozen state.
  • the power consumption control module can notify the connection service module of the status information; the connection service module can obtain the status information of the application program 1 from the power consumption control module.
  • connection service module can execute S301;
  • connection service module judges whether the application program 1 is in a frozen state before closing
  • connection service module can obtain the status information of the application from the power consumption control module in real time, and the connection service module determines whether the application program 1 is in a frozen state before being closed according to the status information about the application program 1 .
  • the application program 1 is in the active state before closing, and the connection service module determines that the application program 1 is not in the frozen state before closing.
  • the method of this application does not perform cellular network control on the closed application after the activity, and the process of the method ends directly.
  • the browser application runs in the background. If the user slides the thumbnail 504 from the bottom edge of the thumbnail 504 to the top of the mobile phone with a finger, the mobile phone can close the browser application process corresponding to the thumbnail 504 in response to the sliding operation, and the browser The application can switch from the active state to the closed state, that is, the browser application is active before closing.
  • the application program 1 is in a frozen state before closing, then go to execute S302.
  • the browser application is currently in a frozen state in the background. If the user slides the thumbnail 511 toward the top of the mobile phone at the bottom edge of the thumbnail 511 on the news interface of the browser application, the mobile phone can respond to the sliding operation and display the progress of the browser application corresponding to the thumbnail 511. Close, then the browser application switches from the frozen state to the closed state, that is, the browser application is in the frozen state before closing.
  • connection service module judges whether the first cellular request of the application program 1 has been backed up;
  • connection service module can check whether there is a cell request of application 1 in the second data structure (wherein, the second data structure can be used to back up the cell request sent to the connection service module by the application actively applying for a cell), and if there is , it means that the connection service module has backed up the first cellular request of application 1, and if it does not exist, it means that the connection service module has not backed up the first cellular request of application 1.
  • the application program 1 is switched from the frozen state to the closed state, if the application program 1 has not applied for the cellular network before freezing.
  • the application program 1 is an application that directly uses the cellular network actively applied by other applications, then the cellular request of the application program 1 will not exist in the second data structure of the connection service module.
  • application 1 is not a third-party application, for example, application 1 is a system application
  • the mobile phone will not perform cellular network control on application 1 when executing the process in Figure 5b, then The first cellular request of the application program 1 will not exist in the second data structure of the connection service module. Then, in the case that the first cellular request of the application program 1 has not been backed up in the connection service module, the process ends directly.
  • connection service module In the case that application 1 has actively applied for a cell before freezing, the first cell request of the application can be backed up in the connection service module, then if the first cell request of application 1 has been backed up in the connection service module, Then the connection service module goes to execute S303.
  • the connection service module proceeds to execute S303.
  • connection service module deletes the backup first cellular request.
  • the data to be deleted by the application program 1 may include the first cellular request.
  • the first cellular request may exist in the original first data structure.
  • the application program 1 is in a frozen state before being closed, and the mobile phone has deleted the first cellular request of the application program 1 in the original first data structure by executing the process in FIG. 5b. Then after the application program 1 switches from the closed state to the active state again, the connection service module will not establish the connection between the mobile phone and the base station based on the first cell request in the first data structure when the application program 1 has not applied for a cell.
  • cellular connection
  • the first cellular request may also exist in the second data structure.
  • the application 1 is in a frozen state before it is closed, and the mobile phone can back up the first cellular request of the application 1 to the second data structure before the application 1 is closed by executing the process in FIG. 5 b.
  • the serial number of each cellular request of the application is unique and unchanged.
  • the connection service module can delete the first cellular request with the serial number of the application program 1 backed up in the second data structure to Make sure that App 1 can apply for the cellular network normally when it is active again after being closed.
  • the mobile phone can delete the backup cellular request of the application, wherein the backup cellular request is the The cellular request that is backed up when the active state switches to the frozen state. Then, after the application is closed, the mobile phone can delete the data and resources of the application to ensure that when the application is active again after the application is closed, it will not affect the application for the cellular network again.
  • Application closing also known as application is closed
  • the closing of the application can be triggered by the user, for example, the user actively closes the foreground application or the background application to close the application; or the system triggers, For example, the system automatically shuts down a process because the process does not respond.
  • the power consumption control module can self-check whether an abnormality occurs. If the power consumption control module self-checks and finds that it is abnormal, the power consumption control module will restart. sent to the connection service module, then the connection service module can execute S400.
  • the power consumption control module may determine that an abnormality occurs when the self-test meets a preset condition, and the preset condition may include but not limited to at least one of the following:
  • a process crash of the power consumption control module is detected
  • the power consumption control module may control the connection service module to execute the steps of the cellular network control method in FIG. 5b, so as to save power consumption of the mobile phone. Then when the power consumption control module is abnormal, the data operated by the connection service module in the mobile phone needs to be restored to the state before the operation of the connection service module. Therefore, after the power consumption control module is abnormal, the connection service module can execute S400 ⁇ S403.
  • connection service module writes the cellular requests of all backup applications into the original first data structure
  • connection service module inquires about the second data structure, if there is a cell request of the application in the second data structure, it means that the application has switched from the active state to the frozen state, and the connection service module executes the graph on the application. 5b, therefore, it is necessary to restore the application’s cellular request, that is, rewrite the application’s cellular request in the second data structure to the original first data structure; when the cellular request in the second data structure involves multiple applications , it is necessary to restore the cellular requests of multiple applications one by one.
  • connection service module deletes the cellular requests of all backup applications
  • the second data structure can be used to back up the cellular request sent to the connection service module when the third-party application switches from the active state to the frozen state and actively applies for the cellular network.
  • the connection service module can delete the data in the second data structure Stored cellular requests for each application are deleted.
  • connection service module determines whether the cell is in a connection state
  • the process ends; if the cellular state is the cellular disconnected state, the connection service module proceeds to execute S403.
  • connection service module judges whether the network satisfies the second preset condition
  • connection service module determines that the network does not satisfy the second preset condition, the process ends.
  • connection service module judges that the network satisfies the second preset condition, the connection service module proceeds to execute S404.
  • connection service module instructs the Modem to establish a cellular connection
  • the connection service module Since the power consumption control module controls the connection service module to execute the process in Figure 5b to close the cellular connection, it is necessary to restore the network after the power consumption control module is abnormal.
  • the connection service module instructs the Modem Establish a cellular connection to the base station.
  • the mobile phone may be able to restore the application's cellular request and the operation of the cellular network after the application switches from the active state to the frozen state, which may specifically include using the backup
  • the cellular request restore to the original first data structure, delete the backup cellular request, and re-establish the connection to the cellular network when the cellular network is closed, and the cellular request of the application can be activated after the power consumption control module is abnormal.
  • the performed operations are restored, and the cellular network connection status is restored to ensure that the original Wi-Fi and cellular dual connection network environment is not affected.
  • the electronic device includes hardware and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions in combination with the embodiments for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
  • FIG. 14 shows a schematic block diagram of an apparatus 300 according to an embodiment of the present application.
  • the apparatus 300 may include: a processor 301 and a transceiver/transceiving pin 302 , and optionally, a memory 303 .
  • bus 304 includes a power bus, a control bus and a status signal bus in addition to a data bus.
  • bus 304 includes a power bus, a control bus and a status signal bus in addition to a data bus.
  • the various buses are referred to as bus 304 in the figure.
  • the memory 303 may be used for the instructions in the foregoing method embodiments.
  • the processor 301 can be used to execute instructions in the memory 303, and control the receiving pin to receive signals, and control the sending pin to send signals.
  • the apparatus 300 may be the electronic device or the chip of the electronic device in the foregoing method embodiments.
  • This embodiment also provides a computer storage medium, the computer storage medium stores computer instructions, and when the computer instructions are run on the electronic device, the electronic device executes the steps of the above-mentioned related methods to realize the control of the cellular network in the above-mentioned embodiments method.
  • This embodiment also provides a computer program product, which, when running on a computer, causes the computer to execute the above related steps, so as to implement the cellular network control method in the above embodiment.
  • an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the cellular network control method in each method embodiment above.
  • the electronic device, computer storage medium, computer program product or chip provided in this embodiment is all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the corresponding method provided above The beneficial effects in the method will not be repeated here.
  • the disclosed devices and methods may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of modules or units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components can be combined or It may be integrated into another device, or some features may be omitted, or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
  • a unit described as a separate component may or may not be physically separated, and a component shown as a unit may be one physical unit or multiple physical units, which may be located in one place or distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
  • an integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods in various embodiments of the present application.
  • the aforementioned storage medium includes: various media that can store program codes such as U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk.
  • the steps of the methods or algorithms described in connection with the disclosure of the embodiments of the present application may be implemented in the form of hardware, or may be implemented in the form of a processor executing software instructions.
  • the software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (Random Access Memory, RAM), flash memory, read-only memory (Read Only Memory, ROM), erasable programmable read-only memory ( Erasable Programmable ROM, EPROM), Electrically Erasable Programmable Read-Only Memory (Electrically EPROM, EEPROM), registers, hard disk, removable hard disk, CD-ROM, or any other form of storage medium known in the art.
  • RAM Random Access Memory
  • ROM read-only memory
  • erasable programmable read-only memory Erasable Programmable ROM, EPROM
  • Electrically Erasable Programmable Read-Only Memory Electrically Erasable Programmable Read-Only Memory
  • registers hard disk, removable hard disk, CD-ROM, or any other form
  • An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium.
  • the storage medium may also be a component of the processor.
  • the processor and storage medium can be located in the ASIC. Additionally, the ASIC may be located in a network device. Of course, the processor and the storage medium can also exist in the network device as discrete components.
  • the functions described in the embodiments of the present application may be implemented by hardware, software, firmware or any combination thereof.
  • the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium.
  • Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another.
  • a storage media may be any available media that can be accessed by a general purpose or special purpose computer.

Landscapes

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

Abstract

本申请实施例提供了一种蜂窝网络的控制方法和电子设备,涉及终端设备技术领域,该方法包括:在电子设备通过Wi-Fi网络和蜂窝网络与应用服务器进行数据交互的情况下,所述蜂窝网络由第一应用申请并由第一应用和未申请蜂窝网络的第二应用使用,在第一应用作为最后一个申请并使用蜂窝网络的应用、且从前台切换至后台运行后,保持一定时长未生成应用数据,可断开蜂窝网络的通路,以防止未申请蜂窝网络的应用在电子设备存在Wi-Fi连接的情况下,继续使用蜂窝网络,从而节省双网环境下的手机电量。

Description

蜂窝网络的控制方法和电子设备
本申请要求于2021年12月31日提交中国国家知识产权局、申请号为202111678700.2、申请名称为“蜂窝网络的控制方法和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及终端设备技术领域,尤其涉及一种蜂窝网络的控制方法和电子设备。
背景技术
随着通信技术的发展,电子设备中应用程序的种类越来越多,使得应用与用户的生活也越来越密切。目前,大多数应用需要联网来提供服务,电子设备可提供Wi-Fi网络和蜂窝网络来供应用联网。
那么在手机中的不同应用分别使用蜂窝网络和Wi-Fi网络进行联网的场景下,可造成手机的持续耗电。
发明内容
为了解决上述技术问题,本申请提供一种蜂窝网络的控制方法和电子设备。在该方法中,在检测到最后一个申请并使用过蜂窝网络的应用,从前台切换到后台运行,并保持一定时长未生成应用数据的情况下,可断开蜂窝网络的通路,以防止未申请蜂窝网络的应用在电子设备存在Wi-Fi连接的情况下,继续使用上述应用申请的蜂窝网络,从而节省双网环境下的手机电量。
第一方面,本申请实施例提供一种蜂窝网络的控制方法,应用于电子设备,所述电子设备通过Wi-Fi网络和蜂窝网络与应用服务器进行数据交互,其中,所述蜂窝网络由第一应用申请,所述第一应用和第二应用通过所述蜂窝网络与各自的所述应用服务器进行数据交互。所述方法包括:
响应于接收到的第一用户操作,将运行在前台的所述第一应用切换至后台运行;
检测到所述第一应用保持在后台运行的预设时长内未生成应用数据,并且所述第一应用为最后一个申请过所述蜂窝网络且使用所述蜂窝网络的应用,断开所述电子设备的所述蜂窝网络的通路;
通过所述Wi-Fi网络与所述第二应用的应用服务器交互所述第二应用的数据。
示例性地,电子设备中一个应用在同一时刻可以使用一种网络与应用服务器进行数据交互,那么电子设备中的不同应用可分别通过Wi-Fi网络和蜂窝网络与各自的应用服务器进行数据交互。
示例性地,上述数据交互可用于表示上行数据交互,或下行数据交互,或上下行数据交互。
示例性地,第一应用使用所述蜂窝网络用于表示在电子设备检测到所述第一应用保持在后台运行的预设时长内未生成应用数据之前,第一应用可使用蜂窝网络与第一应用的应用服务器进行数据交互。
在本申请实施例中,在电子设备通过Wi-Fi网络和蜂窝网络进行双网连接的场景下,其中,所述蜂窝网络由第一应用申请,并由第一应用和未申请蜂窝网络的第二应用使用,在响应于用户操作将运行在前台的第一应用切换至后台运行后,检测到第一应用保持在后台运行的预设时长内未生成应用数据、且是最后一个申请并使用蜂窝网络的应用,那么可断开蜂窝网络的通路,以防止未申请蜂窝网络的第二应用在电子设备存在Wi-Fi连接的情况下,继续使用第一应用所申请的蜂窝网络,从而节省双网环境下的手机电量。
可选地,在一种可能的实施方式中,所述断开所述电子设备的所述蜂窝网络之后,所述方法还包括:
响应于接收到的第二用户操作,将保持在后台运行的所述预设时长内未生成应用数据的所述第一应用切换至前台运行;
连接所述电子设备的所述蜂窝网络的通路。
可选地,所述方法还包括:所述连接所述电子设备的所述蜂窝网络的通路之后,通过所述蜂窝网络与所述第一应用的应用服务器交互所述第一应用的数据。
示例性地,对于通过蜂窝网络来交互第一应用的数据的时机,本申请不做限制,具体时机由第一应用的业务需求而定,在第一应用需要联网来与应用服务器进行交互数据时,可通过蜂窝网络来实现。
可选地,在一种可能的实施方式中,所述检测到所述第一应用保持在后台运行的预设时长内未生成应用数据,并且所述第一应用为最后一个申请过所述蜂窝网络且使用所述蜂窝网络的应用之后,所述方法还包括:
将所述第一应用的第一蜂窝请求从第一数据结构删除;
其中,所述第一蜂窝请求用于申请所述蜂窝网络,所述第一数据结构用于存储预设应用的蜂窝请求,其中,所述预设应用为申请过所述蜂窝网络的应用。
可选地,在一种可能的实施方式中,
所述将所述第一应用的第一蜂窝请求从第一数据结构删除之前,所述方法还包括:
将所述第一蜂窝请求备份至第二数据结构;
所述连接所述电子设备的所述蜂窝网络的通路之前,所述方法还包括:
将所述第二数据结构中备份的所述第一蜂窝请求写入所述第一数据结构。
可选地,在一种可能的实施方式中,所述方法还包括:
响应于接收到的第三用户操作,将运行在前台的所述第三应用切换至后台运行,其中,所述蜂窝网络由所述第三应用申请,所述第三应用通过所述蜂窝网络与所述第三应用的应用服务器进行数据交互;
检测到所述第三应用保持在后台运行的所述预设时长内未生成应用数据,并且所述第三应用不是最后一个申请过所述蜂窝网络且使用所述蜂窝网络的应用,将所述第三应用的第二蜂窝请求从所述第一数据结构删除;
所述第二蜂窝请求用于申请所述蜂窝网络。
示例性地,在检测到所述第三应用保持在后台运行的所述预设时长内未生成应用数据时,还存在除第三应用之外的申请过所述蜂窝网络且还使用蜂窝网络的应用。
可选地,在一种可能的实施方式中,所述将所述第三应用的第二蜂窝请求从第一数据结构删除之前,所述方法还包括:
将所述第二蜂窝请求备份至第二数据结构。
可选地,在一种可能的实施方式中,所述将所述第三应用的第二蜂窝请求从第一数据结构删除之后,所述方法还包括:
响应于接收到的第四用户操作,将保持在后台运行的所述预设时长内未生成应用数据的所述第三应用切换至前台运行;
将所述第二数据结构中备份的所述第二蜂窝请求写入所述第一数据结构。
可选地,在一种可能的实施方式中,在将所述第二数据结构中备份的所述第一蜂窝请求写入所述第一数据结构之后,所述方法还包括:
将所述第一蜂窝请求从所述第二数据结构删除。
可选地,在一种可能的实施方式中,在将所述第二数据结构中备份的所述第二蜂窝请求写入所述第一数据结构之后,所述方法还包括:
将所述第二蜂窝请求从所述第二数据结构删除。
可选地,在一种可能的实施方式中,所述断开所述电子设备的所述蜂窝网络的通路之后,所述方法还包括:
响应于接收到的第四用户操作,将保持在后台运行的预设时长内未生成应用数据的所述第一应用进行关闭;
将所述第一蜂窝请求从所述第二数据结构中删除。
可选地,在一种可能的实施方式中,所述电子设备显示有表示所述Wi-Fi网络的第一图标和表示所述蜂窝网络的第二图标;
所述断开所述电子设备的所述蜂窝网络的通路之前,所述第二图标包括第二上行标识,和/或,第二下行标识;
所述第二上行标识用于表示所述电子设备通过所述蜂窝网络向所述应用服务器上传数据;
所述第二下行标识用于表示所述电子设备通过所述蜂窝网络从所述应用服务器下载 数据。
可选地,在一种可能的实施方式中,所述断开所述电子设备的所述蜂窝网络的通路之后,所述第一图标包括所述第一上行标识,和/或,所述第一下行标识,所述第二图标不包括所述第二上行标识和所述第二下行标识;
其中,所述第一上行标识用于表示所述电子设备通过所述Wi-Fi网络向所述应用服务器上传数据;
所述第一下行标识用于表示所述电子设备通过所述Wi-Fi网络从所述应用服务器下载数据。
可选地,在一种可能的实施方式中,所述连接所述电子设备的所述蜂窝网络的通路之后,所述第二图标包括所述第二上行标识,和/或,所述第二下行标识。
第二方面,本申请实施例提供一种电子设备。该电子设备包括:存储器和处理器,所述存储器和所述处理器耦合;所述存储器存储有程序指令,所述程序指令由所述处理器执行时,使得所述电子设备执行如第一方面以及第一方面的任意一种实施方式中的方法。
第二方面所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。
第三方面,本申请实施例提供了一种计算机可读介质,用于存储计算机程序,当所述计算机程序在电子设备上运行时,使得所述电子设备执行如第一方面以及第一方面的任意一种实施方式中的方法。
第三方面所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。
第四方面,本申请实施例提供了一种芯片,该芯片包括一个或多个接口电路和一个或多个处理器;所述接口电路用于从电子设备的存储器接收信号,并向所述处理器发送所述信号,所述信号包括存储器中存储的计算机指令;当所述处理器执行所述计算机指令时,使得所述电子设备执行如第一方面以及第一方面的任意一种实施方式中的方法。
第四方面所对应的技术效果可参见上述第一方面以及第一方面的任意一种实现方式所对应的技术效果,此处不再赘述。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为示例性示出的电子设备的结构示意图之一;
图2为示例性示出的电子设备的软件结构示意图;
图3a为示例性示出的手机的网络交互示意图;
图3b为示例性示出的手机的各模块的交互流程示意图;
图4为示例性示出的蜂窝状态和应用状态的示意图;
图5a为示例性示出的蜂窝网络控制方法的流程示意图;
图5b为示例性示出的蜂窝网络控制方法的流程示意图;
图6为示例性示出的蜂窝网络控制方法的流程示意图;
图7为示例性示出的蜂窝网络控制方法的流程示意图;
图8为示例性示出的蜂窝网络控制方法的流程示意图;
图9为示例性示出的应用场景示意图;
图10为示例性示出的应用场景示意图;
图11为示例性示出的一种本申请实施例的蜂窝状态和应用状态的示意图;
图12为示例性示出的一种本申请实施例的蜂窝状态和应用状态的示意图;
图13为示例性示出的一种本申请实施例的蜂窝状态和应用状态的示意图;
图14为本申请实施例提供的装置的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。
本申请实施例的说明书和权利要求书中的术语“第一”和“第二”等是用于区别不同的对象,而不是用于描述对象的特定顺序。例如,第一目标对象和第二目标对象等是用于区别不同的目标对象,而不是用于描述目标对象的特定顺序。
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
在本申请实施例的描述中,除非另有说明,“多个”的含义是指两个或两个以上。例如,多个处理单元是指两个或两个以上的处理单元;多个系统是指两个或两个以上的系统。
图1示出了电子设备100的结构示意图。应该理解的是,图1所示电子设备100仅是电子设备的一个范例,可选地,电子设备100可以为终端,也可以称为终端设备,终端可以为蜂窝电话(cellular phone),即手机,本申请不做限定。需要进一步说明的是,电子设备100可以具有比图中所示的更多的或者更少的部件,可以组合两个或多个的部 件,或者可以具有不同的部件配置。图1中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。
电子设备100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备,例如AR设备等。
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器, 也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160 还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及本申请实施例中的蜂窝网络的控制方法。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。在一些实施例中,音频模块170可以设置于处理器110中,或将音频模块170的部分功能模块设置于处理器110中。
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振 动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口195可以同时插入多张卡。所述多张卡的类型可以相同,也可以不同。SIM卡接口195也可以兼容不同类型的SIM卡。SIM卡接口195也可以兼容外部存储卡。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。
电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。
图2是本申请实施例的电子设备100的软件结构框图。
电子设备100的分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,连接服务模块(ConnectivityService,CS)以及功耗控制模块等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
连接服务模块,用于管理电子设备的网络连接,具体处理过程将在下面的实施例中进行详细说明。
功耗控制模块,用于管理应用程序的状态,以及对连接服务模块进行控制,在电子设备开机至关机的全过程中运行。
系统库与运行时层包括系统库和安卓运行时(Android Runtime)。系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。3D图形库用于实现三维图形绘图,图像渲染,合成和图层处理等。安卓运行时包括核心库和虚拟机。安卓运行时负责安卓系统的调度和管理。核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动、Modem(调制解调器)。
可以理解的是,图2示出的系统框架层、系统库与运行时层包含的部件,并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。
图3a为示例性示出的手机的网络交互示意图,图3b为示例性示出的本发明实施例的手机的各模块的交互流程示意图,图4为示例性示出与图3a和图3b关联的蜂窝状态和应用状态的示意图。
在对图3a、图3b以及图4进行详细说明之前,这里对图4所示的蜂窝状态和应用状态做简要描述:
蜂窝断开状态:用于表示手机与基站之间的蜂窝通路处于断开的状态;
蜂窝连接状态:用于表示手机与基站之间的蜂窝通路处于连接的状态;
应用处于活动状态(可简称为活动态):用于表示应用处于运行状态,该活动态可以 包括但不限于前台运行、或后台运行等。
其中,前台运行可包括但不限于:
作为唯一一个前台运行的应用在前台运行的场景,例如图9(1)中手机前台界面只包括浏览器应用的新闻界面501,浏览器应用作为唯一一个前台运行的应用。
作为至少两个前台运行的应用中的一个应用的场景,例如画中画内的应用界面对应的应用是前台运行情况,再如悬浮窗内的应用界面对应的应用是前台运行的情况等。
应用处于冷冻状态(可简称为冷冻态):一种方式可以以doze(瞌睡、休眠)状态来描述冷冻状态;另一种方式还可以以应用在进入后台(作为后台应用)后,在后台保持运行的预定时长内,没有与任何模块进行数据交互(例如不再调用CPU)从而没有产生任何应用数据来描述应用的该状态。
其中,应用数据用于表示应用程序所生成的任意数据。
示例地,例如音乐应用从前台切换至后台后,音乐应用可以继续与音频驱动进行数据交互,而产生音频数据。例如音乐应用在后台继续播放音乐,则音乐应用在后台仍旧处于活动态,属于在后台运行的情况。
示例地,例如浏览器应用从前台切换至后台后,超过30s,浏览器应用没有产生应用数据,则可以确定浏览器应用在后台处于冷冻态,属于在后台不运行的情况。
下面结合图3a、图3b和图4,对应用的网络使用流程作具体说明。
参照图3a(1),以电子设备为手机为例,在手机的蜂窝的数据开关和Wi-Fi的数据开关均开启的情况下,如果手机与路由器通过Wi-Fi数据连接,为了节省因使用蜂窝网络而导致的流量耗费过大的问题,手机中安装的应用程序(App,application)默认通过手机连接的Wi-Fi网络来与服务器进行数据交互,并不申请蜂窝网络,使得手机的蜂窝网络为蜂窝断开状态。
参照图4,在t0~t1(不包括t1时刻)时间段内,手机按照图3a(1)的方式,与路由器通过Wi-Fi数据连接,而没有与基站进行蜂窝通路的连接,手机在t0~t1时间段内蜂窝状态为蜂窝断开状态。其中,手机的应用程序1、应用程序2均处于活动状态,例如应用程序1、应用程序2均在前台运行,并使用Wi-Fi网络与服务器进行数据通信。
继续参照图4,在t1时刻,虽然手机与路由器通过Wi-Fi数据连接,但是应用程序1因满足预设条件而需要申请使用蜂窝网络,该预设条件可以包括但不限于:业务需要,Wi-Fi信号质量差,Wi-Fi通路被占用的较多导致数据传送较慢,需要传送加密性数据等。
应用程序1在申请使用蜂窝网络时,如图3b所示,应用程序1可以向连接服务模块(下文称连接服务模块)发送第一蜂窝请求。
示例地,连接服务模块可以将接收到的来自应用程序1的第一蜂窝请求保存在第一数据结构中,其中,第一数据结构可以用于存储主动申请蜂窝的应用的蜂窝请求。示例地,每个应用的蜂窝请求的请求序列号唯一,不同应用的蜂窝请求的请求序列号不同。
本文所述的数据结构(可包括这里的第一数据结构以及后文所述的第二数据结构)可以包括但不限于:链表、数组、向量、XML文件、变量、键值对、队列、栈、树、堆、散列表等。
示例性地,这里的第一数据结构可以是链表,蜂窝请求可以存储在链表中。
示例地,该第一蜂窝请求可以包括但不限于以下参数:所申请网络的类型(这里为蜂窝网络)、用于标识应用程序1的应用类型(例如是否是第三方应用)的应用类型标识、包名等。
如图3b所示,连接服务模块在接收到第一蜂窝请求之后,可以指示Modem建立蜂窝连接;
Modem可以响应于该指示来打开与蜂窝相关的射频,以使Modem与基站之间建立蜂窝连接。示例地,Modem可以发送用于打开与蜂窝相关的射频的命令至硬件侧的调制解调处理器,调制解调处理器可以发送射频信号来与基站建立蜂窝连接。如图3a(2)所示,手机不仅与路由器通过Wi-Fi数据连接,手机还与基站之间建立了蜂窝连接(即手机与基站之间的蜂窝通路处于连接状态),以使手机支持双网通信。
参照图4,在t1时刻之后,手机不仅与路由器通过Wi-Fi数据连接,还与基站之间建立蜂窝连接。示例地,应用程序1在t1时刻申请蜂窝之后,手机的蜂窝状态从蜂窝断开状态切换到蜂窝连接状态。
参照图4,在t1时刻,应用程序1申请蜂窝使手机与基站之间建立了蜂窝连接,也即,手机的Modem与基站之间的蜂窝通路被开启而处于连接状态。相应的,连接服务模块可以控制将应用程序1使用的网络通路从与Wi-Fi通路连接,切换到与蜂窝通路连接,应用程序1在t1时刻开始可以使用蜂窝通路进行数据通信。
继续参照图3b和图4,应用程序2在开始活动之后,在t2时刻之前,应用程序2可以使用Wi-Fi通路进行数据通信;在t2时刻应用程序2满足预设条件(例如Wi-Fi信号质量差,该预设条件还可以包括上文所列举的其他条件,这里不再赘述),使用蜂窝网络,但是应用程序2没有向连接服务模块发送蜂窝请求,而是向连接服务模块发送监听请求。该监听请求用于监听Modem与基站之间的蜂窝通路是否被开启,即监听蜂窝状态;连接服务模块可以响应于该监听请求,监听Modem与基站之间的蜂窝通路是否开启,如果没有开启,则连接服务模块继续监听Modem;如果连接服务模块从Modem处监听到与蜂窝相关的射频已打开,说明Modem与基站之间已经建立了蜂窝连接,手机与基站之间的蜂窝通路已开启。本示例中,由于在t1时刻因应用程序1申请蜂窝而使手机与基站之间的蜂窝连接已经建立,相应的,连接服务模块可以在t2时刻将应用程序2所使用的网络通路,从与Wi-Fi通路连接,切换到与蜂窝通路连接。从图4可以看到,应用程序2从t2时刻开始使用蜂窝通路进行数据通信。
可选地,在另一个实施例中,应用程序2也可以在启动后,就发送监听请求至连接服务模块,那么应用程序2就可以在应用程序1申请蜂窝的t1时刻就开始使用蜂窝通路进行数据通信。
可选地,在另一个实施例中,在Modem与基站建立蜂窝连接之后,可以将表示蜂窝状态为蜂窝连接状态的状态值上报至连接服务模块,那么连接服务模块可以存储蜂窝的状态值,以及根据蜂窝状态的变化,来更新该状态值。那么在t1时刻,应用程序1申请蜂窝使手机与基站之间建立了蜂窝连接,连接服务模块可以从存储的蜂窝的状态值,来确定Modem与基站之间的蜂窝通路是否开启,如果状态值为表示蜂窝连接状态的取值,则说明该蜂窝通路已开启;如果状态值为表示蜂窝断开状态的取值,则说明该蜂窝通路 处于关闭状态,即未开启。那么连接服务模块就可以不通过监听的方式,来获取蜂窝状态信息。
参照图4,在t3时刻,应用程序1从活动态切换至冷冻态。例如浏览器应用在前台运行时,用户通过点击手机的home按键,将浏览器应用切换至后台运行,在浏览器应用在后台中超过30s没有产生任何数据,则确定应用程序1在此刻(即t3时刻)处于冷冻态。
从图4可以看出,应用程序1在t1~t3时间段内可以使用蜂窝通路进行数据通信,在t3时刻应用程序1冷冻之后,应用程序1不再需要使用蜂窝通路进行数据通信。
应用程序1在t1时刻申请蜂窝之后,手机的蜂窝状态一直处于连接状态,即使在t3时刻应用程序1从活动态切换至冷冻态,该蜂窝状态也没有发生变化。那么应用程序2可以在t2时刻之后持续使用蜂窝通路进行数据通信,从而造成在t3时刻之后,因应用程序2持续使用蜂窝通路而导致蜂窝持续耗电的问题。在双网并发场景下,当某些应用申请蜂窝网络而使用蜂窝网络后,待申请蜂窝的应用冷冻后,会导致一些没有申请蜂窝网络的应用因使用蜂窝网络与应用服务器进行数据交互,而导致手机耗电量增加的问题。
示例地,地图应用、视频应用原本都在使用Wi-Fi网络进行数据通信,地图应用因业务需要而申请蜂窝网络,使得手机的蜂窝通路被开启,将地图应用所使用的网络从Wi-Fi网络切换到蜂窝网络;那么在用户将地图应用从前台运行切换到后台运行之后,如果地图应用在进入后台后的一段时间内没有产生任何交互数据,例如地图应用没有和CPU交互,也没有触发任何动作,则说明地图应用在后台处于冷冻态,使得地图应用暂停使用蜂窝网络。但是手机的该蜂窝通路已经被开启,视频应用则可以在不申请蜂窝的前提下,将所使用的网络从Wi-Fi网络切换到蜂窝网络,从而导致在地图应用冷冻后,视频应用可以消耗较多的蜂窝流量,造成手机持续耗电。
那么为了能够在双网并发场景下减少一些不必要的应用程序去使用蜂窝网络,从而降低因应用程序使用蜂窝网络而造成的耗电量,本发明实施例提供了一种蜂窝网络控制方法。
图5a为本申请实施例提供的一种蜂窝网络控制方法的整体流程示意图。
参照图5a,具体包括:
连接服务模块检测到应用程序1从活动态切换至冷冻态,执行S601;
S601,连接服务模块检测到应用程序1为申请过蜂窝网络的预设应用中最后一个从所述活动态切换至冷冻态的应用。
换言之,应用程序1为最后一个申请过蜂窝网络且使用过蜂窝网络的应用,其中,应用程序1可以在从活动态切换至冷冻态之前,在活动态申请并使用过蜂窝网络。
可选地,在S601之后,S604之前,该方法还可包括:S602。
S602,连接服务模块对第一数据结构中应用程序1的第一蜂窝请求进行备份。
可选地,在S602之后,S604之前,该方法还可包括:S603。
S603,连接服务模块将所述第一蜂窝请求从第一数据结构中删除。
S604,连接服务模块指示Modem断开蜂窝连接。
在应用程序1处于冷冻态之后,连接服务模块检测到应用程序1从冷冻态态切换至 活动态,可执行S701。
S701,连接服务模块指示Modem建立蜂窝连接。
在应用程序1处于冷冻态之后,连接服务模块检测到应用程序1从冷冻态态切换至关闭态(即应用程序1的进程关闭),可执行S801。
S801,连接服务模块删除备份的应用程序1的所述第一蜂窝请求。
在应用程序1处于冷冻态之后,功耗控制模块自检发生异常,可执行S901。
S901,连接服务模块将备份过的蜂窝请求恢复至第一数据结构,以及删除备份的蜂窝请求。
示例性的,连接服务模块可将备份过的全部申请过蜂窝网络的应用的蜂窝请求,重新写入第一数据结构,并将备份的全部申请过蜂窝网络的应用的蜂窝请求进行删除。
S902,连接服务模块指示Modem建立蜂窝连接。
图5b~图8为本申请各个实施例提供的蜂窝网络控制方法的流程示意图。
下面结合图5b~图8,来对图5a的方法进行详细阐述。
参照图5b,具体包括:
S100,连接服务模块判断手机是否存在Wi-Fi数据连接;
示例地,连接服务模块可以判断手机是否通过Modem与路由器连接。
例如,手机通过Modem与路由器连接,则说明手机存在Wi-Fi数据连接,如果手机的Modem没有与路由器连接,则说明手机不存在Wi-Fi数据连接;
其中,在手机存在Wi-Fi数据连接的情况下,手机中的应用可通过Wi-Fi网络与应用服务器进行数据交互,其中,在手机中的应用申请过蜂窝网络的情况下,手机不仅可通过Wi-Fi网络与应用服务器进行数据交互,还可通过蜂窝网络与应用服务器进行数据交互,使手机处于双网连接的环境中。
示例性地,应用程序1申请过蜂窝网络,应用程序1与应用程序1的服务器通过蜂窝网络进行交互,应用程序3、应用程序4通过Wi-Fi网络与各自的应用服务器进行数据交互。
在手机不存在Wi-Fi数据连接的情况下,考虑到手机只连接蜂窝网络进行网络通信,如果手机采用本申请实施例的方法进行蜂窝网络控制,会使手机因申请过蜂窝的应用的状态变化(即从活动态切换至冷冻态)而与基站之见的蜂窝连接断开,不利于用户对蜂窝网络的使用,因此,手机不进行蜂窝网络控制,流程直接结束。
示例地,连接服务模块可以存储Wi-Fi的状态值,该状态值包括用于表示手机与路由器之间是否存在Wi-Fi数据连接的状态值,例如包括表示Wi-Fi连接状态的状态值和表示Wi-Fi断开状态的状态值。那么连接服务模块可以通过查询存储的Wi-Fi的状态值,来确定手机是否存在Wi-Fi数据连接。
当然,对于连接服务模块判断手机是否存在Wi-Fi数据连接的方式并不限于上述举例,还可以包括已知的其他判断方式。
在连接服务模块确定手机存在Wi-Fi数据连接的情况下,示例地,在手机连接了家里的路由器能够进行无线上网的情况下,那么连接服务模块可以在应用程序1从活动态切换到冷冻态的情况下转至执行S101,否则直接结束。
其中,连接服务模块可以从功耗控制模块获取到应用程序1从活动态切换至冷冻态的信息。其中,连接服务模块可以从功耗控制模块获取到关于应用的各种状态信息。
示例地,功耗控制模块在检测到应用程序1从前台运行切换为后台后,应用程序1在后台可以保持运行,也可以不再产生任何动作而不产生应用数据进而保持冷冻态。本示例中,如果功耗控制模块检测到应用程序1从前台切换到后台,并且保持在后台运行的预定时长(例如30s,可以根据实际需求设置,本申请不做限制)内均没有产生应用数据,则可以确定应用程序1从活动态切换至冷冻态。当然,确定应用从活动态切换至冷冻态的方式不限于本示例。
那么在功耗控制模块检测到应用程序1从该活动态切换至冷冻态后,可以将应用程序1的状态变化通知连接服务模块。
对于申请蜂窝的应用从活动态切换至冷冻态的过程,图9为示例性示出的应用场景示意图。
参照图9(1),手机显示了浏览器应用的新闻界面501,该新闻界面501包括一个或多个控件,该控件的实现方式可以包括但不限于:图标、按钮、窗口、图层等。
如图9(1)所示,新闻界面501中的控件包括但不限于网络图标502、电池图标和时间图标等。
在图9中,手机系统设置中的Wi-Fi网络开关和5G蜂窝网络开关均处于开启状态,相应的,网络图标502可以包括5G蜂窝网络图标5021和Wi-Fi网络图标5022。可选地,如果Wi-Fi网络开关被关闭,则网络图标502中不再显示Wi-Fi网络图标5022;可选地,如果5G蜂窝网络开关被关闭,则网络图标502中不再显示5G蜂窝网络图标5021。
在其他实施例中,蜂窝网络图标所指示的蜂窝网络也可以是2G、3G、4G蜂窝网络、以及高于5G级别的蜂窝网络,本申请对此不做限制。
在本申请实施例中,例如视频应用在使用Wi-Fi网络进行数据通信,那么在图9(1)中,Wi-Fi网络图标5022包括Wi-Fi数据的上下行标识50221;而浏览器应用在手机前台运行过程中,因业务需求,申请并使用了蜂窝网络,使得手机与5G基站建立了蜂窝连接。那么5G蜂窝网络图标5021中还包括5G蜂窝网络的上下行标识50211。当然,在其他实施例中,不论是5G蜂窝网络的上下行标识50211,还是Wi-Fi网络的上下行标识50221均可以替换为上行标识或下行标识。
其中,上行标识用于表示包括从手机到应用服务器方向上传的网络数据,下行标识用于表示包括从应用服务器到手机方向下载的网络数据,上下行标识则用于标识包括手机与应用服务器双方向的网络数据的交互。
在图9(1)中,用户可以从新闻界面501的底部边缘,按照箭头方向在新闻界面501上进行向上滑动操作,手机可以接收该滑动操作,并响应于该滑动操作,将手机的显示界面从新闻界面501切换至图9(2)所示的程序界面503。
其中,该程序界面503可以包括一个或多个控件,该控件的具体实现方式可以包括但不限于:图标、按钮、窗口、图层等。
程序界面503包括但不限于:浏览器应用的新闻界面501的缩略图504、信息应用的通讯界面的缩略图506,当然,程序界面503中的应用并不限于这里举例的两个应用,还 可以包括更多的应用;显示在程序界面503中每个缩略图下方的删除图标505;显示在所述缩略图上方的应用图标和应用名称,例如缩略图504对应的应用名称为浏览器,缩略图506对应的应用名称为信息;显示在所述缩略图上方的悬浮窗口控件507;以及网络图标502、电池图标和时间图标。其中,关于网络图标502及其内部的具体图标,以及电池图标和时间图标的解释可以参照图9(1)的描述,这里不再赘述。
如图9(2)所示,显示在缩略图504下方的删除图标505,用于响应于用户操作来关闭程序界面503中所有启动的应用的进程。
浏览器应用的缩略图504上方的悬浮窗口控件507,用于响应于用户操作,将浏览器应用的新闻界面501在悬浮窗口中显示。
继续参照图9(2),在程序界面503,用户对信息应用的通讯界面的缩略图506进行手指单击操作,则手机可以响应于该手指单击操作,将信息应用从后台应用切换到前台应用来运行,而浏览器应用则从前台应用切换为后台应用,手机的显示界面从程序界面503切换至如图9(3)所示的信息应用的通讯界面508。
其中,后台应用可以产生应用数据而处于活动态,例如视频应用在下载视频;后台应用还可以不产生任何数据流而处于冷冻态,例如在图9(3)中,浏览器应用从前台应用切换为后台应用。
示例地,通讯界面508可以包括一个或多个控件,该控件的具体实现方式可以包括但不限于:图标、按钮、窗口、图层等。
通讯界面508包括但不限于网络图标502、电池图标和时间图标等。关于网络图标502及其内部的具体图标、以及电池图标和时间图标的解释可以参照图9(1)的描述,这里不再赘述。
示例地,浏览器应用作为后台应用在进入后台之后,可以不立即从活动态切换至冷冻态。从图9(1)、图9(2)、图9(3)可以看出,5G蜂窝网络图标5021中仍旧显示有上下行标识50211。示例地,在浏览器应用在图9(1)中作为前台应用,在图9(3)中切换为后台应用之后,如果功耗控制模块检测到浏览器应用进入后台(即从显示图9(3)的通讯界面508开始)后持续30s内没有任何动作也没有产生数据,则连接服务模块可以确定浏览器应用从活动态切换至冷冻态。
继续参照图5b的流程示意图,在应用程序1从活动态切换至冷冻态之后,该方法继续包括:
S101,连接服务模块判断应用程序1是否申请过蜂窝网络;
可选地,在应用程序1从活动态切换至冷冻态后,连接服务模块还可以判断应用程序1是否是第三方应用。
在应用程序1是第三方应用以及申请过蜂窝网络的情况下,转至S102。
示例地,连接服务模块可以根据预设应用列表,或者根据应用程序的系统级别的应用类型标识,来判断应用程序1是否是第三方应用。
示例地,预设应用列表可以包括第三方应用的包名信息,或者包括系统应用的包名信息,从而可以通过将应用程序1的包名与预设应用列表中的包名进行比对,来判断该应用程序1是否属于第三方应用;
示例地,第三方应用还可以具有上文所述的应用类型标识,用于标识该应用是否是第三方应用。
示例地,可以将手机预装的不可以删除的应用作为系统应用,将除该系统应用之外的应用作为第三方应用。
例如,连接服务模块通过获取应用程序1的应用类型标识,可以确定应用程序1是否为第三方应用。
对于连接服务模块判断应用程序1是否申请过蜂窝网络,参照对图3b中应用程序1申请蜂窝的流程可知,应用程序1在向连接服务模块申请蜂窝后,连接服务模块可以将应用程序1的第一蜂窝请求保存到第一数据结构。那么连接服务模块可以通过查询第一数据结构中是否存在应用程序1的第一蜂窝请求,来确定应用程序1是否申请过蜂窝。如果第一数据结构中存在应用程序1的第一蜂窝请求,则连接服务模块确定应用程序1申请过蜂窝网络;相反,如果第一数据结构中不存在应用程序1的第一蜂窝请求,则连接服务模块确定应用程序1没有申请过蜂窝网络。
由于每个应用的蜂窝请求的请求序列号唯一,且不同应用的蜂窝请求的请求序列号不同。那么连接服务模块可以依据第一数据结构中保存的蜂窝请求的请求序列号,来确定应用程序1所发起的蜂窝请求。
可选地,在一种实施方式中,如果连接服务模块确定应用程序1不是第三方应用,例如为一个系统应用,或者,应用程序1没有申请过蜂窝网络,或者,应用程序1为系统应用且没有申请过蜂窝网络,则直接转至应用程序1处于冷冻态,即不需要做本申请实施例的方法的处理。
在本申请实施例中,只有第三方应用(非系统应用)主动申请蜂窝网络进行通信,本申请实施例的连接服务模块才会对该第三方应用所申请过的蜂窝网络进行回收,并断开蜂窝连接,来避免其他未申请蜂窝的应用使用该蜂窝网络而造成耗电的问题。考虑到系统应用,所面临的业务是系统层面的,该系统层面的业务更加关键。在系统应用申请蜂窝后,连接服务模块可以不对系统应用做蜂窝连接的回收和断开蜂窝连接的管控。其中,关于连接服务模块对蜂窝连接的回收的处理可以包括连接服务模块将蜂窝请求从原始的第一数据结构中删除。
可选地,在另一种实施方式中,如果连接服务模块确定应用程序1不仅是第三方应用,而且还申请过蜂窝网络,则转至执行S102;
可选地,在又一种实施方式中,连接服务模块可以不对应用程序1进行是否是第三方应用的判断,换言之,不论应用程序1是否是第三方应用,只要应用程序在从活动态切换至冷冻态之前,在活动态申请过蜂窝网络,本申请实施例的方法,就可以对应用的蜂窝请求进行回收以及进行断开蜂窝连接的管控。
可选地,S102,连接服务模块将应用程序1的第一蜂窝请求从原始的第一数据结构备份至第二数据结构;
示例性地,第二数据结构可以是一个链表。连接服务模块可将第一蜂窝请求从原始的链表中备份到另一个链表中。
其中,应用程序1在处于活动态向连接服务模块申请蜂窝时,连接服务模块可以将 应用程序1的第一蜂窝请求保存至原始的第一数据结构;那么在应用程序1从活动态切换至冷冻态后,则连接服务模块可以将第一蜂窝请求从第一数据结构备份至第二数据结构。
连接服务模块将第一蜂窝请求备份至第二数据结构的目的在于,在应用程序1从冷冻态切换会活动态后,连接服务模块可以利用备份的第一蜂窝请求来对回收的蜂窝请求进行恢复,并对手机与基站之间断开的蜂窝连接进行重新建立。关于连接服务模块对蜂窝连接的恢复的处理可以包括:连接服务模块将从原始的第一数据结构中删除的蜂窝请求重新写入第一数据结构。
示例地,第一数据结构和第二数据结构可以为相同类型的数据结构或者不同类型的数据结构。
如上文所述,数据结构可以包括但不限于:链表、数组、向量、XML文件、变量、键值对、队列、栈、树、堆、散列表等。
在一个示例中,第一数据结构和第二数据结构的类型不同,例如第一数据结构可以是链表,第二数据结构可以是队列。
在另一个示例中,第一数据结构和第二数据结构的类型相同,例如第一数据结构可以是链表,第二数据结构可以是另一个链表。
在应用主动申请蜂窝时,连接服务模块可以将该应用的蜂窝请求保存在第一数据结构中。在第一数据结构中存在蜂窝请求的情况下,手机和基站才会建立蜂窝连接;相反,如果第一数据结构中不存在蜂窝请求,则手机与基站之间的蜂窝连接需要断开。
可选地,S103,连接服务模块将第一蜂窝请求从原始的第一数据结构删除;
其中,为了释放蜂窝网络,连接服务模块可以将应用程序1的第一蜂窝请求从第一数据结构中删除。
可选地,连接服务模块中的第一数据结构可以包括一个或多个数据结构。
其中,多个第一数据结构的类型可以相同或不同。
示例性地,第一数据结构可以是链表,多个第一数据结构的类型相同,那么第一蜂窝请求可以存储在一个或多个链表中。
示例性地,多个第一数据结构可以包括但不限于:连接服务模块中的第一链表、与第一蜂窝请求对应的nai(也是一种链表)、networkFactory(一种链表)。
那么连接服务模块在将第一蜂窝请求从原始的第一数据结构删除时,可将从原始的多个链表中所存储的关于第一蜂窝请求的信息进行删除。示例性地,连接服务模块可以从第一链表删除第一蜂窝请求,移除第二链表内与第一蜂窝请求对应的nai,移除第三链表内包括第一蜂窝请求的networkFactory。
S104,连接服务模块判断第一蜂窝请求是否是最后一个蜂窝请求;
在不同场景下,可能存在一个或多个应用,通过主动申请蜂窝的方式来使用蜂窝网络。那么,在存在多个应用通过主动申请蜂窝的方式来使用了蜂窝网络时,则每个主动申请蜂窝网络的应用都可以在申请蜂窝时,发送该应用的蜂窝请求至连接服务模块,使得连接服务模块的第一数据结构中可以保存有多个应用的蜂窝请求。考虑到在存在多个应用申请蜂窝的场景下,不能因为单个应用从活动态切换到冷冻态,就直接将手机与基 站之间的蜂窝连接断开。那么连接服务模块在断开蜂窝连接之前,可进行S104的判断步骤。
示例地,连接服务模块可以通过查询第一数据结构来确定第一数据结构是否存在蜂窝请求。如果第一数据结构中不存在任何一个蜂窝请求,则连接服务模块可以确定第一蜂窝请求是最后一个蜂窝请求,换言之,所有主动申请蜂窝网络的应用程序都已经从活动态切换至冷冻态;如果查询到第一数据结构中存在至少一个蜂窝请求,则连接服务模块可以确定第一蜂窝请求不是最后一个蜂窝请求,换言之,还存在除应用程序1之外的其他应用程序在活动态申请过蜂窝网络且使用蜂窝网络与应用服务器进行数据交互,并且这些其他应用程序还处于活动态。
可选地,如果第一数据结构的数量为多个,则连接服务模块需要遍历每个第一数据结构来确定第一数据结构中是否均不存在蜂窝请求,如果多个第一数据结构中均不存在蜂窝请求,则确定第一蜂窝请求是最后一个蜂窝请求。
如果连接服务模块判断第一蜂窝请求是最后一个蜂窝请求,即所有申请蜂窝的应用都已经从活动态切换至冷冻态,则连接服务模块可以指示Modem关闭蜂窝网络,换言之,断开Modem与基站之间的蜂窝连接。
如果连接服务模块判断除第一蜂窝请求之外第一数据结构中还存在蜂窝请求,即并不是所有申请蜂窝网络的应用都处于冷冻态,则直接进入应用程序1处于冷冻态,本申请不再做处理。
在本申请实施例中,在所有申请蜂窝的应用都冷冻后,连接服务模块可以断开手机与基站之间的蜂窝连接,这样可以确保在部分申请蜂窝的应用冷冻后,不影响其他处于活动态的已申请蜂窝的应用对蜂窝网络的使用。
本实施例中,在连接服务模块判断第一蜂窝请求是最后一个蜂窝请求的情况下,则执行S106;
另外,需要说明的是,在存在多个应用主动申请蜂窝时,则在首个应用主动申请蜂窝后,Modem与基站之间建立了蜂窝通路。待其他应用(例如应用程序3)再向连接服务模块主动申请蜂窝时,连接服务模块无需再指示Modem与基站建立蜂窝连接。连接服务模块可以将应用程序3使用的网络通路连接到上述建立的蜂窝通路,来使应用程序3使用蜂窝网络与应用服务器进行数据交互。
可选地,在大多数场景下,大多数应用在需要使用蜂窝网络时,如果应用确定手机与基站之间的蜂窝通路已经开启,就直接使用该蜂窝通路,而不再向连接服务模块主动申请蜂窝网络,相应的,主动申请蜂窝网络的应用的数量一般不超过3个。
可选地,在S106之前,根据本申请实施例的方法还可包括S105。
S105,连接服务模块判断网络是否满足第一预设条件;
其中,连接服务模块在确定第一蜂窝请求是最后一个蜂窝请求的情况下,在指示Modem断开与基站之间的蜂窝连接之前,连接服务模块可以做本步骤所表示的网络评估,只有在网络评估满足条件的情况下,连接服务模块才会执行S106,否则直接跳转到应用程序1处于冷冻态,本申请不再做处理。
这里连接服务模块在进行网络评估时,评估的内容可以包括但不限于以下至少一项:
评估内容1:连接服务模块判断手机网络是否可以从Wi-Fi和蜂窝的双连接切换为Wi-Fi单连接。考虑到从双连接切换到单连接,可能会存在网络无法正常切换的情况,因此,需要评估是否可以做网络的正常切换;
评估内容2:连接服务模块判断Wi-Fi单连接是否可用。
例如Wi-Fi信号质量极差,而手机无法使用Wi-Fi连接进行数据通信。也就是说,虽然手机连接着某个局域网的Wi-Fi,但是可能该Wi-Fi网络并无法进行网络通信,使手机的Wi-Fi连接不可用;
再如,虽然在应用程序1从活动态切换至冷冻态时,手机连接着Wi-Fi网络,但是,可能在连接服务模块执行图5b的流程过程中,系统设置中的Wi-Fi数据开关被用户关闭,导致Wi-Fi连接不可用。
那么只有在连接服务模块评估网络可以从双连接正常切换到单连接、且单连接可用的情况下,连接服务模块才会执行S106。
在本申请实施例中,连接服务模块在指示Modem断开手机与基站之间的蜂窝连接之前,连接服务模块可以进行网络评估,在评估网络可以满足第一预设条件的情况下,才指示Modem断开与基站之间的蜂窝连接。可以确保手机从Wi-Fi和蜂窝的双连接下切换到Wi-Fi单连接时,断开蜂窝连接不会影响Wi-Fi通路的通信,且手机可以使用Wi-Fi通路进行上网络通信,保证手机在Wi-Fi下上网不受到断开蜂窝连接的影响。
S106,连接服务模块指示Modem断开蜂窝连接;
示例地,连接服务模块可以调用rematch来实现本步骤。其中,rematch用向Modem发送表示断开蜂窝连接的命令。
这样,Modem在接收到连接服务模块发送的上述命令之后,可以关闭与蜂窝相关的射频,从而断开手机的Modem与基站之间的蜂窝连接。
在S106之后,转至应用程序1处于冷冻态,结束流程。
示例地,继续回到图9,依次参照图9(1)、图9(2)图9(3),在浏览器应用从前台应用切换至后台应用而显示图9(3)的界面后,经过预定时长(例如30s)浏览器应用没有任何操作,则说明浏览器应用从活动态进入冷冻态,从而执行图5b所示的流程。在用户角度,在手机显示图9(3)的界面之后,经过一段时间(例如30s)则切换至图9(4)所示的界面,对比图9(3)和图9(4)可以发现,主动申请蜂窝网络的浏览器应用从活动态切换至冷冻态,使得上述Modem断开了与基站之间的蜂窝连接,因此手机与基站之间不再存在5G蜂窝数据的交互,从图9(4)可以看出,5G蜂窝网络图标5021中的上下行标识50211不再显示。
考虑到在Wi-Fi通路启动的场景下,如果应用再连接蜂窝网络,则蜂窝网络会占用资源,从而导致应用使用蜂窝连接而导致手机耗电量增大很多,那么为了在双网并发场景下减少一些不必要应用去使用蜂窝网络,从而降低因应用使用蜂窝网络而造成的耗电量增大的问题。在本申请实施例中,在主动申请蜂窝网络的应用从活动态切换至冷冻态后,手机可以对该应用的蜂窝请求进行回收以及断开手机与基站之间的蜂窝连接,从而在该应用冷冻后,其他未申请蜂窝的应用无法继续使用该蜂窝连接,进而节省因应用使用蜂窝网络而带来的耗电量,达到节省手机电量的效果。
需要说明的是,本申请对于图5b中S102和S104的执行顺序不做限制。
在一种可能的实施方式中,可以采用图5b所示的蜂窝网络控制方法来对手机进行蜂窝网络控制,图11为示例性示出的经过图5b所示的方法进行蜂窝网络控制后的蜂窝状态和应用状态的示意图。
为了便于理解,可以对比于图4,来看图11,且图11与图4相同之处,可以直接参照图4的描述,下文不再详细阐述。下面介绍图11的蜂窝状态和应用状态的变化。
在图11的实施方式中,在t0~t3时间段内只有一个应用(即应用程序1)主动申请了蜂窝网络。
在t0~t1时间段内应用程序1和应用程序2均处于活动态,例如前台运行,或后台运行等状态。如果应用程序1和应用程序2使用网络与各自的应用服务器进行数据交互,则在t0~t1时间段内可以使用Wi-Fi通路进行数据通信,因此,t0~t1时间段内,蜂窝状态为蜂窝断开状态;
在t1时刻应用程序1申请蜂窝,使得蜂窝在t1时刻开始处于连接状态。那么应用程序1可以在t1时刻开始使用主动申请的蜂窝通路进行数据通信;
在t2时刻应用程序2开始使用应用程序1所申请的蜂窝通路进行数据通信。其中,在t2时刻,原本使用Wi-Fi通路进行数据通信的应用程序2,在未申请蜂窝的情况下,开始使用Modem与基站之间已经建立的蜂窝连接来与应用程序2的应用服务器进行数据通信。从t2时刻开始,应用程序2可以持续使用因应用程序1申请蜂窝而建立的蜂窝通路进行数据通信,直到应用程序1从活动态切换至冷冻态;
在t3时刻,应用程序1从活动态切换至冷冻态,例如应用程序1从在前台运行切换至在后台运行,并在后台运行一段时间后,超过30s没有产生任何应用数据。那么参照图5b的流程可知,本实施方式中,应用程序1的第一蜂窝请求为最后一个蜂窝请求,连接服务模块不仅仅可以将应用程序1的第一蜂窝请求从原始的第一数据结构删除,以达到对蜂窝申请回收的目的,还可以控制Modem断开与基站之间的蜂窝连接。相应的,在图11中,从t3时刻开始,蜂窝处于蜂窝断开状态。由于手机与基站之间的蜂窝通路已经断开,应用程序2只可以在t2~t3时间段内使用应用程序1所申请的蜂窝通路进行数据通信,而无法在应用程序1切换至冷冻态的t3时刻之后,继续使用蜂窝通路进行数据通信,其中,应用程序2在t3时刻如果需要使用网络,则可以使用Wi-Fi网络与其应用服务器进行数据交互。本实施方式中,手机可以在应用程序1从活动态切换至冷冻态时,断开手机的蜂窝连接,避免其他未申请蜂窝的应用继续使用蜂窝连接带来的功耗,从而产生功耗收益。
在另一种可能的实施方式中,可以采用图5b所示的蜂窝网络控制方法来对手机进行蜂窝网络控制,图12为示例性示出的经过图5b所示的方法进行蜂窝网络控制后的蜂窝状态和应用状态的示意图。
为了便于理解,可以对比于图4、图11来看图12,下面详细介绍图12的蜂窝状态和应用状态的变化。
首先,区别于图4和图11的实施方式,在图12中,不仅将应用程序1作为一个主动申请蜂窝的应用,还将应用程序2作为一个主动申请蜂窝的应用,而应用程序3则是 未申请蜂窝而直接使用其他应用所申请的蜂窝网络的应用。
其次,在图11中,在应用程序1冷冻(在t3时刻冷冻)之前,只有一个应用(即应用程序1)主动申请了蜂窝网络,在图12的实施方式中,在应用程序1冷冻(在t4时刻冷冻)之前,存在两个应用(这里为应用程序1和应用程序2)主动申请了蜂窝网络。
下面详细介绍图12的流程:
在t0~t1时间段内应用程序1、应用程序2、应用程序3均处于活动状态,例如应用程序1、应用程序2在前台运行,应用程序3在后台运行,如果应用程序1、应用程序2、应用程序3使用网络,则在t0~t1时间段内它们可以使用Wi-Fi通路进行数据通信。那么t0~t1时间段内,手机的蜂窝状态为蜂窝断开状态;
在t1时刻应用程序1申请蜂窝,使得手机的蜂窝状态从t1时刻开始处于蜂窝连接状态,应用程序1在t1时刻开始使用主动申请的蜂窝通路进行数据通信;
在t2时刻应用程序2申请蜂窝,由于在t2时刻之前,应用程序1已经申请了蜂窝,使得Modem与基站之间建立了蜂窝连接。此外,应用程序2在t2时刻申请蜂窝后,应用程序2可以复用因应用程序1申请蜂窝而在Modem与基站之间建立的蜂窝连接进行数据通信。
在t3时刻应用程序3开始使用上述蜂窝连接进行数据通信;
在t4时刻应用程序1从活动态切换至冷冻态,那么手机按照图5b的流程进行处理时,由于手机还接收到了应用程序2的蜂窝请求,那么手机可以确定应用程序1的蜂窝请求(即第一蜂窝请求)并不是最后一个蜂窝请求。那么在t4时刻手机并不会断开Modem与基站之间的蜂窝连接,而仅仅是对第一蜂窝请求进行回收,因此,应用程序3可以在t4时刻之后继续使用该蜂窝通路进行数据通信;而应用程序1则是从申请蜂窝的t1时刻开始至切换至冷冻态的t4时刻这一段时间内使用蜂窝通路进行数据通信。
在t5时刻应用程序2从活动态切换至冷冻态,那么手机按照图5b的流程进行处理时,由于在t0~t5时间段内,主动申请蜂窝的应用程序1和应用程序2均从活动态切换至冷冻态,那么手机可以确定应用程序2的第二蜂窝请求是最后一个还未回收的蜂窝请求。在t5时刻手机可以断开Modem与基站之间的蜂窝连接。其中,在t1~t5时间段内手机的蜂窝状态都是蜂窝连接状态,但是在t5时刻之后,手机的蜂窝状态为蜂窝断开状态。
从t5时刻开始,手机的蜂窝状态为蜂窝断开状态,那么手机与基站之间的蜂窝通路已经断开。从图12可以看出,应用程序3在t3至t5时间段内使用蜂窝通路进行数据通信。应用程序3在t5时刻之后则无法继续使用蜂窝通路进行数据通信;应用程序2在t2至t5时间段内使用蜂窝通路进行数据通信。手机在应用程序2从活动态切换至冷冻态的t5时刻开始产生功耗收益,直至应用程序1和应用程序2中的任意一个应用从冷冻态恢复至活动态。
需要说明的是,对于图11与图4相同或类同之处,图11可以参考图4的说明,同样地,对于图12与图4相同或类同之处,图12可以参考图4的说明,这里不再赘述。
在另一个实施例中,在图5b之后,继续参照图6所示的本发明实施例的蜂窝网络控制方法的流程示意图,参照图6,在图5b的流程之后,在应用程序1从冷冻态切换至活动态的情况下,则可以执行图6所示的流程。
应用进入活动态的方式可以包括应用进程关闭后重启而进入活动态,还可以包括在后台冷冻后重新进入前台或后台运行而处于活动态,那么本发明实施例的图6所示的流程主要对从冷冻态切换至活动态的应用,进行蜂窝连接的恢复和蜂窝通路的开启。
示例地,功耗控制模块可以获取到应用程序1的状态信息,在应用程序1从冷冻态切换到活动态后,功耗控制模块可以将应用程序1的状态变化通知连接服务模块。
例如,功耗控制模块检测到应用程序1在后台超过30s与其他模块没有数据交互之后,功耗控制模块检测到应用程序1切换到前台运行,则可以确定应用程序1从冷冻态切换到活动态。
示例地,对于申请蜂窝的应用从冷冻态切换至活动态的过程,图10为示例性示出的应用场景示意图,接图9的应用场景可知,浏览器应用在图9(4)之后处于冷冻态。在图10中,图10(1)为接图9(4)的示意图。
参照图10(1),手机显示了信息应用的通讯界面508,对于通讯界面508所包括的控件具体参照图9(4)的描述,这里不再赘述。
在图10(1)中,用户通过从通讯界面508的底部边缘,按照箭头方向在通讯界面508上进行向上滑动操作,则手机可以接收该滑动操作,并响应于该滑动操作,将手机的显示界面从通讯界面508切换至图10(2)所示的程序界面509。
其中,该程序界面509可以包括一个或多个控件,该控件的具体实现方式可以包括但不限于:图标、按钮、窗口、图层等。
该程序界面509包括但不限于:后信息应用的通讯界面的缩略图510、浏览器应用的新闻界面的缩略图511,当然,程序界面509中的应用并不限于这里举例的两个应用,还可以包括更多的应用;显示在程序界面509中每个缩略图下方的删除图标505;显示在所述缩略图上方的应用图标和应用名称,例如缩略图510对应的应用名称为信息,缩略图11对应的应用名称为浏览器;显示在所述缩略图上方的悬浮窗口控件507;以及网络图标502、电池图标和时间图标。其中,关于网络图标502及其内部的具体图标、电池图标和时间图标的解释可以参照图10(1)的描述,这里不再赘述。
如图10(2)所示,显示在缩略图510下方的删除图标505,用于响应于用户操作来关闭程序界面503中所有启动的应用的进程。
信息应用的缩略图510上方的悬浮窗口控件507,用于响应于用户操作,将信息应用的显示界面(这里为通讯界面)在悬浮窗口中显示。
从图10(1)和图10(2)可以看出,由于申请蜂窝的浏览器应用处于冷冻态,例如浏览器应用为后台应用,且没有产生任何动作,那么手机通过执行图5实施例的方法的流程,使得手机与基站之间的蜂窝连接被断开,那么在图10(1)和图10(2)中,5G蜂窝网络图标5021中不存在上下行标识50211。
继续参照图10(2),在程序界面509,用户对浏览器应用的新闻界面的缩略图511进行手指单击操作,则手机可以响应于该手指单击操作,将浏览器应用从在后台不产生任何数据的冷冻态切换为前台运行的状态(即活动态),手机的显示界面也从程序界面509切换至如图10(3)所示的浏览器应用的新闻界面501。
在浏览器应用从冷冻态切换至活动态后的情况下,手机中的连接服务模块可以执行 图6所示的流程,来指示Modem建立与基站之间的蜂窝连接,在Modem开启与蜂窝相关射频后,可以使手机与基站之间的蜂窝通路被开启。手机在执行图6所示的流程时,执行速度很快,在用户角度,在从图10(2)切换至图10(3)后,用户可以在显示的图10(3)中直接看到5G蜂窝网络图标5021中已经显示有上下行标识50211,该上下行标识50211可以表示手机与基站之间通过二者之间建立的蜂窝连接在进行5G蜂窝数据的交互。
关于图10(3)中的新闻界面501所包括的控件具体参照图9(1)对控件的描述即可,这里不再赘述。
在应用程序1(在图10中,应用程序1为浏览器应用)从冷冻态切换至活动态后,继续参照图6,手机的连接服务模块可以执行S201;
S201,连接服务模块判断应用程序1是否备份过蜂窝请求;
可选地,在应用程序1从冷冻态切换至活动态后,连接服务模块还可判断应用程序1是否是第三方应用。
其中,关于连接服务模块判断应用程序1是否是第三方应用的具体方式可以参照图5b中的具体介绍,这里不再赘述。
关于连接服务模块判断是否备份过应用程序1的蜂窝请求的具体方式,连接服务模块可以通过查询第二数据结构中是否存在应用程序1的蜂窝请求的方式来实现,如果连接服务模块确定第二数据结构中存在应用程序1的第一蜂窝请求,则说明连接服务模块备份过应用程序1的蜂窝请求,如果连接服务模块第二数据结构中不存在应用程序1的第一蜂窝请求,则说明连接服务模块没有备份过应用程序1的蜂窝请求。
可选地,在一种实施方式中,在应用程序1为第三方应用、且连接服务模块备份过应用程序1的蜂窝请求的情况下,则连接服务模块执行S202,否则,直接转至应用程序1处于活动态,结束流程。
可选地,在另一种实施方式中,在连接服务模块备份过应用程序1的蜂窝请求的情况下,则连接服务模块执行S202,否则,直接转至应用程序1处于活动态,结束流程。
S202,连接服务模块将备份的第一蜂窝请求写入原始的第一数据结构;
其中,参照图5b的流程可知,由于应用程序1在从活动态切换到冷冻态后,应用程序1在申请蜂窝时写入至第一数据结构中的第一蜂窝请求已经删除,那么在应用程序1从冷冻态恢复至活动态后,则连接服务模块可以利用第二数据结构中备份的第一蜂窝请求,来将该第一蜂窝请求重新写入第一数据结构,进行蜂窝请求的恢复。
可选地,S203,连接服务模块删除备份的第一蜂窝请求;
其中,连接服务模块可以将第二数据结构中备份的关于应用程序1的蜂窝请求,即第一蜂窝请求进行删除,来节省存储空间。
可选地,S204,连接服务模块判断蜂窝是否处于连接状态;
示例地,连接服务模块中可以存储蜂窝的状态值,例如状态值的取值为1,则表示蜂窝状态为蜂窝连接状态,状态值的取值为0,则表示蜂窝状态为蜂窝断开状态(即不处于连接状态)。连接服务模块可以通过查询该状态值,来确定蜂窝当前是否处于连接状态。
连接服务模块在获取蜂窝的状态值时,可以从Modem处获取。其中,Modem在开启与蜂窝相关的射频后,使得Modem与基站之间建立了蜂窝连接,则Modem可以将表示蜂窝 状态为蜂窝连接状态的信息上报至连接服务模块;同理,在Modem关闭与蜂窝相关的射频后,使得Modem与基站之间断开了蜂窝连接,则Modem可以将表示蜂窝为蜂窝断开状态的信息上报至连接服务模块。其中,Modem可以在蜂窝状态发生变化的情况下,将最新的蜂窝状态上报至连接服务模块,使得连接服务模块可以存储有蜂窝的状态值。
在一种可能的实施方式中,当连接服务模块确定蜂窝状态为蜂窝连接状态时,则说明在应用程序1冷冻后,还存在其他应用主动申请蜂窝,使得Modem与基站之间的该蜂窝通路被开启,蜂窝状态为蜂窝连接状态,那么连接服务模块无需再指示Modem建立与基站之间的蜂窝连接;
在另一种可能的实施方式中,当连接服务模块确定蜂窝状态为蜂窝断开状态(即未处于连接状态)时,则说明在应用程序1冷冻后,该蜂窝连接未被重连仍旧是断开的,那么连接服务模块可以执行S206来指示Modem建立蜂窝连接。
可选地,在连接服务模块确定蜂窝状态为蜂窝断开状态之后,以及在S206之前,连接服务模块可以执行S205进行网络评估。
可选地,S205,连接服务模块判断网络是否满足第二预设条件;
示例性地,在建立Modem与基站之间的蜂窝连接之前,可以做本步骤的网络评估。在网络评估满足条件的情况下,连接服务模块可以执行S206,否则直接跳转到应用程序1处于活动态,本申请不再做处理,直接结束。
这里连接服务模块在进行网络评估时,可以包括但不限于以下至少一项:
连接服务模块判断网络是否可以从蜂窝的单连接切换为Wi-Fi和蜂窝的双连接,其中,由于从单连接切换到双连接,可能会存在网络无法正常切换的情况,因此,需要评估是否可以做网络的正常切换;
例如连接服务模块判断手机的网络不可以从蜂窝的单连接切换为Wi-Fi和蜂窝的双连接,则确定网络不满足第二预设条件。
连接服务模块判断系统设置中的蜂窝开关是否处于开启状态;
例如用户将手机设置中的蜂窝开关设置为关闭状态,则确定网络不满足第二预设条件;
连接服务模块判断手机的数据网络是否可用。
例如因为手机欠费停机等原因而导致手机的数据网络不可用,则连接服务模块确定网络不满足第二预设条件。
在本申请实施例中,在建立手机与基站之间的蜂窝连接之前,连接服务模块可以做网络评估,在评估网络满足第二预设条件的情况下,例如连接服务模块判断手机的网络可以从蜂窝的单连接切换为Wi-Fi和蜂窝的双连接、且系统设置中的蜂窝开关处于开启状态、且手机的数据网络可用,那么连接服务模块可以指示Modem建立Modem与基站之间的蜂窝连接,以使蜂窝连接可以正常建立,以及手机从Wi-Fi的单连接下切换到Wi-Fi和蜂窝的双连接时,建立蜂窝连接不会影响Wi-Fi通路的通信,手机可以继续使用Wi-Fi通路进行上网络通信,保证手机在Wi-Fi下上网不受到建立蜂窝连接的影响。
S206,连接服务模块指示Modem建立蜂窝连接;
示例地,连接服务模块可以调用rematch来实现本步骤。其中,rematch用向Modem 发送表示建立蜂窝连接的命令。Modem在接收到连接服务模块发送的上述命令之后,可以开启与蜂窝相关的射频,以建立手机的Modem与基站之间的蜂窝连接,以启动手机与基站之间的蜂窝通路进行数据通信。
在S206之后,转至应用程序1处于活动态,结束流程。
在本申请实施例中,在应用从活动态切换至冷冻态后,手机可以及时回收该应用的蜂窝请求,并在全部申请过蜂窝的应用均从活动态切换至冷冻态的情况下,手机可以关闭与基站之间的蜂窝通路来降低因应用使用蜂窝通路而带来的耗电量;在申请过蜂窝的应用从冷冻态恢复至活动态后,则手机可以将对该应用所回收的蜂窝请求进行释放;以及在蜂窝处于未连接状态的情况下,手机可以重新建立与基站之间的蜂窝连接,来确保主动申请过蜂窝的应用可以对蜂窝网络继续使用。
在一种可能的实施方式中,可以采用图6所示的蜂窝网络控制方法来对手机进行蜂窝网络控制,图13为示例性示出的经过图6所示的方法进行蜂窝网络控制后的蜂窝状态和应用状态的示意图。
为了便于理解,可以对比于图11,来看图13,且图11与图13相同或类同之处,原理相似,下文不再详细阐述。例如在图13的实施方式中,在t0~t3时间段内的应用状态和蜂窝状态的变化,与图11相同,参照关于图11的介绍即可。
从图13可以看出,应用程序1在t3时刻从活动态切换至冷冻态,例如应用程序1从前台运行切换至后台,并不再产生应用数据;然后,应用程序1又在t4时刻从冷冻态切换至活动态,例如,应用程序1从在后台不产生应用数据切换至在后台产生应用数据;
参照图6的流程图可知,在应用程序1在t4时刻从冷冻态切换至活动态后,则手机可以将在t4时刻之前与基站之间处于断开状态的蜂窝连接进行重连。示例地,连接服务模块可以指示Modem建立与基站之间的蜂窝连接,那么在t4时刻之后,Modem与基站之间的蜂窝连接再次被建立,从t4时刻开始,手机的蜂窝状态为蜂窝连接状态;
参照上文图3a、图3b和图4的描述可知,应用程序2可以通过连接服务模块监听Modem是否与基站建立了蜂窝连接,那么在t4时刻,Modem与基站之间的蜂窝连接被建立后,应用程序2可以继续使用该蜂窝连接进行蜂窝数据通信。
在本实施方式中,在应用程序1从活动态切换至冷冻态的t3时刻开始,至应用程序1从冷冻态切换回活动态的t4时刻结束,连接服务模块通过控制将手机与基站之间的蜂窝通路设置为断开状态,可以使手机在t3~t4时间段内产生功耗收益。
在另一个实施例中,参照图7所示的本发明实施例的蜂窝网络控制方法的流程示意图,参照图7,在图5b的流程之后,在应用程序1关闭的情况下,则手机可以执行图7所示的流程。
应用关闭(又称应用处于关闭状态)用于表示该应用的进程处于关闭状态,应用被关闭可以是用户触发,例如用户对前台应用或后台应用进行主动关闭操作,来关闭应用;或者系统触发,例如因进程不响应而系统自动关闭进程。
此外,应用关闭前的状态可以包括活动态,或者冷冻态。
示例地,功耗控制模块在检测到应用程序1处于关闭状态后,可以将该状态信息通知连接服务模块;连接服务模块可以从功耗控制模块获取到应用程序1的状态信息。
在应用程序1关闭的情况下,连接服务模块可以执行S301;
S301,连接服务模块判断应用程序1关闭前是否为冷冻态;
其中,连接服务模块可以从功耗控制模块处实时地获取到应用的状态信息,连接服务模块依据关于应用程序1的状态信息,来确定应用程序1在处于关闭状态之前是否为冷冻态。
例如应用程序1在关闭之前为活动态,则连接服务模块确定应用程序1关闭前不是冷冻态,本申请的方法不对活动后关闭的应用进行蜂窝网络控制,该方法的流程直接结束。
示例地,以应用程序1为浏览器应用为例,参照图9(2),浏览器应用在后台运行。如果用户用手指从缩略图504的底部边缘,对缩略图504向手机顶部方向上进行滑动操作,则手机可以响应于该滑动操作,将缩略图504对应的浏览器应用的进程关闭,那么浏览器应用可以从活动态切换至关闭状态,也即,浏览器应用关闭前为活动态。
例如应用程序1在关闭之前处于冷冻态,则转至执行S302。
示例地,以应用程序1为浏览器应用为例,参照10(2),浏览器应用当前在后台处于冷冻态。如果用户在浏览器应用的新闻界面的缩略图511的底部边缘,对缩略图511向手机顶部方向上进行滑动操作,则手机可以响应于该滑动操作,将缩略图511对应的浏览器应用的进程关闭,那么浏览器应用从冷冻态切换至关闭状态,也即浏览器应用关闭前为冷冻态。
S302,连接服务模块判断是否备份过应用程序1的第一蜂窝请求;
其中,连接服务模块可以通过查询第二数据结构(其中,第二数据结构可以用于备份主动申请蜂窝的应用向连接服务模块所发送的蜂窝请求)中是否存在应用程序1的蜂窝请求,如果存在,则说明连接服务模块备份过应用程序1的第一蜂窝请求,如果不存在,则说明连接服务模块没有备份过应用程序1的第一蜂窝请求。
示例地,虽然应用程序1从冷冻态切换至关闭状态,但是如果应用程序1在冷冻前没有申请过蜂窝网络。例如应用程序1为直接使用其他应用主动申请的蜂窝网络的应用,则连接服务模块的第二数据结构中不会存在应用程序1的蜂窝请求。
可选地,如果应用程序1不是第三方应用,例如应用程序1为系统应用,则在可选地实施方式中,手机在执行图5b的流程时不会对应用程序1进行蜂窝网络控制,那么连接服务模块的第二数据结构中也不会存在应用程序1的第一蜂窝请求。那么在连接服务模块中没有备份过应用程序1的第一蜂窝请求的情况下,则流程直接结束。
在应用程序1在冷冻前主动申请过蜂窝的情况下,连接服务模块中可以备份有应用程序的第一蜂窝请求,那么在连接服务模块中备份过应用程序1的第一蜂窝请求的情况下,则连接服务模块转至执行S303。
可选地,在应用程序1为第三方应用、且在冷冻前主动申请过蜂窝的情况下,连接服务模块中可以备份有应用程序的第一蜂窝请求,那么在连接服务模块中备份过应用程序1的第一蜂窝请求的情况下,则连接服务模块转至执行S303。
S303,连接服务模块删除备份的第一蜂窝请求。
由于应用关闭之后,需要对应用的数据进行删除,以及对应用所使用的资源进行释 放,从而确保应用下次启动处于活动态时能够正常运行。
那么在本实施例中,对于应用程序1所需要删除的数据可以包括第一蜂窝请求。
本实施例中,第一蜂窝请求可以存在于原始的第一数据结构中。应用程序1在关闭之前为冷冻态,手机通过执行图5b的流程已经将原始的第一数据结构中的应用程序1的第一蜂窝请求删除。那么待应用程序1从关闭状态再次切换到活动态后,连接服务模块不会在应用程序1未申请蜂窝的情况下,基于第一数据结构中的第一蜂窝请求来建立手机与基站之间的蜂窝连接;
本实施例中,该第一蜂窝请求还可以存在于第二数据结构中。应用程序1在关闭之前为冷冻态,手机通过执行图5b的流程,可以将该应用程序1的第一蜂窝请求,在应用程序1关闭之前备份至第二数据结构。而应用的每一次蜂窝请求的序列号唯一且不变,在应用程序1关闭之后,连接服务模块可以将第二数据结构中备份的具有应用程序1的序列号的第一蜂窝请求进行删除,来确保应用程序1在关闭之后再次活动时,能够正常申请蜂窝网络。
在本实施例中,在主动申请过蜂窝网络的第三方应用,从冷冻态切换至关闭状态后,手机可以将对该应用备份的蜂窝请求进行删除,其中,该备份的蜂窝请求为该应用从活动态切换至冷冻态时所备份的蜂窝请求。那么在应用关闭后,手机通过对应用的数据和资源进行删除,可以确保应用在关闭之后再次活动时,不影响应用再次申请蜂窝网络。
在另一个实施例中,参照图8所示的本发明实施例的蜂窝网络控制方法的流程示意图,参照图8,在图5b的流程之后,在功耗控制模块异常的情况下,则手机可以执行图8所示的流程。
应用关闭(又称应用处于关闭状态)用于表示该应用的进程处于关闭状态,应用被关闭可以是用户触发,例如用户对前台应用或后台应用进行主动关闭操作,来关闭应用;或者系统触发,例如因进程不响应而系统自动关闭进程。
其中,功耗控制模块可以自检是否发生异常,如果功耗控制模块自检发现自身异常,则功耗控制模块会重启,那么在功耗控制模块重启后可将表示功耗控制模块异常的通知发送至连接服务模块,那么连接服务模块则可以执行S400。
示例性地,功耗控制模块自检满足预设条件可确定发生异常,该预设条件可包括但不限于以下至少一项:
检测到函数的非法调用;
检测到内存高负载;
检测到功耗控制模块进程崩溃;
检测到功耗控制模块进程被手动关闭等。
在上述实施例中,在功耗控制模块启动之后,功耗控制模块可以控制连接服务模块来执行图5b的蜂窝网络控制方法的步骤,以对手机节省功耗。那么当功耗控制模块发生了异常,则需要将手机中的经连接服务模块操作的数据恢复至连接服务模块操作之前的状态,因此,在功耗控制模块异常后,连接服务模块可以执行S400~S403。
S400,连接服务模块将备份的所有应用程序的蜂窝请求写入原始的第一数据结构;
示例地,当连接服务模块查询第二数据结构时,如果查询到第二数据结构存在应用 的蜂窝请求,则说明该应用从活动态切换至了冷冻态,且连接服务模块对该应用执行了图5b的流程,因此,需要对该应用的蜂窝请求进行恢复,即将第二数据结构中该应用的蜂窝请求重写至原始的第一数据结构;当第二数据结构中的蜂窝请求涉及多个应用时,则需要对多个应用的蜂窝请求逐个进行恢复。
可选地,S401,连接服务模块删除备份的所有应用程序的蜂窝请求;
其中,第二数据结构可以用于备份从活动态切换至冷冻态后的第三方应用,在主动申请蜂窝网络时,向连接服务模块所发送的蜂窝请求。在功耗控制模块自检发现自身异常的情况下,需要将功耗控制模块控制连接服务模块所执行的蜂窝网络控制方法而产生的备份数据进行清除,那么连接服务模块可以对第二数据结构中存储的每个应用的蜂窝请求均进行删除。
可选地,S402,连接服务模块判断蜂窝是否处于连接状态;
其中,本步骤的具体实现方式可以参照图6中的S204,这里不再赘述。
在蜂窝状态为蜂窝连接状态的情况下,则流程结束,在蜂窝状态为蜂窝断开状态的情况下,则连接服务模块转至执行S403。
可选地,S403,连接服务模块判断网络是否满足第二预设条件;
其中,本步骤的具体实现方式可以参照图6中的S205,这里不再赘述。
在连接服务模块判断网络不满足第二预设条件的情况下,则流程结束。
在连接服务模块判断网络满足第二预设条件的情况下,则连接服务模块转至执行S404。
S404,连接服务模块指示Modem建立蜂窝连接;
由于功耗控制模块控制连接服务模块执行图5b的流程可以关闭蜂窝连接,因此,在功耗控制模块异常后,还需要对网络进行恢复,在蜂窝未处于连接的状态下,连接服务模块指示Modem建立与基站之间的蜂窝连接。
其中,本步骤的具体实现方式可以参照图6中的S206,这里不再赘述。
S404之后,流程结束。
在本申请实施例中,在功耗控制模块发生异常后,手机可以能够对在应用从活动态切换至冷冻态后,对应用的蜂窝请求以及对蜂窝网络的操作进行恢复,具体可以包括利用备份的蜂窝请求,恢复至原始的第一数据结构,删除备份的蜂窝请求,以及在蜂窝网络关闭的情况下,对蜂窝网络进行重新建立连接,能够在功耗控制模块异常后,对应用的蜂窝请求所执行的操作进行还原恢复,以及对蜂窝网络连接状态进行恢复,确保原本Wi-Fi和蜂窝双连接的网络环境不受影响。
可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
一个示例中,图14示出了本申请实施例的一种装置300的示意性框图装置300 可包括:处理器301和收发器/收发管脚302,可选地,还包括存储器303。
装置300的各个组件通过总线304耦合在一起,其中总线304除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图中将各种总线都称为总线304。
可选地,存储器303可以用于前述方法实施例中的指令。该处理器301可用于执行存储器303中的指令,并控制接收管脚接收信号,以及控制发送管脚发送信号。
装置300可以是上述方法实施例中的电子设备或电子设备的芯片。
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的蜂窝网络的控制方法。
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的蜂窝网络的控制方法。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的蜂窝网络的控制方法。
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
本申请各个实施例的任意内容,以及同一实施例的任意内容,均可以自由组合。对上述内容的任意组合均在本申请的范围之内。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。
结合本申请实施例公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(Random Access Memory,RAM)、闪存、只读存储器(Read Only Memory,ROM)、可擦除可编程只读存储器(Erasable Programmable ROM,EPROM)、电可擦可编程只读存储器(Electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于网络设备中。当然,处理器和存储介质也可以作为分立组件存在于网络设备中。
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。

Claims (15)

  1. 一种蜂窝网络的控制方法,应用于电子设备,其特征在于,所述电子设备通过Wi-Fi网络和蜂窝网络与应用服务器进行数据交互,其中,所述蜂窝网络由第一应用申请,所述第一应用和第二应用通过所述蜂窝网络与各自的所述应用服务器进行数据交互,所述方法包括:
    响应于接收到的第一用户操作,将运行在前台的所述第一应用切换至后台运行;
    检测到所述第一应用保持在后台运行的预设时长内未生成应用数据,并且所述第一应用为最后一个申请过所述蜂窝网络且使用所述蜂窝网络的应用,断开所述电子设备的所述蜂窝网络的通路;
    通过所述Wi-Fi网络与所述第二应用的应用服务器交互所述第二应用的数据。
  2. 根据权利要求1所述的方法,其特征在于,所述断开所述电子设备的所述蜂窝网络之后,所述方法还包括:
    响应于接收到的第二用户操作,将保持在后台运行的所述预设时长内未生成应用数据的所述第一应用切换至前台运行;
    连接所述电子设备的所述蜂窝网络的通路。
  3. 根据权利要求2所述的方法,其特征在于,所述检测到所述第一应用保持在后台运行的预设时长内未生成应用数据,并且所述第一应用为最后一个申请过所述蜂窝网络且使用所述蜂窝网络的应用之后,所述方法还包括:
    将所述第一应用的第一蜂窝请求从第一数据结构删除;
    其中,所述第一蜂窝请求用于申请所述蜂窝网络,所述第一数据结构用于存储预设应用的蜂窝请求,其中,所述预设应用为申请过所述蜂窝网络的应用。
  4. 根据权利要求3所述的方法,其特征在于,
    所述将所述第一应用的第一蜂窝请求从第一数据结构删除之前,所述方法还包括:
    将所述第一蜂窝请求备份至第二数据结构;
    所述连接所述电子设备的所述蜂窝网络的通路之前,所述方法还包括:
    将所述第二数据结构中备份的所述第一蜂窝请求写入所述第一数据结构。
  5. 根据权利要求3所述的方法,其特征在于,所述方法还包括:
    响应于接收到的第三用户操作,将运行在前台的所述第三应用切换至后台运行,其中,所述蜂窝网络由所述第三应用申请,所述第三应用通过所述蜂窝网络与所述第三应用的应用服务器进行数据交互;
    检测到所述第三应用保持在后台运行的所述预设时长内未生成应用数据,并且所述第三应用不是最后一个申请过所述蜂窝网络且使用所述蜂窝网络的应用,将所述第三应用的第二蜂窝请求从所述第一数据结构删除;
    所述第二蜂窝请求用于申请所述蜂窝网络。
  6. 根据权利要求5所述的方法,其特征在于,所述将所述第三应用的第二蜂窝请求从第一数据结构删除之前,所述方法还包括:
    将所述第二蜂窝请求备份至第二数据结构。
  7. 根据权利要求6所述的方法,其特征在于,所述将所述第三应用的第二蜂窝请求从第一数据结构删除之后,所述方法还包括:
    响应于接收到的第四用户操作,将保持在后台运行的所述预设时长内未生成应用数据的所述第三应用切换至前台运行;
    将所述第二数据结构中备份的所述第二蜂窝请求写入所述第一数据结构。
  8. 根据权利要求4或7所述的方法,其特征在于,在将所述第二数据结构中备份的目标蜂窝请求写入所述第一数据结构之后,所述方法还包括:
    将所述目标蜂窝请求从所述第二数据结构删除;
    其中,所述目标蜂窝请求包括所述第一蜂窝请求或所述第二蜂窝请求。
  9. 根据权利要求4所述的方法,其特征在于,所述断开所述电子设备的所述蜂窝网络的通路之后,所述方法还包括:
    响应于接收到的第四用户操作,将保持在后台运行的预设时长内未生成应用数据的所述第一应用进行关闭;
    将所述第一蜂窝请求从所述第二数据结构中删除。
  10. 根据权利要求2所述的方法,其特征在于,所述电子设备显示有表示所述Wi-Fi网络的第一图标和表示所述蜂窝网络的第二图标;
    所述断开所述电子设备的所述蜂窝网络的通路之前,所述第二图标包括第二上行标识,和/或,第二下行标识;
    所述第二上行标识用于表示所述电子设备通过所述蜂窝网络向所述应用服务器上传数据;
    所述第二下行标识用于表示所述电子设备通过所述蜂窝网络从所述应用服务器下载数据。
  11. 根据权利要求10所述的方法,其特征在于,
    所述断开所述电子设备的所述蜂窝网络的通路之后,所述第一图标包括所述第一上行标识,和/或,所述第一下行标识,所述第二图标不包括所述第二上行标识和所述第二下行标识;
    其中,所述第一上行标识用于表示所述电子设备通过所述Wi-Fi网络向所述应用服务器上传数据;
    所述第一下行标识用于表示所述电子设备通过所述Wi-Fi网络从所述应用服务器下载数据。
  12. 根据权利要求10所述的方法,其特征在于,所述连接所述电子设备的所述蜂窝网络的通路之后,所述第二图标包括所述第二上行标识,和/或,所述第二下行标识。
  13. 一种电子设备,其特征在于,包括:存储器和处理器,所述存储器和所述处理器耦合;所述存储器存储有程序指令,所述程序指令由所述处理器执行时,使得所述电子设备执行如权利要求1至12中任意一项所述的蜂窝网络的控制方法。
  14. 一种计算机可读存储介质,其特征在于,包括计算机程序,当所述计算机程序在电子设备上运行时,使得所述电子设备执行如权利要求1至12中任意一项所述的蜂窝网络的控制方法。
  15. 一种芯片,其特征在于,包括一个或多个接口电路和一个或多个处理器;所述接口电路用于从电子设备的存储器接收信号,并向所述处理器发送所述信号,所述信号包括存储器中存储的计算机指令;当所述处理器执行所述计算机指令时,使得所述电子设备执行权利要求1至12中任意一项所述的蜂窝网络的控制方法。
PCT/CN2022/136477 2021-12-31 2022-12-05 蜂窝网络的控制方法和电子设备 WO2023124791A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111678700.2A CN116419372A (zh) 2021-12-31 2021-12-31 蜂窝网络的控制方法和电子设备
CN202111678700.2 2021-12-31

Publications (1)

Publication Number Publication Date
WO2023124791A1 true WO2023124791A1 (zh) 2023-07-06

Family

ID=86997612

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/136477 WO2023124791A1 (zh) 2021-12-31 2022-12-05 蜂窝网络的控制方法和电子设备

Country Status (2)

Country Link
CN (1) CN116419372A (zh)
WO (1) WO2023124791A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8867490B1 (en) * 2011-08-25 2014-10-21 Accelera, Inc. Secure and seamless handover between IP-based cellular networks and Wi-Fi networks
CN105744474A (zh) * 2014-12-08 2016-07-06 深圳市腾讯计算机系统有限公司 一种控制终端设备移动数据网络状态变化的方法及终端
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
CN112469099A (zh) * 2020-11-25 2021-03-09 维沃移动通信有限公司 联网控制方法、联网控制装置、电子设备和存储介质
CN113645345A (zh) * 2021-08-06 2021-11-12 重庆传音通讯技术有限公司 数据发送方法、移动终端及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8867490B1 (en) * 2011-08-25 2014-10-21 Accelera, Inc. Secure and seamless handover between IP-based cellular networks and Wi-Fi networks
CN105744474A (zh) * 2014-12-08 2016-07-06 深圳市腾讯计算机系统有限公司 一种控制终端设备移动数据网络状态变化的方法及终端
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
CN112469099A (zh) * 2020-11-25 2021-03-09 维沃移动通信有限公司 联网控制方法、联网控制装置、电子设备和存储介质
CN113645345A (zh) * 2021-08-06 2021-11-12 重庆传音通讯技术有限公司 数据发送方法、移动终端及存储介质

Also Published As

Publication number Publication date
CN116419372A (zh) 2023-07-11

Similar Documents

Publication Publication Date Title
EP3822835B1 (en) Method for deleting secure service, and electronic apparatus
WO2023130991A1 (zh) 协同通话方法、装置、设备、存储介质和程序产品
WO2022083465A1 (zh) 电子设备的投屏方法及其介质和电子设备
WO2021185235A1 (zh) 一种应用显示接续方法及装置
CN114025410A (zh) 建立网络连接的方法和装置以及电子设备
EP4195870B1 (en) Data transmission method and terminal
WO2021143168A1 (zh) 可信执行环境操作系统崩溃处理方法及电子设备
WO2023221479A1 (zh) 通信异常处理方法及相关装置
WO2023000777A9 (zh) 一种recovery模式升级过程中的重启方法及终端
CN114442969A (zh) 一种设备间屏幕协同方法及设备
CN112817610A (zh) cota包安装方法及相关装置
CN110768900B (zh) 一种数据传输方法及电子设备
WO2023124791A1 (zh) 蜂窝网络的控制方法和电子设备
WO2023029983A1 (zh) 一种控件内容的拖拽方法、电子设备及系统
CN113709720B (zh) 一种sim双模卡异常的优化方法及电子设备
EP4191409A1 (en) Shared library multiplexing method and electronic device
WO2022161024A1 (zh) 升级提示方法、终端设备及计算机可读存储介质
CN115278642A (zh) 获取sim卡的信息的方法、电子设备及终端设备
WO2024046062A1 (zh) 一种卡片跨设备交互方法及电子设备
CN115941674B (zh) 多设备应用接续方法、设备及存储介质
CN117076089B (zh) 应用管理方法、终端设备及存储介质
CN115002821B (zh) 通话状态监听方法、装置、设备、存储介质
WO2023088106A1 (zh) 降低功耗的方法和电子设备
CN115150502B (zh) 一种应用小部件的显示方法及装置、存储介质
CN117009023B (zh) 显示通知信息的方法及相关装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22914046

Country of ref document: EP

Kind code of ref document: A1