Network connection method and electronic equipment
By identifying the transmission layer intercepting packet events initiated by the application layer, disconnecting and reconnecting the packet switching domain, the network connection problem caused by the underlying abnormality of the electronic device is solved, and the network connection is quickly restored, improving user experience and efficiency.
Patent Information
- Application Number
- CN202410376847.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-27
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-03-27
AI Technical Summary
When electronic devices are abnormal at the bottom, they cannot successfully send data packets, resulting in a long period of inability to access the Internet, and it is difficult for the existing technology to quickly restore network connections.
By identifying the transmission layer intercepting packet events initiated by the application layer, disconnecting and reconnecting the packet switching domain, the network connection is restored, and the data service shutdown and re-opening method is used to restore the network connection without the user's perception.
It improves the efficiency of network abnormal recovery, improves users' online experience, can quickly detect and deal with network problems, and reduces misidentification and power consumption.
Smart Images

Figure CN119277568A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electronic equipment, and in particular to a network connection method and electronic equipment. Background Art
[0002] Currently, users access the Internet through mobile phones, computers and other electronic devices, which has become an indispensable part of their lives.
[0003] When using electronic devices to access the Internet, data packets are transmitted. For example, data packets from electronic device 1 are transmitted to electronic device 2 via the network. If an abnormality occurs in the bottom layer (such as the data link layer) of electronic device 1, the data packets sent by the upper layer (such as the application layer) of electronic device 1 will not be able to reach the bottom layer, and thus cannot be successfully sent out, causing the electronic device to be unable to access the Internet for a long time. Summary of the invention
[0004] The embodiments of the present application provide a network connection method and an electronic device, which can improve the efficiency of restoring network connection of the electronic device.
[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a network connection method is provided, which can be applied to an electronic device, and the method includes: the electronic device identifies a first event, and the first event includes that the transport layer in the electronic device intercepts a data packet initiated by the application layer. When the electronic device identifies the first event, the electronic device disconnects the packet switching domain of the current electronic device, and reconnects the packet switching domain after disconnecting the packet switching domain. After the electronic device reconnects the packet switching domain, the electronic device identifies a second event, and the second event includes that the transport layer does not intercept the data packet initiated by the application layer. Among them, when the electronic device identifies the first event, it can be considered that the network connection is disconnected, and when the electronic device identifies the second event, it can be considered that the network connection is restored.
[0007] By adopting the above technical solution, after detecting that the transport layer in the electronic device intercepts the data packet initiated by the application layer, the electronic device can restore the network connection by disconnecting the packet switching domain of the current electronic device and then reconnecting the packet switching domain. The electronic device restores the network connection when the electronic device detects that the transport layer does not intercept the data packet initiated by the application layer. As a result, the electronic device can automatically detect network problems and perform corresponding processing in a timely manner, thereby improving the efficiency of network abnormality recovery and improving the Internet experience.
[0008] In a possible implementation of the first aspect, the method further includes: when the electronic device recognizes the first event, the electronic device shuts down the data service, and reopens the data service after shutting down the data service. In this solution, after the electronic device detects the event that the transport layer intercepts the data packet initiated by the application layer, the electronic device can first restore the network connection by reactivating the data service, that is, shutting down the data service and then reopening the data service. The method of shutting down the data service and then reopening the data service by the electronic device can restore the network connection without the user's perception, thereby improving the user's Internet experience.
[0009] In a possible implementation of the first aspect, it also includes: the electronic device identifies a flag bit contained in an event; wherein the preset flag bit is used to instruct the transport layer in the electronic device to intercept a data packet initiated by the application layer; if the electronic device identifies the preset flag bit, the event corresponding to the preset flag bit is taken as the first event.
[0010] In a possible implementation of the first aspect, the electronic device disconnects the packet switching domain of the current electronic device, and reconnects to the packet switching domain after disconnecting the packet switching domain, including: after the electronic device restarts the data service and the electronic device has not restored the network connection, the electronic device disconnects the packet switching domain of the current electronic device, and reconnects to the packet switching domain after disconnecting the packet switching domain. In this solution, the electronic device may fail to restore the network connection by turning off the data service and then restarting the data service. At this time, the electronic device can also reset the underlying state of the electronic device by disconnecting the packet switching domain and then reconnecting the packet switching domain to restore the network connection.
[0011] In a possible implementation of the first aspect, after the electronic device reopens the data service, the method further includes: the electronic device detects whether a first event is recognized; if the electronic device recognizes the first event, the electronic device does not restore the network connection; if the electronic device does not recognize the first event, the electronic device restores the network connection. In this solution, the electronic device recognizes the first event, that is, the electronic device detects that the transport layer intercepts the data packet initiated by the application layer, then the data initiated by the application layer cannot be passed to the bottom layer, and thus cannot be transmitted to the network, then it means that the electronic device has not restored the network. The electronic device does not recognize the first event, that is, the electronic device detects that the transport layer no longer intercepts the data packet initiated by the application layer, then the data initiated by the application layer can be passed to the bottom layer, and thus can be transmitted to the network, then it means that the electronic device has restored the network. Among them, the electronic device can detect the TCP not allowed command reported by the bottom layer as the first event.
[0012] It should be noted that the time taken for the electronic device to identify the command is very short, that is, the electronic device can quickly determine whether the electronic device has restored the network connection, or, the electronic device can quickly identify the first event and perform subsequent operations of closing and reopening the data service and / or disconnecting and reconnecting the packet switching domain to improve the efficiency of restoring the network connection.
[0013] In a possible implementation of the first aspect, after the electronic device restarts the data service, the method further includes: the electronic device calculates the retransmission ratio of the retransmission data packet of the transport layer in the total data packet of the transport layer; if the retransmission ratio is greater than a preset ratio, the electronic device does not restore the network connection; if the retransmission ratio is not greater than the preset ratio, the electronic device restores the network connection. The preset ratio may be 99%, and if the retransmission ratio is greater than 99%, the electronic device does not restore the network connection.
[0014] In a possible implementation of the first aspect, when the electronic device recognizes a first event, the electronic device disconnects the packet switching domain of the current electronic device, and reconnects the packet switching domain after disconnecting the packet switching domain, including: when the electronic device recognizes the first event and an application using the network is running in the foreground of the electronic device, the electronic device disconnects the packet switching domain of the current electronic device, and reconnects the packet switching domain after disconnecting the packet switching domain.
[0015] This solution can restore the network connection by disconnecting and reconnecting the packet switching domain when the first event is identified during the application Internet access process, can quickly detect the cause of the network anomaly, and improve the efficiency of restoring the network connection.
[0016] In this solution, in order to save power consumption, when no application using the network is running in the foreground of the electronic device, the electronic device will not perform subsequent operations even if it recognizes the first event.
[0017] In a possible implementation of the first aspect, the first event includes that the duration of the transport layer in the electronic device intercepting the data packet initiated by the application layer is greater than the preset duration. In this solution, if the electronic device recognizes that the bottom layer reports the TCP not allowed command continuously, and the duration is greater than the preset duration, it can be considered that the electronic device recognizes that the duration of the transport layer in the electronic device intercepting the data packet initiated by the application layer is greater than the preset duration. The preset duration can be, for example, 3 seconds. Therefore, by setting the preset duration, the electronic device can improve the accuracy of the electronic device in identifying the first event and reduce the probability of misidentification.
[0018] In a possible implementation of the first aspect, before the electronic device disconnects the packet switching domain of the current electronic device and reconnects to the packet switching domain after disconnecting the packet switching domain, it also includes: the electronic device displays a first interface, and the first interface includes prompt information that the data network of the electronic device is unavailable. In the case where an application that uses the network is running in the foreground of the electronic device, if a prompt information that the data network is unavailable appears on the application interface, it can be considered that the electronic device cannot use the network normally at this time. At this time, the network connection can be restored by disconnecting the packet switching domain of the current electronic device and reconnecting to the packet switching domain.
[0019] In a possible implementation of the first aspect, after the electronic device recognizes the second event, the method further includes: the electronic device displays a second interface, and the second interface does not include prompt information that the data network of the electronic device is unavailable. In this solution, the network connection can be restored by disconnecting the packet switching domain of the current electronic device and then reconnecting the packet switching domain. As a result, the information prompting that the data network is unavailable no longer appears in the interface of the electronic device, and the user can access the Internet normally.
[0020] In a second aspect, the present application provides an electronic device, comprising: a communication module, a memory and one or more processors; the communication module, the memory and the processor are coupled; wherein the memory stores computer program code, the computer program code comprises computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the network connection method of any one of the above-mentioned first aspects.
[0021] In a third aspect, the present application provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is executed on a computer, the computer can execute any one of the network connection methods in the first aspect.
[0022] In a fourth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any one of the network connection methods in the first aspect.
[0023] It can be understood that the electronic device of the second aspect provided above, the computer-readable storage medium of the third aspect and the computer program product of the fourth aspect are all used to execute the corresponding network connection method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of data transmission provided in an embodiment of the present application;
[0025] Figure 2A schematic diagram of a transmission path of an uplink data packet provided in an embodiment of the present application;
[0026] Figure 3 A schematic diagram of an interface display in which a mobile phone cannot access the Internet provided in an embodiment of the present application;
[0027] Figure 4 A schematic diagram of the hardware structure of a mobile phone provided in an embodiment of the present application;
[0028] Figure 5 A diagram of the interface changes of a mobile phone provided in an embodiment of the present application;
[0029] Figure 6 A diagram of the interface changes of a mobile phone provided in an embodiment of the present application;
[0030] Figure 7 A flowchart of a network connection method provided in an embodiment of the present application;
[0031] Figure 8 A flowchart of another network connection method provided in an embodiment of the present application;
[0032] Fig. 9 A schematic diagram of a software architecture of an electronic device provided in an embodiment of the present application;
[0033] Fig.10 A schematic diagram of the structure of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The following will describe the technical solutions in the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.
[0035] It should be noted that the following terms "first", "second", etc. are only used for descriptive purposes and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, features defined as "first", "second", etc. may explicitly or implicitly include one or more of the features. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0036] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.
[0037] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0038] In order to better illustrate the technical solution of the present application, the following is a brief overview of the terms involved in the present application.
[0039] (1) Transmission Control Protocol (TCP): is a connection-oriented, reliable, byte-stream-based transport layer communications protocol. TCP is designed to fit into a layered protocol hierarchy that supports multi-network applications. TCP is capable of providing reliable communications services to pairs of processes in a host computer that is connected to different but interconnected computer communications networks. TCP assumes that simple, potentially unreliable datagram services are available from lower-level protocols. TCP is capable of operating on a variety of communications systems, from hard-wired connections to packet-switched or circuit-switched networks.
[0040] (2) Dump the traffic on a network (TCPdump) is a network data collection and analysis tool that can completely intercept data packets transmitted on the network and provide analysis according to user needs.
[0041] (3) Transmission Control Protocol / Internet Protocol (TCP / Internet Protocol, IP), also known as the network communication protocol, is the most basic communication protocol in the use of the network. The TCP / IP protocol is divided into four layers from top to bottom, namely the application layer (Application Layer), the transport layer (Transport Layer), the network layer (Internet Layer, or Internet layer) and the network interface layer (Network Interface Layer, also known as the data link layer, link layer).
[0042] When two devices use TCP / IP for network communication, data packets will communicate with the other end in a layered order. The sender goes down from the application layer, and the receiver goes up from the link layer. From the client to the server, the data transmission order of each frame is: application layer-->transport layer-->network layer-->link layer-->link layer-->network layer-->transport layer-->application layer.
[0043] See also Figure 1 , Figure 1 A schematic diagram of data transmission provided in an embodiment of the present application. Figure 1 As shown, electronic device 1 sends data to electronic device 2 via TCP / IP. After the data is encapsulated and processed at each layer, it will be delegated to the next layer for processing. The data of electronic device 1 is transmitted from the application layer to the transport layer, network layer, and link layer in sequence. The data of the link layer of electronic device 1 is transmitted through the network medium and reaches the link layer of electronic device 2. Then, the link layer of electronic device 2 transmits the received data to the network layer, transport layer, and application layer in sequence. Figure 1 The arrow in the figure indicates the direction of data transmission.
[0044] (4) Socket is an intermediate software abstraction layer for communication between the application layer and the TCP / IP protocol. It is a set of interfaces. The application of host A must establish a connection through Socket to communicate with the application of host B. Establishing a Socket connection requires the underlying TCP / IP protocol to establish a TCP connection. Among them, establishing a TCP connection requires the underlying IP protocol to address the host in the network.
[0045] Socket connection is a communication mechanism in computer networks, which allows two programs to communicate over the network on different computers. When using sockets for communication, one program acts as a client and the other as a server, and data can be transmitted between the two by creating and using sockets. Sockets can be understood as an interface for network communication, providing a standard communication method that enables different programs to exchange data on the network.
[0046] Socket connection is used to establish a communication node, so that the local process can communicate with other processes or servers over the network to achieve data transmission and reception.
[0047] As described in the background technology above, when an electronic device is connected to the Internet normally, data will also communicate normally, and the application can use the Socket library to initiate a Socket connection and establish a data stream. If an abnormality occurs in the bottom layer of the electronic device, then the bottom layer will report an error indication message (such as the tcp not allowed command) to the kernel module, causing the Socket connection initiated by the application to be intercepted by the kernel module. As a result, the data packets sent by the application cannot reach the bottom layer, and cannot be successfully sent out from the bottom layer, which in turn causes the electronic device to be unable to access the Internet for a long time.
[0048] When the bottom layer enters an abnormal state, it will report an event containing the command tcp not allowed. After the upper layer registers the flag in the event, the TCP layer will intercept the upstream data packet based on the flag. The kernel module log can see the print record corresponding to the application initiating the Socket connection, but TCPdump cannot see the print record corresponding to the Socket establishment. Therefore, the TCP layer has only the upper layer but no lower layer. The data packet is intercepted at the TCP layer and cannot reach the transport layer, and thus cannot reach the bottom layer to complete the transmission.
[0049] The bottom layer is the link layer, the upper layer is the application layer, the TCP layer is the transport layer, and the uplink data packet is the data packet sent from the user device (such as a computer or mobile phone) to the network. Figure 2 , Figure 2 A schematic diagram of an uplink data packet transmission path provided in an embodiment of the present application. Figure 2 As shown in the figure, the data packet sent by the application layer notifies the transport layer to establish a socket connection. After the transport layer establishes the socket connection, the data packet will reach the hardware acceleration module (IPA module) through the network card, and then the IPA module will transmit the data packet to the link layer. The packet data convergence protocol (PDCP) of the link layer will send the data packet to the network. Figure 2 The direction indicated by the arrow is the data packet transmission direction.
[0050] If an exception occurs in the link layer, the link layer will report the tcp not allowed command, which indicates that the link layer is unable to send data packets. As a result, the transport layer will intercept the data packets sent by the application layer based on the command reported by the link layer. In other words, the entire path for electronic devices to transmit data packets is interrupted at the transport layer. All data packets sent by the application layer at this time cannot reach the bottom layer smoothly to complete the transmission, resulting in users being unable to access the Internet.
[0051] See also Figure 3 , Figure 3This is a schematic diagram of an interface display in which a mobile phone cannot access the Internet provided in an embodiment of the present application. Figure 3 As shown, if the underlying abnormality causes the mobile phone to be unable to access the Internet, then the interface of the mobile phone may display a prompt message 101, and the prompt message 101 may be "the current network is unavailable".
[0052] Normally, when a mobile phone is running an application, if an underlying abnormality occurs and the application cannot access the Internet, the above prompt information will be displayed on the application interface.
[0053] In order to solve the above problems, an embodiment of the present application proposes a network connection method, which can be applied to electronic devices.
[0054] If the electronic device recognizes the target event (first event), this target event is used to indicate that there is an abnormality in the bottom layer of the electronic device. The target event includes the transport layer in the electronic device intercepting the data packet initiated by the application layer. Then, the electronic device can disconnect the packet switching domain of the current electronic device and reconnect the packet switching domain, which is equivalent to initializing the state of the bottom layer and restoring the network connection. Among them, the electronic device restores the network connection, that is, the electronic device detects that the transport layer did not intercept the data packet initiated by the application layer (the second event). As a result, the electronic device can automatically detect network problems and perform corresponding processing in a timely manner, which improves the efficiency of network abnormality recovery and improves the Internet experience.
[0055] Exemplarily, the electronic device in the embodiments of the present application may be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, a vehicle-mounted device, and the like, which can execute the file processing method provided in the embodiments of the present application. The embodiments of the present application do not impose any special restrictions on the specific form of the electronic device.
[0056] The embodiment of the present application is described by taking a mobile phone as an example of the electronic device. Figure 4 FIG. 1 shows a schematic diagram of the hardware structure of a mobile phone 100. Figure 4As shown, the mobile phone 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.
[0057] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0058] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0059] The controller may be the nerve center and command center of the mobile phone 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0060] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0061] In an embodiment of the present application, the processing 110 can identify a first event, and the first event includes that the transport layer in the mobile phone intercepts a data packet initiated by the application layer. When the mobile phone identifies the first event, the mobile phone disconnects the packet switching domain of the current mobile phone, and reconnects to the packet switching domain after disconnecting the packet switching domain, and restores the network connection by resetting the state of the bottom layer of the mobile phone. After the mobile phone reconnects to the packet switching domain, the processing 110 can identify a second event, and the second event includes that the transport layer does not intercept the data packet initiated by the application layer.
[0062] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0063] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0064] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the mobile phone 100. While the charging management module 140 is charging the battery 142, it may also power the mobile phone 100 through the power management module 141.
[0065] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.
[0066] The wireless communication function of the mobile phone 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0067] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in mobile phone 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0068] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the mobile phone 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0069] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate 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. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0070] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the mobile phone 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0071] In some embodiments, the antenna 1 of the mobile phone 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0072] The mobile phone 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0073] The display screen 194 is used to display images, videos, etc. 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 (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the mobile phone 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0074] The mobile phone 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0075] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0076] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the mobile phone 100 (such as audio data, a phone book, etc.), etc. In addition, 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 disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0077] The mobile phone 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.
[0078] 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 signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0079] The pressure sensor is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor can be set on the display screen 194. There are many types of pressure sensors, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor, the capacitance between the electrodes changes. The mobile phone 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the mobile phone 100 detects the touch operation intensity according to the pressure sensor. The mobile phone 100 can also calculate the touch position according to the detection signal of the pressure sensor. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0080] The key 190 includes a power key, a volume key, etc. The key 190 can be a mechanical key or a touch key. The mobile phone 100 can receive key input and generate key signal input related to the user settings and function control of the mobile phone 100.
[0081] The methods in the following embodiments can all be implemented in the mobile phone 100 having the above hardware structure.
[0082] A network connection method provided in an embodiment of the present application is applied to an electronic device, wherein the electronic device takes a mobile phone as an example, and specifically comprises the following steps:
[0083] Step S201: The mobile phone identifies a target event.
[0084] The mobile phone can determine whether to intercept the uplink data packet based on the detected event.
[0085] The tcp not allowed command reported by the bottom layer can be set as the target event. If the mobile phone recognizes the event reported by the bottom layer as the target event, the mobile phone will intercept the data packet sent by the application layer at the transport layer. If the event detected by the mobile phone does not contain the tcp not allowed command, the mobile phone will not intercept the data packet sent by the application layer at the transport layer.
[0086] Among them, the mobile phone can determine whether to intercept the data packet by detecting the flag bit contained in the event. For example, let the flag bit corresponding to the tcpnot allowed command be 1, and the flag bit corresponding to other commands be 0. If the mobile phone detects that the flag bit contained in the event is 1, then the mobile phone will intercept the uplink data packet at the transport layer. If the mobile phone detects that the flag bit contained in the event is 0, then the mobile phone will not intercept the uplink data packet at the transport layer.
[0087] In the embodiment of the present application, if the mobile phone detects that the bottom layer continuously reports the tcp not allowed command and the duration exceeds the preset duration, the mobile phone identifies the target event. The preset duration may be 3 seconds, 4 seconds, etc.
[0088] In the embodiment of the present application, the mobile phone may also recognize the bottom-level reporting tcp not allowed command as the recognition of the target event, and only perform subsequent steps when the mobile phone recognizes the target event and the duration of the target event exceeds the preset duration.
[0089] Among them, the causes of underlying exceptions may include chip exceptions, protocol stack interaction exceptions, timer exceptions, etc.
[0090] Step S202: The mobile phone reactivates the data service.
[0091] In the embodiment of the present application, when the mobile phone detects that a network application is running in the foreground, if the target event is identified, the data service is deactivated. Among them, the mobile phone can obtain the network-using application running in the foreground of the mobile phone by scanning the network connection interface of the mobile phone. Network application refers to an application that uses the network. Data services include other services except the circuit switched domain (CS) voice service of mobile communications.
[0092] When there is no network application running in the foreground, such as when the screen is off, the phone will not reactivate the data service. In this way, the phone will only activate the data service when there is a network application running in the foreground, which can save power consumption of the phone.
[0093] It should be noted that regardless of whether there is a network application running in the foreground, the mobile phone can identify the events reported by the bottom layer.
[0094] The mobile phone can reactivate the data service switch by first turning off the data service and then turning it back on. When the data service of the mobile phone is turned off, the mobile phone cannot use the application program through data traffic, that is, the mobile phone cannot use uplink traffic to send uplink data. When the data service of the mobile phone is turned on, the mobile phone can use the application program through data traffic, that is, the mobile phone can use uplink traffic to send uplink data.
[0095] The opening and closing of the data service of the mobile phone can be realized through the TelephonyManager interface. Among them, the TelephonyManager interface provides an interface for accessing the device telephone and mobile communication related information in the application framework layer.
[0096] In the embodiment of the present application, the mobile phone can also add a self-developed module between the application layer and the transport layer, which can call the corresponding interface to open or close the data service. Among them, the module is decoupled from the native code of the application framework to facilitate subsequent maintenance of the module. The mobile phone can achieve the same functions as the above-mentioned TelephonyManager interface through the above-mentioned self-developed module.
[0097] Among them, after the above-mentioned mobile phone turns off the data service, turning on the data service again simulates the user manually turning off and turning on the data service in a way that the user is not aware of.
[0098] After the mobile phone turns off the data service and then turns it back on, it will re-detect the command reported by the bottom layer. If the mobile phone does not detect the TCP not allowed command reported by the bottom layer, or the flag bit contained in the event re-detected by the mobile phone is 0, the mobile phone will not intercept the uplink data packet at the transport layer. At this time, the mobile phone successfully reactivated the data service.
[0099] If the mobile phone successfully reactivates the data service, the mobile phone will resume network connection and can start surfing the Internet again.
[0100] If the mobile phone can still detect the tcp not allowed command reported by the bottom layer, it means that the mobile phone has not restored the network connection after reactivating the data service.
[0101] In some embodiments, the mobile phone can also determine whether the network connection has been restored by determining whether it is in a scenario where the TCP layer has uplink but no downlink. Specifically, the mobile phone can calculate the ratio of abnormal TCP messages to normal TCP messages, that is, the ratio of retransmitted data packets, by counting the data packets of the TCP layer once per second. If the abnormal message ratio is 100%, it means that the current scenario is an uplink but no downlink scenario. If the mobile phone detects that it is still in a scenario where the TCP layer has uplink but no downlink, that is, the transmission link of the data packet has not been restored, then it means that the network connection has not been restored. Among them, the TCP message is the data unit transmitted by the TCP layer, also called a message segment. When there is a problem with the mobile phone itself or the network, the TCP layer may generate abnormal messages.
[0102] See also Figure 5 , Figure 5 This is a diagram of a mobile phone interface change provided by an embodiment of the present application. Figure 5 As shown, after the mobile phone turns off the data service and then turns on the data service again, the mobile phone interface changes from interface 501 to interface 502, and the prompt information for prompting the user that there is no network connection is no longer displayed in interface 502.
[0103] It is understandable that the process of reactivating the data service of the mobile phone is relatively fast, and the signal icon on the mobile phone interface can remain displayed. Figure 5 The signal icon 503 remains displayed during the process of the interface 501 changing to the interface 502 .
[0104] Step S203: If the network connection cannot be restored after reactivating the data service, the mobile phone reconnects to the Packet Switch (PS) domain.
[0105] In the embodiment of the present application, if the mobile phone fails to reactivate the data service, that is, the mobile phone fails to restore the network connection after turning off the data service and then turning on the data service again, at this time, the mobile phone can still detect the TCP not allowed command reported by the bottom layer. Then, the mobile phone can initialize the bottom layer state.
[0106] The mobile phone can reattach the PS domain to initialize the underlying state. The PS domain is mainly responsible for providing data transmission and multimedia services, such as web browsing, email, instant messaging, etc.
[0107] The mobile phone can first unregister the currently connected network, that is, disconnect the mobile phone from the base station, and then re-request to connect to the network. Specifically, the mobile phone sends a network disconnection request to the PS domain network connection management module in the mobile phone. After the mobile phone unregisters the connected network, it sends a network connection request to the PS domain network connection management module to re-connect to the network.
[0108] It is understandable that since the mobile phone is disconnected and then reconnected to the PS domain, it is equivalent to initializing the underlying state of the mobile phone. The transport layer of the mobile phone will no longer intercept the data packets sent by the upper-layer application, and the network connection can be restored.
[0109] See also Figure 6 , Figure 6 This is a diagram of a mobile phone interface change provided by an embodiment of the present application. Figure 6 As shown in FIG. 6 , during the process of the mobile phone reconnecting to the PS domain, the signal icon of the mobile phone will change. When the mobile phone is disconnected from the PS domain, the mobile phone interface 601 is as follows Figure 6 As shown in (a), the signal icon is not displayed. When the mobile phone reconnects to the PS domain, the mobile phone interface 601 is as follows Figure 6 As shown in (b) , a signal icon 603 is displayed.
[0110] Thus, when the mobile phone identifies the target event, which includes the transport layer in the electronic device intercepting the data packet initiated by the application layer, the mobile phone can first disconnect the data service and then reopen the data service to restore the network connection. If the above operation fails to restore the network connection, the mobile phone disconnects the PS domain and reconnects the PS domain after disconnecting the PS domain to restore the network connection, so that the mobile phone can use the network again.
[0111] Another network connection method provided in an embodiment of the present application is applied to an electronic device, wherein the electronic device takes a mobile phone as an example, and specifically includes the following steps:
[0112] Step S301: The mobile phone recognizes a target event.
[0113] Among them, step S301 can refer to the aforementioned step S201, and the embodiment of the present application will not be described in detail here.
[0114] Step S302: The mobile phone reconnects to the PS domain.
[0115] Among them, step S302 can refer to the specific steps of "mobile phone reconnecting to PS domain" in the aforementioned step S203, and the embodiment of the present application will not be described in detail here.
[0116] In the embodiment of the present application, the mobile phone can reconnect to the PS domain if the target event is recognized when a network application is detected to be running in the foreground. When there is no network application running in the foreground, such as when the screen is off, the mobile phone will not reconnect to the PS domain. In this way, the mobile phone will reconnect to the PS domain only when a network application is running in the foreground, which can save power consumption of the mobile phone.
[0117] It should be noted that the mobile phone can identify the target event regardless of whether there is a network application running in the foreground.
[0118] Therefore, when the mobile phone identifies a target event, which includes the transport layer in the electronic device intercepting a data packet initiated by the application layer, the mobile phone can disconnect the PS domain and reconnect the PS domain after disconnecting the PS domain to restore the network connection, thereby improving the efficiency of restoring the network connection.
[0119] See also Figure 7 , Figure 7 FIG. 1 is a flowchart of a network connection method. Figure 7 As shown, the mobile phone can first detect whether there is an application surfing the Internet in the foreground. If the mobile phone detects that there is an application surfing the Internet in the foreground (S701), then the mobile phone detects whether the bottom layer reports the TCP not allowed command. If the mobile phone detects that the bottom layer continues to report the TCP not allowed command, and the duration exceeds 3 seconds (S702), then the mobile phone turns off and then turns on the data service, and determines whether the network connection is restored (S703). If the network connection is restored, then it means that the self-healing of the mobile phone is effective (S704), and the mobile phone can surf the Internet normally again. If the network connection is not restored, the mobile phone reconnects to the PS domain (S705), and then the self-healing of the mobile phone is completed (S706), and the mobile phone can surf the Internet normally again.
[0120] In some examples, after turning off and then turning on the data service, the mobile phone can also determine whether the network connection has been restored by counting the data packets at the TCP layer, calculating the proportion of retransmitted data packets, and judging whether the TCP is in a scenario where there is only uplink but no downlink.
[0121] Therefore, when the mobile phone has an application surfing the Internet in the foreground, if an event indicating an underlying abnormality is detected, the network connection can be restored by turning off and on the data service, or reconnecting to the PS domain when turning off and on the data service is ineffective. This solution can automatically complete network detection and self-healing, improving the user's Internet experience.
[0122] In some scenarios, see Figure 8 , Figure 8 A schematic diagram of a network connection method provided in an embodiment of the present application. Figure 8 As shown, if the mobile phone detects that an application is surfing the Internet in the foreground (S801), then the mobile phone counts the data packets and retransmitted data packets of the TCP layer once per second (S802). The mobile phone determines whether the data packets are continuously retransmitted and the duration exceeds 6 seconds (S803).
[0123] The mobile phone can calculate the ratio of abnormal packets to normal packets, that is, the ratio of retransmitted packets, by counting the data packets at the TCP layer once per second. If the abnormal packets account for 100%, it means that the current scenario is an uplink scenario. If it lasts for 6 consecutive seconds, the mobile phone can assume that there is a problem with the mobile phone itself or the network.
[0124] If the mobile phone determines that the data packet is not continuously retransmitted, or the duration is less than 6 seconds, then the mobile phone does not meet the self-healing condition and does not perform the self-healing action (S804). The duration can be customized and is not limited by this application.
[0125] If the mobile phone determines that the data packet is continuously retransmitted and the duration exceeds 6 seconds, then the mobile phone performs a cell switching operation and determines whether the network connection is restored (S805). For example, the mobile phone can switch the current cell to another cell. The cell switching operation performed by the mobile phone can be set as the first self-healing.
[0126] It should be noted that in the current scenario, the data packet is intercepted at the transport layer and cannot reach the bottom layer, so the bottom layer is idle and the cell switching interface is ineffective. Therefore, the above cell switching operation cannot restore the network connection in the current scenario.
[0127] Then, the mobile phone executes the operation of closing the standalone (SA) network, registers the Long Term Evolution (LTE) network, and restores the network connection (S806). The mobile phone self-heals successfully, and at this time, the mobile phone can access the Internet normally again. Among them, the mobile phone closing SA and registering LTE can be set as the second self-healing.
[0128] In the above scheme, the mobile phone needs to switch cells first. If the network is still abnormal after the cell switching, SA will be closed and Internet access will be achieved by registering LTE. The above statistical data packages, as well as the process of switching cells, closing SA, and registering LTE, are longer and less efficient in restoring network connections than identifying target events, closing and opening data services, and / or reconnecting to the PS domain in this scheme.
[0129] The network connection method provided by this solution can be applied in 5G scenarios. There is no need to wait for the identification of an up-but-not-down scenario, nor to wait for the first self-healing, and then perform a second self-healing after the first self-healing is invalid. Instead, the mobile phone directly closes and reopens the data service after identifying the target event indicating the underlying abnormality, or reconnects to the PS domain when closing and reopening the data service is invalid, thereby improving the efficiency of restoring the network connection.
[0130] like Fig. 9As shown, it is a diagram of the software architecture inside the electronic device. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the internal architecture of the electronic device can be divided into five layers, from top to bottom, namely, the application layer (application layer), the application framework layer, the Android runtime (android runtime, ART) and the native C / C++ library, the hardware abstract layer (hardware abstract layer, HAL) and the kernel layer.
[0131] The application layer can include a series of application packages.
[0132] like Fig. 9 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, etc.
[0133] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0134] like Fig. 9 As shown, the application framework layer may include a window manager, a content provider, a view system, a resource manager, a notification manager, an activity manager, an input manager, and the like.
[0135] The window manager provides window management services (WMS). WMS can be used for window management, window animation management, surface management, and as a transfer station for the input system.
[0136] Content providers are used to store and retrieve data and make it accessible to applications. This data can include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0137] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0138] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0139] The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages and disappear automatically after a short stay without user interaction.
[0140] The activity manager can provide activity management services (AMS), which can be used to start, switch, and schedule system components (such as activities, services, content providers, and broadcast receivers) as well as manage and schedule application processes.
[0141] The input manager can provide input management services (IMS), which can be used to manage system input, such as touch screen input, key input, sensor input, etc. IMS takes events from input device nodes and distributes them to appropriate windows through interaction with WMS.
[0142] The Android runtime includes the core library and the Android runtime. The Android runtime is responsible for converting source code into machine code. The Android runtime mainly uses the ahead of time (AOT) compilation technology and the just in time (JIT) compilation technology.
[0143] The core library is mainly used to provide basic Java class library functions, such as basic data structures, mathematics, IO, tools, databases, networks, etc. The core library provides an API for users to develop Android applications.
[0144] The native C / C++ library can include multiple functional modules, such as surface manager, media framework, libc, OpenGL ES, SQLite, Webkit, etc.
[0145] The hardware abstraction layer runs in user space, encapsulates the kernel layer driver, and provides a calling interface to the upper layer. The hardware abstraction layer includes at least a display module, a camera module, an audio module, and a Bluetooth module.
[0146] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and Bluetooth driver.
[0147] The network connection methods in the aforementioned embodiments can all be implemented in an electronic device having the aforementioned software structure.
[0148] The present application also provides a chip system, such as Fig.10As shown, the chip system 1000 includes at least one processor 1001 and at least one interface circuit 1002. The processor 1001 and the interface circuit 1002 can be interconnected via lines. For example, the interface circuit 1002 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1002 can be used to send signals to other devices (such as the processor 1001). Exemplarily, the interface circuit 1002 can read instructions stored in the memory and send the instructions to the processor 1001. When the instructions are executed by the processor 1001, the electronic device can execute the various steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0149] An embodiment of the present application also provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step executed by the mobile phone in the above-mentioned method embodiment.
[0150] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute each function or step executed by the mobile phone in the above method embodiment.
[0151] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0152] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0153] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0154] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0155] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, 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, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0156] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A network connection method, characterized in that: Applied to electronic equipment, the method comprises: In the case where the electronic device recognizes a first event, the electronic device disconnects the current packet switching domain of the electronic device and reconnects to the packet switching domain after disconnecting the packet switching domain, wherein the first event includes a transport layer in the electronic device intercepting a data packet initiated by an application layer; After the electronic device reconnects to the packet-switched domain, the electronic device identifies a second event, where the second event includes that the transport layer does not intercept the data packet initiated by the application layer.
2. The method according to claim 1, characterized in that The method further comprises: When the electronic device identifies the first event, the electronic device turns off the data service, and then turns on the data service again after turning off the data service; The electronic device disconnects the current packet switching domain of the electronic device, and reconnects to the packet switching domain after disconnecting the packet switching domain, including: After the electronic device restarts the data service and the network connection is not restored, the electronic device disconnects the current packet switching domain of the electronic device and reconnects to the packet switching domain after disconnecting the packet switching domain.
3. The method according to claim 2, characterized in that After the electronic device restarts the data service, the method further includes: The electronic device detects whether the first event is recognized; if the electronic device recognizes the first event, the electronic device does not restore the network connection; if the electronic device does not recognize the first event, the electronic device restores the network connection.
4. The method according to claim 2 or 3, characterized in that: After the electronic device restarts the data service, the method further includes: The electronic device calculates the retransmission ratio of the retransmission data packets of the transport layer in the total data packets of the transport layer; if the retransmission ratio is greater than the preset ratio, the electronic device does not restore the network connection; if the retransmission ratio is not greater than the preset ratio, the electronic device restores the network connection.
5. The method according to any one of claims 1 to 4, characterized in that In the case where the electronic device recognizes the first event, the electronic device disconnects the current packet switching domain of the electronic device, and reconnects the packet switching domain after disconnecting the packet switching domain, including: When the electronic device recognizes the first event and an application using a network is running in the foreground of the electronic device, the electronic device disconnects the current packet switching domain of the electronic device and reconnects the packet switching domain after disconnecting the packet switching domain.
6. The method according to any one of claims 1 to 5, characterized in that The first event includes that the duration of the transport layer in the electronic device intercepting a data packet initiated by the application layer is greater than a preset duration.
7. The method according to any one of claims 1 to 6, characterized in that Before the electronic device disconnects the current packet switching domain of the electronic device and reconnects to the packet switching domain after disconnecting the packet switching domain, the method further includes: The electronic device displays a first interface, wherein the first interface includes prompt information that the data network of the electronic device is unavailable; After the electronic device recognizes the second event, the method further includes: The electronic device displays a second interface, and the second interface does not include prompt information that the data network of the electronic device is unavailable.
8. An electronic device, characterized in that: The electronic device comprises: a communication module, a memory and one or more processors; the communication module, the memory and the processor are coupled; the memory is used to store computer program code, the computer program code comprises computer instructions, and when the computer instructions are executed by the electronic device, the electronic device executes the method as described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed in an electronic device, the electronic device executes the method as claimed in any one of claims 1 to 7.
10. A computer program product, characterized in that The computer program product includes instructions, and when the instructions are executed in an electronic device, the electronic device executes the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Abnormality detection system and method based on protocol analysis
CN107979567A
Network connection control method and device, terminal and computer storage medium
CN110913424A
Communication method and system adapted through GATT and exception handling
CN111416889A
Network fault recovery method, device and equipment and computer readable medium
CN117768300A