CN115550423B - Data communication method, electronic device and storage medium - Google Patents

Data communication method, electronic device and storage medium Download PDF

Info

Publication number
CN115550423B
CN115550423B CN202210382342.9A CN202210382342A CN115550423B CN 115550423 B CN115550423 B CN 115550423B CN 202210382342 A CN202210382342 A CN 202210382342A CN 115550423 B CN115550423 B CN 115550423B
Authority
CN
China
Prior art keywords
data
data call
state
connection
state machine
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210382342.9A
Other languages
Chinese (zh)
Other versions
CN115550423A (en
Inventor
何彦召
王淼
阳军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202210382342.9A priority Critical patent/CN115550423B/en
Publication of CN115550423A publication Critical patent/CN115550423A/en
Application granted granted Critical
Publication of CN115550423B publication Critical patent/CN115550423B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

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

Abstract

The application provides a data communication method, electronic equipment and a storage medium, and relates to the field of intelligent terminals. The method comprises the following steps: generating a data call command and storing connection parameters in the data call command; establishing a data call based on the connection parameters; after the data call is established successfully, if a data call disconnection event is detected, reestablishing the data call based on the connection parameters; and if the data call is successfully reestablished based on the connection parameters, intercepting the data call disconnection event, and not displaying a network-free prompt corresponding to the data call disconnection event. The embodiment of the application can reduce the number of times of popping up the no-network prompt under the condition that the user cannot perceive that the application cannot be networked currently.

Description

Data communication method, electronic device and storage medium
Technical Field
The present application relates to the field of intelligent terminals, and in particular, to a data communication method, an electronic device, and a storage medium.
Background
When a user uses some applications (such as video applications), the discovery application may pop up a no network prompt (such as "currently no network, please retry after detection"). But when the no-network prompt pops up, the user is virtually unaware that the application is currently not networked. If the pop-up without the network prompt is too frequent, a certain trouble is caused to the user, resulting in poor user experience.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a data communication method, an electronic device, and a storage medium that reduce the number of popping up a no-network prompt in the event that a user cannot perceive that an application is currently unable to be networked.
In a first aspect, an embodiment of the present application provides a data communication method, applied to an electronic device, where the method includes: generating a data call command and storing connection parameters in the data call command; establishing a data call based on the connection parameters; after the data call is established successfully, if a data call disconnection event is detected, reestablishing the data call based on the connection parameters; if the data call is successfully reestablished based on the connection parameters, the electronic equipment does not display a network-free prompt corresponding to the data call disconnection event. According to the technical scheme, when the data call command is generated, the connection parameters in the data call command are stored, and when the data call disconnection event is detected, the data call is reestablished based on the stored connection parameters, the data call disconnection event is intercepted after the data call is successful, and the no-network prompt corresponding to the data call disconnection event is not displayed, so that a user does not feel the data call disconnection event, and the number of times of popping up the no-network prompt is effectively reduced.
In one implementation, if a data call disconnect event is detected, reestablishing the data call based on the connection parameters includes: if a data call disconnection event is detected, determining whether a cause value corresponding to the data call disconnection event is a preset target cause value; and when the cause value is not the preset target cause value, reestablishing a data call based on the connection parameter. According to the technical scheme, the target cause value is preset, the data call is reestablished only for the data call disconnection event which does not carry the target cause value, the number of times of data reestablishment for the data call disconnection event which cannot reestablish the data call can be reduced, and the energy loss can be reduced.
In one implementation, the method further comprises: and if the data call is failed to be reestablished based on the connection parameters, the electronic equipment displays a network-free prompt corresponding to the data call disconnection event. According to the technical scheme, the user can be timely reminded of disconnecting the network when the data call fails.
In one implementation, the electronic device includes an application layer, an application framework layer, a wireless interface layer, and a modem processor, the application framework layer including a telephony manager; the generating a data call command includes: the application program layer generates a data call command; or the application framework layer generates a data call command; the storing the connection parameters in the data call command includes: the telephone manager stores connection parameters in the data call command; said establishing a data call based on said connection parameters comprises: the telephone manager generates a data call instruction based on the connection parameters and sends the data call instruction to the wireless interface layer; the wireless interface layer sends the received data call instruction to the modem processor; the modem processor executes a data call action according to the data call instruction; the reestablishing the data call based on the connection parameters includes: the telephone manager regenerates a data call instruction based on the connection parameters and sends the data call instruction to the wireless interface layer; the wireless interface layer sends the received data call instruction to the modem processor; the modem processor executes a data call action according to the data call instruction; the electronic device not displaying the no-network prompt corresponding to the data call disconnection event includes: the telephone manager does not notify an application program layer of the data call disconnection event, and the application program layer does not generate a network-free prompt corresponding to the data call disconnection event;
The electronic device displaying the network-free prompt corresponding to the data call disconnection event comprises: the telephone manager notifies the data call disconnection event to an application program layer, and the application program layer generates a network-free prompt corresponding to the data call disconnection event and displays the network-free prompt. According to the technical scheme, when the data call command is generated, the connection parameters in the data call command are stored, and when the data call disconnection event is detected, the data call is reestablished based on the stored connection parameters, no network prompt corresponding to the data call disconnection event is not generated after the data call is successful, and the frequency of popping up the no network prompt is effectively reduced.
In one implementation, the electronic device includes a state machine including a data connection inactive state, a data connection active state, and a data connection active state, the method further comprising: when the state machine is in the data connection inactive state, if a data call command is received, the state machine is switched from the data connection inactive state to the data connection active state, and the data connection active state is used for establishing a data call; if the state machine successfully establishes a data call according to the data call command, the state machine is switched from the data connection activating state to the data connection activated state; when the state machine is in the data connection activated state, if a data call disconnect event is detected, the state machine switches from the data connection activated state back to the data connection active state. According to the technical scheme, when the data call disconnection event is detected, the state machine is switched back to the data connection activating state, and the data call is reestablished.
In one implementation, the switching of the state machine from the data connection activated state back to the data connection active state if a data call disconnect event is detected includes: if the data call disconnection event is detected and the reason value corresponding to the data call disconnection event is not a preset target reason value, the state machine switches from the data connection activated state back to the data connection activated state. According to the technical scheme, the target cause value is preset, and only the data call disconnection event which is not the target cause value is switched back to the data connection in the active state to reestablish the data call, so that the number of times of data reestablishment on the data disconnection event which cannot reestablish the data call can be reduced, and the energy loss can be reduced.
In one implementation, after the state machine switches from the data connection activated state back to the data connection being activated state, the method further comprises: if the state machine is in the data connection activating state and successfully establishes a data call, the state machine is switched from the data connection activating state to the data connection activated state; and if the state machine is in the data connection activating state and the data call establishment fails, the state machine is switched from the data connection activating state to the data connection non-activating state. According to the technical scheme, when the data call is successful, the data call can be switched to the activated state of the data connection, and no network prompt corresponding to the data call disconnection event is not displayed; and when the data call fails, the data connection is switched to the inactive state, and the user is timely reminded that the network is disconnected.
In one implementation, the method further comprises: and if a data call disconnection event is detected and the reason value corresponding to the data call disconnection event is a preset target reason value, the state machine is switched from the data connection activated state to the data connection non-activated state. According to the technical scheme, the data connection non-activated state can be switched to aiming at the specific situation corresponding to the preset target cause value, and the quick response is given so as to remind the user that the network is disconnected in time.
In a second aspect, an embodiment of the present application provides an electronic device including a memory and a processor; the memory is used for storing program instructions; the processor is configured to read the program instructions stored in the memory to implement the data communication method as described above.
In a third aspect, embodiments of the present application provide a computer readable storage medium having stored therein computer readable instructions which, when executed by a processor, implement a data communication method as described above.
In addition, the technical effects of the second aspect and the third aspect may be referred to in the description related to the method designed by each of the above method sections, which are not repeated herein.
Drawings
Fig. 1 is a schematic diagram of a scenario without network prompt according to an embodiment of the present application.
Fig. 2 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a system architecture of an electronic device according to an embodiment of the present application.
Fig. 4 is a state machine responsible for maintaining cellular data connections provided by an embodiment of the present application.
Fig. 5 is a state machine responsible for maintaining cellular data connections provided by an embodiment of the present application.
Fig. 6 is a flowchart of a data communication method according to an embodiment of the present application.
Detailed Description
The terms "first" and "second" are used below for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In describing embodiments of the present application, words such as "exemplary," "or," "such as," and the like are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary," "or," "such as," and the like are intended to present related concepts in a concrete fashion.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It is to be understood that, unless otherwise indicated, a "/" means or. For example, A/B may represent A or B. The "and/or" in the present application is merely one association relationship describing the association object, indicating that three relationships may exist. For example, a and/or B may represent: a exists alone, A and B exist simultaneously, and B exists alone. "at least one" means one or more. "plurality" means two or more than two. For example, at least one of a, b or c may represent: seven cases of a, b, c, a and b, a and c, b and c, a, b and c. It will be appreciated that the order of the steps shown in the flowcharts herein may be changed and some may be omitted.
When some applications, such as video applications, are used, the user can pop up the no-network prompt suddenly, for example, pop up the no-network prompt of "current no-network, please retry after detection" shown in fig. 1 in the display interface of XX video application. However, when the no-network prompt is popped up, the user cannot actually perceive that the application cannot be networked currently, so that the no-network prompt is wonderful, a certain trouble is caused to the user, normal use of the application by the user is interfered, and the use experience of the user is poor.
In order to reduce the number of times of popping up the no-network prompt under the condition that a user cannot perceive that the application cannot be networked currently, the embodiment of the application provides a data communication method which can reduce the number of times of popping up the no-network prompt. Specifically, the embodiment of the application can intercept the network disconnection prompt (the network disconnection prompt is used for prompting that the current network data of the application is disconnected) sent to the application when the network data of the electronic equipment is disconnected, reestablish the network data connection according to the stored connection parameters after intercepting the network disconnection prompt, reduce the times of generating the no-network prompt by the application according to the network disconnection prompt under the condition of not influencing the normal use of the application by the user, ensure that the user has no perception on the process of disconnecting the network data of the electronic equipment and reconnecting the network data, and improve the use experience of the user.
The data communication method provided by the embodiment of the application is applied to the electronic equipment. It is understood that the electronic device of the present application may be a mobile phone, tablet, desktop, laptop, handheld, notebook, ultra-mobile personal computer (UMPC), netbook, and electronic device such as a cellular phone, personal digital assistant (personal digital assistant, PDA), artificial intelligence (artificial intelligence, AI) device, wearable device, vehicle-mounted device, smart home device, and/or smart city device. The embodiment of the application does not limit the specific form of the device.
When the data communication method provided by the embodiment of the application is applied to the electronic equipment, the electronic equipment can be in wireless communication connection (for example, wi-Fi connection) or cellular data connection (for example, mobile data network), and the data connection mode of the electronic equipment is not limited in any way. The following description will be made with respect to an example in which the electronic device is in a cellular data connection.
In order to more clearly describe the content in the embodiments of the present application, the following describes the hardware structure of the electronic device to which the embodiments of the present application are applied.
Fig. 2 is a schematic hardware structure of an electronic device according to an embodiment of the present application. Referring to fig. 2, 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 charge management module 120, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, a user identification module (subscriber identification module, SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a Modem processor (Modem), a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural-network processor (neural-network processing unit, NPU), etc. A memory may also be provided in the processor 110 for storing instructions and data.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I1C) 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 receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The I1C interface is a bi-directional synchronous serial bus comprising a serial data line (SDA) and a serial clock line (derail clock line, SCL). The I2S interface may be used for audio communication. PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (camera serial interface, CSI), display serial interfaces (display serial interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing functions of electronic device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display functionality of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to 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), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate.
A Modem processor (Modem) is running on the baseband chip and the coprocessor, and a subscriber identification (Subscriber Identity Module, SIM) card module is arranged in the Modem, and through the SIM card module in the Modem, the Modem can be used for providing functions related to SIM information, such as network registration, authentication, and the like. For example, when using an electronic device with a Modem, a user may implement a range of SIM card functions by triggering a local application. The SIM card may be a physical card (or called a hard card) or a virtual SIM card (or called a soft card), and may include an embedded chip type Subscriber Identity Module (SIM) card, or the like, and the specific form of the SIM card is not limited in the embodiment of the present application.
The Modem may include a modulator and demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the Modem may be a stand-alone device. In other embodiments, the Modem may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc. applied on the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor that serves exception alerts, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a mini, a Micro led, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like.
In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1. The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing the digital signal.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The internal memory 121 may include one or more random access memories (random access memory, RAM) and one or more non-volatile memories (NVM). In an embodiment of the present application, the internal memory 121 may also be referred to as a memory.
The external memory interface 120 may be used to connect external non-volatile memory to enable expansion of the memory capabilities of the electronic device 100. The external nonvolatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and video are stored in an external nonvolatile memory.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device 100 platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the desktop card displayed on the display interface may be updated with the positioning of the gyroscopic sensor 180B.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, electronic device 100 calculates altitude from barometric pressure values measured by barometric pressure sensor 180C, aiding in positioning and navigation.
The magnetic sensor 180D includes a hall sensor. The electronic device 100 may detect the opening and closing of the flip cover using the magnetic sensor 180D.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The method can also be used for identifying the gesture of the electronic equipment 100, and can be applied to applications such as horizontal and vertical screen switching, pedometers and the like.
A distance sensor 180F for measuring a distance. The electronic device 100 may measure the distance by infrared or laser. In some embodiments, the electronic device 100 may range using the distance sensor 180F to achieve quick focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 detects infrared reflected light from nearby objects using a photodiode.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature.
The touch sensor 180K, also referred to as a "touch device". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, bone conduction sensor 180M may acquire a vibration signal of a human vocal tract vibrating bone pieces. The bone conduction sensor 180M may also contact the pulse of the human body to receive the blood pressure pulsation signal. In some embodiments, bone conduction sensor 180M may also be provided in a headset, in combination with an osteoinductive headset. The audio module 170 may analyze the voice signal based on the vibration signal of the sound portion vibration bone block obtained by the bone conduction sensor 180M, so as to implement a voice function. The application processor may analyze the heart rate information based on the blood pressure beat signal acquired by the bone conduction sensor 180M, so as to implement a heart rate detection function.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be plugged into multiple frames of cards simultaneously. The multi-frame cards may be of the same type or of different types. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, i.e.: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
It will be apparent to one skilled in the art that some of the specific details presented above with respect to the electronic device may be unnecessary to practice a particular embodiment or equivalent thereof. Similarly, other electronic devices may include a greater number of subsystems, modules, components, etc. Some of the sub-modules may be implemented as software or hardware, where appropriate. It should be understood, therefore, that the foregoing description is not intended to be exhaustive or to limit the disclosure to the precise form disclosed herein. On the contrary, many modifications and variations will be apparent to those of ordinary skill in the art in light of the above teachings.
Fig. 3 is a schematic diagram of a system architecture of an electronic device according to an embodiment of the present application.
As shown in fig. 3, in some embodiments, the hierarchical architecture of the electronic device divides the software into several layers, each with a clear role and division of work. The layers communicate with each other through a software interface. In some embodiments, the ANDROID (ANDROID) system is divided into four layers, from top to bottom, an application layer, an application framework layer, a radio interface layer (Radio Layer Interface, RIL), and a Modem processor (Modem) layer, respectively.
For the electronic device in fig. 3, data interaction between the application layer and the application framework layer can be performed through a conventional interface; the application framework layer and the RIL can interact data through a hardware abstraction layer interface definition language (Hardware Abstraction Layer Interface Definition Language, HIDL) interface, and the RIL and the Modem can interact data based on the chip architecture of the electronic device. For example, the RIL and Modem interact data by way of PCI-Express (peripheral component interconnect Express, PCIE) or memory sharing.
The application layer may include aA series of applications. As shown in fig. 3, the application package may include: gallery, text messaging, navigation, bluetooth, and video applications 3001. The video application 3001 may play video stored at a remote server in the case where the electronic device is connected to a network. In the case that the connection between the electronic device and the network is disconnected, the video application 3001 pops up a no-network prompt on the display interface corresponding to the video application 3001. Video applications, for example short video social applications, such as Application, & gt>Application, etc.
The application framework layer provides an application programming interface (Application Programming Interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions. As shown in fig. 3, the application framework layer may include a Telephony manager (Telephony) 3002 and a connectivity service (connectivity service) 3003.
The phone manager 3002 is used to provide management functions for cellular related services of the electronic device. For example, the phone manager 3002 is used to provide management of call status (including on, and hang-up, etc.) and cellular data connection status (including established connection with the cellular data network, disconnected from the cellular data network, being connected to the cellular data network, being disconnected from the cellular data network, etc.). The connection service 3003 is used to manage the manner in which the electronic device uses data traffic. The manner in which the electronic device uses the data services may include the electronic device using the data services over a cellular data network, or Wi-Fi, or hot spot, or a network cable, etc. The connection service 3003 may receive the change information and notify the change information by acquiring interfaces of other services. The connection service 3003 knows the cellular data connection status through the phone manager 3002. After learning the cellular data connection status, the connection service 3003 may notify the application layer of the cellular data connection status, such as to the video application 3001. The cellular data network may include a 2G network, a 3G network, a 4G network, a 5G network, a future wireless communication network, and the like.
In a possible implementation manner, the application framework layer may further include: window manager, notification manager, content manager, view system, resource manager, etc. (not shown in fig. 3), which is not limiting in this embodiment of the application.
The window manager is used for managing window programs. The window manager may obtain the display screen size, determine if there is a status bar, lock the screen, touch the screen, drag the screen, intercept the screen, etc. The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc. The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture. The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
RIL is the interface layer between application program frame layer and Modem module, responsible for the transmission of the operation of the relevant business control plane of cellular, responsible for the reliable transmission of data. A radio interface layer daemon (Radio Interface Layer Daemon, rild) may be included in the RIL, which rild may include: ril service module 3004. For example, the ril service module 3004 may be configured to forward the SIM instruction sent by the phone manager 3002 via the HIDL interface to the Modem module, and forward the response data corresponding to the SIM instruction returned by the Modem module, and the state or notification actively reported by the Modem module to the phone manager 3002.
The Modem module comprises: protocol stack and card processing module. The protocol stacks may include wireless communication protocol stacks such as 2G protocol stacks, 3G protocol stacks, 4G protocol stacks, and 5G protocol stacks.
The card processing module may comprise a related module of the SIM card. Such as a SIM card module, a local SIM card module, a SIM card slot driver, etc. The SIM card slot driver can be connected with a SIM hard card.
A SIM card module: for providing network registration, authentication, etc. functions related to SIM information. The SIM card module can support a local SIM card calling mode provided by the local SIM card module.
Local SIM card module: for enabling access to local SIM card information using a SIM card slot driver.
In a possible implementation manner, a SIM card slot driver and a SIM hard card may be disposed in a Modem of the electronic device; alternatively, the SIM card slot driver and the SIM hard card may not be provided in the Modem of the electronic device, and the electronic device may use the local eSIM.
The above-described exemplary architecture diagram of the ANDROID system is merely illustrative, and is not meant to be limiting. It should be noted that although the embodiment of the present application is described by taking the ANDROID system as an example, the basic principle is equally applicable to the iOS-based system TM Or WINDOWS TM And the like operating the electronic device of the system.
Fig. 4 is a state machine responsible for maintaining cellular data connection status provided by an embodiment of the present application. The state machine is a data connection (DataConnection, DC) module in the telephony manager 3002 that can be used to effect handoff of the cellular data connection state.
As shown in fig. 4, the State machine includes four states: a data connection default state (may be abbreviated as DcDefaultState), a data connection inactive state (may be abbreviated as dcinactive state), a data connection active state (may be abbreviated as dcactivative state), and a data connection activated state (may be abbreviated as dcactivative state).
Four states in the state machine are first described.
The DcDefaultState state represents the state at the time of creation of the state machine, which is not initialized at this time. After the state machine is initialized, the state machine enters a DcInacteState state from the DcDefaultState state.
The dcinactive state indicates that the current electronic device is not establishing a connection with the cellular data network. In the dcinactive state, the state machine may attempt to establish a connection with the cellular data network. The state machine attempts to establish a connection with the cellular data network while switching state from the dcinactive state to the dcactive state.
The DcActivatingState indicates that the electronic device is establishing a connection with the cellular data network. In the dcactivating state, the state machine may generate a data call instruction to control the Modem to perform a data call action to establish a connection with the cellular data network. If the Modem and RIL return data call result in failure to establish connection with the cellular data network, the state opportunity switches from DcActivate State state back to DcInactive State state. If the data call is successfully established between the Modem and the RIL, the state machine switches the state from the DcActivate state to the DcActivate state.
The DcActivateState state indicates that the connection with the cellular data network was established successfully. And then the necessary link configuration, route configuration and the like are completed in the application program framework layer, so that networking service can be provided for the application in the application program layer.
As shown in fig. 4, the operating logic of the state machine is as follows:
401, initializing a state machine, and switching from a DcDefaultState state to a DcInacteState state.
For example, when a user opens a cellular data switch, the application layer generates a data call command and sends the generated data call command to the state machine to establish a cellular data connection. For another example, if an electronic device opens a cellular data switch and is in a WiFi connection state, after the electronic device disconnects the WiFi connection, the application framework layer of the electronic device generates a data call command and sends the generated data call command to a state machine to establish the cellular data connection. The data call command is used to trigger an action of the state machine to establish a connection with the cellular data network. When the state machine receives a data call command sent by the application layer or application framework layer, the state machine triggers an action to establish a connection with the cellular data network, attempting to establish a connection with the cellular data network.
The data call command may include a connection parameter (ConnectionParameters, CP). The connection parameters are used to enable connection establishment with the cellular data network. The connection parameters may include an authentication parameter (creatals), a maximum channel number (channel_max), and the like.
If the state machine receives a data call command, the state machine stores connection parameters in the data call command 402. After receiving the data call command, the state machine switches from the dcinactive state to the dcactive state.
In conventional techniques, when an event triggers an application layer or an application framework layer to generate a data call command, the application layer or the application framework layer generates the data call command in response to the event. Therefore, there is no need to store the connection parameters in each generated data call command.
In the present application, after the application layer or the application framework layer generates the data call command, the data call command may be sent to the state machine, and then the state machine may store the connection parameters in the data call command, so as to generate the data call command again according to the stored connection parameters in the data call command after detecting the data call disconnection event. That is, it is not necessary for the application layer or the application framework layer to generate a data call command and transmit the generated data call command to the state machine when the data call disconnection event is detected later.
403, the state machine generates a data call instruction according to the connection parameters in the data call command. The data call instruction is used for controlling the Modem module to execute data call actions and establish connection with the cellular data network.
For example, the state machine may send a data call instruction to ril service module 3004, and ril service module 3004 may send a received data call instruction to the Modem module. After receiving the data call instruction, the Modem module executes a data call action corresponding to the data call instruction. Specifically, the state machine may encapsulate the data call instruction according to the RIL format, and send the data call instruction to the RIL service module 3004.
The state machine determines 404 whether the data call was successful.
If the data call fails, the state machine switches from the DcActivateState state back to the DcInactyState state. If the data call is successful, the state machine is switched from the DcActivate State state to the DcActivate State state.
After the Modem module performs the data call action corresponding to the data call instruction, the data call result corresponding to the data call action is sent to the ril service module 3004, and the ril service module 3004 sends the received data call result to the state machine. And the state machine determines whether the data call is successful or not according to the data call result returned by the Modem module and the RIL. The data call results may include a domain name system (Domain Name System, DNS) address, an internet protocol (Internet Protocol, IP) address, etc.
After the state machine enters the DcActivateState state, the application framework layer completes the necessary configuration (such as link configuration, routing configuration and the like) of the application networking in the application layer, and provides networking services for the application in the application layer.
After the state machine switches to the DcActivateState state, if a data call disconnection event is detected, the state machine executes 405, i.e., switches from the DcActivateState to the DcActivatingState state according to the detected data call disconnection event. When the state machine switches back to the dcactivating state, 403 is re-executed. When the state machine is in DcActivate state, the state machine generates a data call instruction again according to the connection parameters in the data call instruction, and sends the data call instruction to the Modem module.
The data call disconnect event is used to indicate that the current electronic device is not connected to the cellular data network. In some embodiments of the application, the Modem module detects a data call disconnect event and notifies the RIL of the data call disconnect event, which notifies the state machine of the received data call disconnect event.
After the state machine returns to the DcActivate state, a data call instruction is regenerated according to the stored connection parameters, so that the Modem module executes the data call action.
It will be appreciated that after re-execution 403, the state machine continues to execute 404, and the state machine determines whether the data call was successful.
If it is determined that the data call fails, the state machine switches from the dcactivating state back to the dcinactive state and notifies the application layer of a data call disconnect event. The state machine resides in the telephony manager 3002 in the application framework layer. Illustratively, the state machine may notify the connection service 3003 of a data call disconnect event through the telephony manager 3002. The data call disconnect event is notified by the connection service 3003 to an application in the application layer, such as to a video application in the application layer. Some video applications may preset hint rules. After detecting the data call disconnection event notified by the connection service 3003, the video application pops up a prompt box according to a preset prompt rule. The prompt box is used for prompting the user that the current video application has no network connection, for example, displaying 'current no network, please retry after detection'.
If the data call is determined to be successful, the state machine is switched from the DcActivate State state to the DcActivate State state. It will be appreciated that if it is determined that the data call is successful, the state machine will not notify the application layer of the data call disconnect event, which may be intercepted. That is, the state machine does not notify the connection service 3003 of the data call disconnection event through the phone manager 3002. The application program in the application program layer does not sense the data call disconnection event, so the application program does not generate a prompt for the data call disconnection event, namely, the no-network prompt is not popped up, and the number of times of popping up the no-network prompt is reduced.
In some embodiments of the present application, the state machine performs 405 a switch from the DcActivateState state back to the DcActivatingState state according to the detected data call disconnect event, which may specifically include:
if a data call disconnection event is detected, the state machine acquires a reason value corresponding to the data call disconnection event; and when the cause value is not the preset target cause value, the state machine is switched back to the DcActivate state from the DcActivate state.
After the state machine switches back to the dcactivating state, the state machine re-establishes the data call, i.e. re-executes 403, according to the connection parameters.
In some embodiments of the present application, when the cause value is a preset target cause value, the state machine switches from the DcActivateState state to the dcinactive state. After the state machine switches back to the dcinactive state, the application layer will be notified of the data call disconnect event.
In an embodiment of the present application, one or more target cause values may be preset according to a situation in which a data call cannot be re-established. For example, the target cause value may include: 0x08 (operator_barred, OPERATOR forbidden); 0x1B (missing_unknown_apn, UNKNOWN or invalid APN); 0x1D (user_authentication, AUTHENTICATION failure); 0x6F (protocol_error), PROTOCOL error; -5 (radio_power_off, modem powered down); 0x10001 (radio_not_available, modem is NOT AVAILABLE); 0x10002 (unacceptable_network_parameter), UNACCEPTABLE NETWORK errors. It will be appreciated that the above target cause values are merely illustrative and not limiting in any way.
By presetting the target cause value, only the data call disconnection event which does not carry the target cause value is reestablished, the number of times of data reestablishment on the data call disconnection event which cannot be reestablished can be reduced, the energy loss can be reduced, and a quick response can be given for the specific situation corresponding to the target cause value so as to remind the user that the network is disconnected in time.
In other embodiments of the present application, the state machine switches from the DcActivateState state back to the DcActivatingState state when the cause value is a preset specific cause value. After the state machine switches back to the dcactivating state, the state machine re-establishes the data call, i.e. re-executes 403, according to the connection parameters.
In embodiments of the present application, one or more specific cause values may be preset according to the situation in which a data call can be re-established. When the cause value is a preset specific cause value, determining that the state machine can reestablish the data call according to the stored connection parameters. The specific cause value may be set according to the actual situation, and is not limited in any way.
And when the cause value is not the preset specific cause value, the state machine is switched back to the DcInactive state from the DcActivatestate. After the state machine switches back to the dcinactive state, the application layer will be notified of the data call disconnect event. That is, when the cause value is not a preset specific cause value, the state machine does not reestablish the call.
By presetting the specific cause value, only the data call disconnection event carrying the specific cause value is reestablished, the number of times of data reestablishment on the data disconnection event which cannot reestablish the data call can be reduced, the energy loss can be reduced, and a quick response can be given for the specific situation corresponding to the non-specific cause value so as to remind the user that the network is disconnected in time. According to the state machine provided by the embodiment, after the data call disconnection event is detected, the data call is reestablished according to the connection parameters after the data call disconnection event is switched from the DcActivateState state to the DcActivatestate, if the data call is reestablished successfully, the data call disconnection event can not be notified to the application program layer, so that the application program in the application program layer does not feel the data call disconnection event, and the application program is prevented from generating a network-free prompt according to the data call disconnection event.
The state machine includes, in addition to the states in fig. 4, a dcdisconnectionstate, e.g., a state machine responsible for maintaining cellular data connection states as shown in fig. 5.
The DcDisconnectingState state indicates that the electronic device is automatically disconnecting from the cell, e.g., indicates that the application framework layer and the levels above it are automatically disconnecting from the cell. After the electronic device is completely disconnected from the cellular connection, the state machine switches from the dcdisconnectionstate state back to the dcinactive state.
As shown in FIG. 5, the state machine has operating logic comprising 501-507, wherein 501-505 are the same as 401-405 in FIG. 4 and are not described in detail herein. The state machine's operating logic further includes:
the state machine detects an automatic disconnect event 506 and switches from the DcActivateState state to the DcDisconnectingState state.
When the state machine is in the DcActivateState state, if an event that the electronic equipment actively disconnects the cellular connection (such as a cell switch to a Wi-Fi event and a user closes a mobile data switch event) is detected, the state machine is switched from the DcActivateState to the DcDisconnectingState.
507, the state machine determines that the cellular connection has been broken, and the state machine enters from the dcdisconnectionstate state to the dcinactive state. It will be appreciated that the state machine, upon entering the dcinactive state, will notify the application layer of a data call disconnect event. The notification procedure of the data call disconnection event is as described above and will not be described in detail herein. And after the application program in the application program layer detects the data call disconnection event, displaying the network-free prompt according to a preset rule.
Fig. 6 is a schematic diagram of a data communication method according to an embodiment of the present application, where the method is applied to an electronic device, and the electronic device includes an application program, a connection service, a phone manager, an RIL, and a Modem. As shown in fig. 6, the method may include:
In step S601, when the phone manager receives the data call command, the connection parameters in the data call command are stored.
The application layer or application framework layer may send a data call command to the telephony manager.
In step S602, the phone manager generates a data call instruction based on the connection parameters in the data call command.
In step S603, the phone manager sends a data call instruction to the RIL.
In step S604, the RIL sends a data call instruction to the Modem module.
In step S605, the Modem module executes a data call action corresponding to the data call instruction.
In step S606, the Modem module sends the data call result to the RIL.
In step S607, RIL sends the data call results to the telephony manager.
In step S608, the telephony manager determines whether the data call was successful. The telephony manager determines whether the data call was successful based on the data call results sent by the RIL.
If the data call fails, the process ends.
If the data call is successful, step S609 is performed.
In step S609, if the phone manager detects a data call disconnection event, the phone manager regenerates the data call instruction according to the connection parameters stored in S601.
In step S610, the phone manager sends a data call instruction to the RIL.
In step S611, the RIL sends a data call instruction to the Modem module.
In step S612, the Modem module executes a data call action corresponding to the data call instruction.
In step S613, the Modem module sends the data call result to the RIL.
In step S614, the RIL sends the data call results to the telephony manager.
In step S615, the telephony manager determines whether the data call was successful.
If the data call is successful, the telephony manager does not notify the application layer of the data call disconnect event. Accordingly, the application program will not generate a prompt for the event of disconnection of the data call, i.e. will not pop up a prompt without network, and the flow ends.
If the data call fails, step S616 is performed.
In step S616, the telephony manager notifies the connection service of a data call disconnect event.
In step S617, the connection service notifies the application of a data call disconnection event. The application program may comprise a video application.
In step S618, the application program displays the no-network prompt corresponding to the data call disconnection event.
Some embodiments of steps S601-618 can be seen in the related description of fig. 4, and will not be described here.
It will be appreciated that after step S615 is performed, the phone manager determines that the data call is successful, if a data call disconnection event is detected again, step S609 may be performed again, that is, after the data call disconnection event is detected again, the data call instruction is regenerated again according to the connection parameters, and the data call is established.
According to the data communication method provided by the embodiment, after the electronic equipment establishes the data call successfully, the data call can be actively reestablished based on the connection parameters when the data call is established when the data call disconnection event is detected, if the data call is reestablished successfully, the data call disconnection event can not be notified to the application program layer, so that the application program in the application program layer does not feel the data call disconnection event, and the application program is prevented from generating a network-free prompt according to the data call disconnection event, thereby effectively reducing the network-free prompt.
The present embodiment also provides a computer storage medium having stored therein computer instructions which, when executed on the electronic device 100, cause the electronic device 100 to perform the above-described related method steps to implement the data communication method in the above-described embodiments.
The present embodiment also provides a computer program product which, when run on a computer, causes the computer to perform the above-described related steps to implement the data communication method in the above-described embodiments.
In addition, embodiments of the present application also provide an apparatus, which may be embodied as a chip, component or module, which may include a processor and a memory coupled to each other; the memory is configured to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory, so that the chip performs the data communication method in the above method embodiments.
The electronic device, the computer storage medium, the computer program product, or the chip provided in this embodiment are used to execute the corresponding methods provided above, so that the beneficial effects thereof can be referred to the beneficial effects in the corresponding methods provided above, and will not be described herein.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated unit may be stored in a readable storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present application and not for limiting the same, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present application without departing from the spirit and scope of the technical solution of the present application.

Claims (9)

1. A data communication method applied to an electronic device, the method comprising:
generating a data call command and storing connection parameters in the data call command;
establishing a data call based on the connection parameters;
after the data call is established successfully, if a data call disconnection event is detected, reestablishing the data call based on the connection parameters, including: if a data call disconnection event is detected, determining whether a cause value corresponding to the data call disconnection event is a preset target cause value; when the cause value is not the preset target cause value, reestablishing a data call based on the connection parameter;
if the data call is successfully reestablished based on the connection parameters, the electronic equipment does not display a network-free prompt corresponding to the data call disconnection event.
2. The data communication method according to claim 1, characterized in that the method further comprises:
and if the data call is failed to be reestablished based on the connection parameters, the electronic equipment displays a network-free prompt corresponding to the data call disconnection event.
3. The data communication method of claim 2, wherein the electronic device comprises an application layer, an application framework layer, a wireless interface layer, and a modem processor, the application framework layer comprising a telephony manager;
the generating a data call command includes: the application program layer generates a data call command; or the application framework layer generates a data call command;
the storing the connection parameters in the data call command includes: the telephone manager stores connection parameters in the data call command;
said establishing a data call based on said connection parameters comprises: the telephone manager generates a data call instruction based on the connection parameters and sends the data call instruction to the wireless interface layer; the wireless interface layer sends the received data call instruction to the modem processor; the modem processor executes a data call action according to the data call instruction;
The reestablishing the data call based on the connection parameters includes: the telephone manager regenerates a data call instruction based on the connection parameters and sends the regenerated data call instruction to the wireless interface layer; the wireless interface layer sends the received data call instruction to the modem processor; the modem processor executes a data call action according to the data call instruction;
the electronic device not displaying the no-network prompt corresponding to the data call disconnection event includes: the telephone manager does not notify an application program layer of the data call disconnection event, and the application program layer does not generate a network-free prompt corresponding to the data call disconnection event;
the electronic device displaying the network-free prompt corresponding to the data call disconnection event comprises: the telephone manager notifies the data call disconnection event to an application program layer, and the application program layer generates a network-free prompt corresponding to the data call disconnection event and displays the network-free prompt.
4. The data communication method of claim 1, wherein the electronic device comprises a state machine comprising a data connection inactive state, a data connection active state, and a data connection active state, the method further comprising:
When the state machine is in the data connection inactive state, if a data call command is received, the state machine is switched from the data connection inactive state to the data connection active state, and the data connection active state is used for establishing a data call;
if the state machine successfully establishes a data call according to the data call command, the state machine is switched from the data connection activating state to the data connection activated state;
when the state machine is in the data connection activated state, if a data call disconnect event is detected, the state machine switches from the data connection activated state back to the data connection active state.
5. The method of claim 4, wherein if a data call disconnect event is detected, the state machine switching from the data connection activated state back to the data connection active state comprises:
if the data call disconnection event is detected and the reason value corresponding to the data call disconnection event is not a preset target reason value, the state machine switches from the data connection activated state back to the data connection activated state.
6. The data communication method of claim 4, wherein after the state machine switches from the data connection activated state back to the data connection being activated state, the method further comprises:
if the state machine is in the data connection activating state and successfully establishes a data call, the state machine is switched from the data connection activating state to the data connection activated state;
and if the state machine is in the data connection activating state and the data call establishment fails, the state machine is switched from the data connection activating state to the data connection non-activating state.
7. The method of data communication according to claim 4, wherein the method further comprises:
and if a data call disconnection event is detected and the reason value corresponding to the data call disconnection event is a preset target reason value, the state machine is switched from the data connection activated state to the data connection non-activated state.
8. An electronic device comprising a memory and a processor;
the memory is used for storing program instructions;
the processor is configured to read the program instructions stored in the memory to implement the data communication method according to any one of claims 1 to 7.
9. A computer readable storage medium having stored therein computer readable instructions which when executed by a processor implement the data communication method of any of claims 1 to 7.
CN202210382342.9A 2022-04-12 2022-04-12 Data communication method, electronic device and storage medium Active CN115550423B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210382342.9A CN115550423B (en) 2022-04-12 2022-04-12 Data communication method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210382342.9A CN115550423B (en) 2022-04-12 2022-04-12 Data communication method, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN115550423A CN115550423A (en) 2022-12-30
CN115550423B true CN115550423B (en) 2023-09-05

Family

ID=84723552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210382342.9A Active CN115550423B (en) 2022-04-12 2022-04-12 Data communication method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN115550423B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116170415B (en) * 2023-04-19 2023-09-26 荣耀终端有限公司 Call processing method, device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106488552A (en) * 2015-08-31 2017-03-08 上海摩波彼克半导体有限公司 A kind of registration process control method and system and mobile terminal
CN109474579A (en) * 2018-10-22 2019-03-15 北京龙创悦动网络科技有限公司 A kind of method and apparatus of network reconnection
CN112218388A (en) * 2020-09-15 2021-01-12 贵阳朗玛信息技术股份有限公司 Method and device for reconnection of broken network

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8055761B2 (en) * 2007-01-31 2011-11-08 International Business Machines Corporation Method and apparatus for providing transparent network connectivity

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106488552A (en) * 2015-08-31 2017-03-08 上海摩波彼克半导体有限公司 A kind of registration process control method and system and mobile terminal
CN109474579A (en) * 2018-10-22 2019-03-15 北京龙创悦动网络科技有限公司 A kind of method and apparatus of network reconnection
CN112218388A (en) * 2020-09-15 2021-01-12 贵阳朗玛信息技术股份有限公司 Method and device for reconnection of broken network

Also Published As

Publication number Publication date
CN115550423A (en) 2022-12-30

Similar Documents

Publication Publication Date Title
EP4072111A1 (en) Screen-on control method and electronic device
US12028914B2 (en) Data transfer method and electronic device
EP4109967A1 (en) Method for switching between sim card and esim card, and electronic device
EP4156625A1 (en) Data synchronization method, electronic device, and computer readable storage medium
CN114615423B (en) Callback flow processing method and device
CN114115770B (en) Display control method and related device
EP4135303A1 (en) Method for preventing missed calls, system, electronic device, and storage medium
CN115567630B (en) Electronic equipment management method, electronic equipment and readable storage medium
EP4106238A1 (en) Wireless communication system and method
US20240008107A1 (en) Communication connection establishment method and system, electronic device, and storage medium
CN114885395B (en) Data communication method, electronic device, and computer storage medium
US20240126224A1 (en) Switch Switching Method and Related Apparatus
EP3852395B1 (en) File transmission method and electronic device
CN115550423B (en) Data communication method, electronic device and storage medium
CN113810451B (en) Method and device for establishing point-to-point link, first terminal equipment and storage medium
CN114698078B (en) Transmission power adjustment method, electronic device, and storage medium
EP4280596A1 (en) Video call method and related device
CN117425227A (en) Method and device for establishing session based on WiFi direct connection
US11977946B2 (en) Method for automatically activating NFC application and terminal
CN110737916A (en) Communication terminal and processing method
CN114125805B (en) Bluetooth reconnection method and terminal equipment
CN116667875B (en) Switching method and device of internet access and terminal equipment
CN115580541B (en) Information synchronization method and electronic equipment
CN114945176B (en) Clipboard access control method, electronic equipment and storage medium
CN114329595B (en) Application program detection method, device, storage medium and program product

Legal Events

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