Network status test method and electronic device

WO2025185476A8PCT designated stage Publication Date: 2025-10-02HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/078924
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-07
Filing Date
2025-02-25
Publication Date
2025-10-02

Smart Images

  • Figure CN2025078924_02102025_PF_FP_ABST
    Figure CN2025078924_02102025_PF_FP_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a network status test method and an electronic device. The method comprises: when parameters of a first network link satisfy a preset condition, sending a data packet to a server, wherein the parameters of the first network link comprise one or more of a signal strength of the first network link and a downlink data packet interval; on the basis of a data packet return rate within a test duration, determining a first network status of the first network link. The method and electronic device provided in the embodiments of the present application can be used to determine whether a network status test for a network link is required, so that unnecessary network status tests can be reduced, and resources occupied by network status tests can be saved. In addition, the accuracy of network status test results can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Method and electronic device for detecting network status

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 7, 2024, with application number 202410263580.7 and titled “A method and electronic device for detecting network status”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The embodiments of the present application relate to the field of electronic devices, and more specifically, to a method for detecting a network status and an electronic device. Background Art

[0003] As more and more application software is installed in electronic devices, users' requirements for network service latency are also increasing. In areas covered by wireless networks, electronic devices can provide network services to users by accessing wireless networks. When users use application software, if the network status of the network link used by the application software to communicate with the corresponding server is poor, lag will occur, affecting the user experience. When the network status of the network link currently used by the electronic device is poor, the electronic device can switch to a network link with better network status. Therefore, how to improve the accuracy of detecting the network status of the network link has become an urgent problem to be solved. Summary of the Invention

[0004] The embodiments of the present application provide a method and electronic device for detecting network status, which help to improve the accuracy of the detection results of the network status of a network link.

[0005] In a first aspect, a method for network status detection is provided, which is applied to an electronic device. The method includes: when the parameters of a first network link meet preset conditions, sending a data packet to a server, wherein the parameters of the first network link include one or more of the signal strength of the first network link or the downlink data packet interval; and determining the first network status of the first network link based on the packet return rate of the data packet within the detection time.

[0006] Based on the solution provided in the embodiment of the present application, the electronic device sends a data packet to the server when the parameters of the network link meet the preset conditions, and determines the network status of the network link based on the packet return rate of the data packet. In this way, on the one hand, by combining the signal strength of the network link or one or more of the downlink data packet intervals, it is possible to judge whether it is necessary to detect the network status of the network link, which helps to reduce unnecessary network status detection and also helps to reduce the resources occupied by network status detection; on the other hand, determining the network status by the packet return rate of the data packet sent to the server helps to improve the accuracy of the network status detection results.

[0007] In some possible implementations, before sending the data packet to the server, the method further includes: determining that the electronic device is acquiring data in real time.

[0008] Based on the solution provided in the embodiment of the present application, after determining that the electronic device is acquiring data in real time, the electronic device sends a data packet to the server when the parameters of the network link meet the preset conditions, and determines the network status of the network link based on the packet return rate of the data packet. This can ensure that the electronic device acquires data in real time under a better network state, thereby helping to improve the user experience.

[0009] In some possible implementations, determining that the electronic device is acquiring data in real time includes: determining that an application running on the electronic device is a preset application.

[0010] Exemplarily, the preset applications include audio call applications, video call applications, web conferencing applications, or online live broadcast applications.

[0011] Based on the solution provided in the embodiment of the present application, when it is determined that the application running on an electronic device is a preset application, the above-mentioned network status detection mechanism can be used. This can ensure that the electronic device runs audio call applications, video call applications, network conferencing applications or online live broadcast applications in a better network state, avoiding the electronic device from freezing when using these preset applications, and helping to improve the user experience.

[0012] In some possible implementations, the method further includes: obtaining a second network state of the first network link; wherein, when the parameters of the first network link meet preset conditions, sending a data packet to the server, including: when the second network state is the first preset state and the downlink data packet interval is greater than or equal to the preset interval, sending a data packet to the server.

[0013] Exemplarily, the first preset state indicates that the network state of the first network link is better.

[0014] Based on the solution provided in the embodiments of the present application, if the second network status of the first network link is good and the interval between downlink data packets of the first network link is greater than or equal to the preset interval, it means that multiple electronic devices may be connected to the first network link at the same time, and network lag may occur when electronic devices use the first network link for data transmission. In this way, electronic devices can determine the risk of lag in advance and re-determine the network status of the first network link by the packet return rate of data packets sent to the server, which helps to improve the accuracy of network status detection results.

[0015] In some possible implementations, when the second network state is the first preset state and the downlink data packet interval is greater than or equal to the preset interval, sending a data packet to the server includes: when the second network state is the first preset state, obtaining the downlink data packet interval of the first network link; when the downlink data packet interval is greater than or equal to the preset interval, sending a data packet to the server.

[0016] In some possible implementations, the method further includes: obtaining a second network state of the first network link; wherein, when the parameters of the first network link meet preset conditions, sending a data packet to the server, including: when the second network state is the first preset state, the downlink data packet interval is less than the preset interval and the signal strength is less than the preset signal strength, sending a data packet to the server.

[0017] Based on the solution provided in the embodiments of the present application, if the second network status of the first network link is good and the downlink data packet interval of the first network link is less than the preset interval, but the signal strength of the first network link is less than the preset signal strength, it means that the electronic device may be at the edge of the coverage area of ​​the first network link, and network lag may occur when using the first network link for data transmission. In this way, the electronic device can determine the risk of lag in advance and re-determine the network status of the first network link by the packet return rate of the data packets sent to the server, which helps to improve the accuracy of the network status detection results.

[0018] In some possible implementations, when the second network state is the first preset state, the downlink data packet interval is less than the preset interval and the signal strength is less than the preset signal strength, a data packet is sent to the server, including: when the second network state is the first preset state, obtaining the downlink data packet interval of the first network link; when the downlink data packet interval is less than the preset interval, obtaining the signal strength of the first network link; when the signal strength of the first network link is less than the preset signal strength, sending a data packet to the server.

[0019] In some possible implementations, the method further includes: obtaining a second network state of the first network link; wherein, when the parameters of the first network link meet preset conditions, sending a data packet to the server, including: when the second network state is a second preset state and the signal strength is greater than or equal to the preset signal strength, sending a data packet to the server.

[0020] Exemplarily, the second preset status indicates that the network status of the first network link is poor.

[0021] Based on the solution provided in the embodiment of the present application, if the second network status of the first network link is poor, but the signal strength of the first network link is greater than or equal to the preset signal strength, re-detection of the network status of the first network link can be triggered, which helps to improve the accuracy of the network status detection results.

[0022] In some possible implementations, before determining the first network state of the first network link, the method further includes: using the first network link to perform an Internet access operation; wherein the method further includes: when the first network state is a second preset state, switching the network link used by the electronic device from the first network link to a second network link, wherein the network state of the second network link is the first preset state within the detection time period.

[0023] Based on the solution provided in the embodiment of the present application, when the electronic device determines that the network status of the first network link currently used to perform Internet access operations is poor, it can promptly switch to the second network link with better network status, so that data transmission is smoother, which can avoid the occurrence of lag when the user is surfing the Internet and improve the user's Internet experience.

[0024] In some possible implementations, before obtaining the second network state of the first network link, the method further includes: when the electronic device initially accesses the first network link, setting the network state of the first network link to a third network state, where the third network state is the second preset state.

[0025] For example, when the electronic device initially accesses a first network link, the electronic device may set the network state of the first network link to a third network state (the third network state may be poor or initialized). In this way, the electronic device may trigger a re-detection of the network state of the first network link upon determining that the signal strength of the first network link is greater than a preset signal strength.

[0026] In a second aspect, a network status detection device is provided. The device is included in an electronic device and has the function of implementing the electronic device behavior described in the above aspects and possible implementations of the above aspects. The functions can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions.

[0027] In a third aspect, an electronic device is provided, comprising: one or more processors; a memory; a plurality of application programs; and one or more computer programs. The one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device performs the network status detection method of any possible implementation of any of the aforementioned aspects.

[0028] In a fourth aspect, an electronic device is provided, comprising one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are configured to store computer program code. The computer program code comprises computer instructions, and when the one or more processors execute the computer instructions, the electronic device performs the method for detecting a network status in any possible implementation of any of the aforementioned aspects.

[0029] In a fifth aspect, a computer storage medium is provided, comprising computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the method for detecting the network status in any possible implementation of any of the above aspects.

[0030] In a sixth aspect, a computer program product is provided. When the computer program product is run on an electronic device, the electronic device executes the method for network status detection in any possible implementation of any of the above aspects.

[0031] In a seventh aspect, a chip is provided, comprising a processor configured to call and execute a computer program from a memory, so that an electronic device equipped with the chip executes the method for detecting network status in any possible implementation of any of the above aspects. Optionally, the chip further comprises a memory. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.

[0033] FIG2 is a block diagram of the software structure of the electronic device provided in an embodiment of the present application.

[0034] FIG3 is a schematic diagram of a possible method for detecting network status provided in an embodiment of the present application.

[0035] FIG4 is a schematic diagram of another possible method for detecting network status provided in an embodiment of the present application.

[0036] FIG5 is a schematic diagram of another possible method for detecting network status provided in an embodiment of the present application.

[0037] FIG6 is a possible schematic diagram of communication between an electronic device and an application server provided in an embodiment of the present application.

[0038] FIG7 is a schematic diagram of another possible method for detecting network status provided in an embodiment of the present application.

[0039] FIG8 is a set of graphical user interfaces GUI provided by an embodiment of the present application.

[0040] FIG9 is a possible schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] The technical solution in this application will be described below with reference to the accompanying drawings.

[0042] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and appended claims of this application, the singular expressions "a", "a", "said", "above", "aforesaid", "the" and "this" are intended to also include expressions such as "one or more", unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0043] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0044] The technical solutions provided in this application can be applied to various communication systems, such as: fifth generation (5G) or new radio (NR) systems, long term evolution (LTE) systems, LTE frequency division duplex (FDD) systems, LTE time division duplex (TDD) systems, etc. The technical solutions provided in this application can also be applied to future communication systems. The technical solutions provided in this application can also be applied to device to device (D2D) communication, vehicle-to-everything (V2X) communication, machine to machine (M2M) communication, machine type communication (MTC), and Internet of Things (IoT) communication systems or other communication systems.

[0045] The following describes electronic devices with near-field wireless communication technology capabilities and embodiments for using such electronic devices. In some embodiments, the electronic device may be a portable electronic device that also includes other functions such as a personal digital assistant or music player, such as a mobile phone, a tablet computer, a wearable electronic device with wireless communication capabilities (such as a smart watch), etc. Exemplary embodiments of portable electronic devices include but are not limited to those equipped with Or a portable electronic device with other operating systems. The portable electronic device may also be other portable electronic devices, such as a laptop computer (laptop), etc. It should also be understood that, in some other embodiments, the electronic device may not be a portable electronic device, but a desktop computer.

[0046] 1 shows a schematic structural diagram of an electronic device 100. The electronic device 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 194, and a SIM card interface 195.

[0047] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0048] 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 processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent components or integrated into one or more processors. In some embodiments, the electronic device 100 may also include one or more processors 110. In some other embodiments, a memory may also be provided in the processor 110 for storing instructions and data.

[0049] The wireless communication functionality of electronic device 100 can be implemented using antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, a modem processor, and a baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0050] The mobile communication module 150 can provide wireless communication solutions including 2G / 3G / 4G / 5G / future communication networks applied to the electronic device 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.

[0051] 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 electronic device 100. The wireless communication module 160 can 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, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0052] In an embodiment of the present application, parameters of a cellular network link or a Wi-Fi network link can be detected to determine whether to trigger a re-detection of the network status of these network links. When it is determined that a network link needs to be re-detected, the electronic device can send a data packet to the server and re-determine the network status of the network link based on the packet return rate of the data packet.

[0053] The internal memory 121 may be used to store one or more computer programs, each of which includes instructions. In some embodiments, the processor 110 may execute the instructions stored in the internal memory 121 or instructions stored in a memory provided in the processor 110 to enable the electronic device 100 to perform the network status detection method provided in the embodiments of the present application, as well as other applications and data processing.

[0054] The embodiments of the present application do not particularly limit the specific structure of the execution subject of the method for detecting a network status; as long as the code recording the method for detecting a network status according to the embodiments of the present application can be executed to perform processing according to the method for detecting a network status provided by the embodiments of the present application, the execution subject can be, for example, a functional module in an electronic device that can call and execute a program, or a processing device used in an electronic device, such as a chip.

[0055] Figure 2 is a block diagram of a possible software structure of electronic device 100. A layered architecture divides software into several layers, which communicate with each other through software interfaces. In some embodiments, the Android system can be divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer can include a series of application packages.

[0056] As shown in FIG2 , the application layer may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.

[0057] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0058] As shown in FIG2 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

[0059] The window manager is used to manage window programs. The window manager can obtain the display screen size, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make this data accessible to applications. This data can include video, images, audio, dialed and received calls, etc. The view system includes visual controls, such as controls for displaying text and controls for displaying pictures. The view system can be used to build applications, and the display interface can be composed of one or more views. The phone manager is used to provide communication functions for the electronic device 100. For example, call status management (including call connection, hang up, etc.) The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables applications to display notification information in the status bar.

[0060] The Android Runtime consists of a core library and a virtual machine. The Android Runtime is responsible for scheduling and managing the Android system. The core library consists of two parts: one for the Java language's callable functions and the other for the Android core library.

[0061] The application layer and the application framework layer run in a virtual machine, which executes the Java files of the application layer and the application framework layer as binary files.

[0062] The system library can include multiple functional modules. For example, the surface manager, media libraries, 3D graphics libraries (such as OpenGL ES), and 2D graphics engines (such as SGL). The kernel layer is the layer between hardware and software. The kernel layer can include display drivers, camera drivers, audio drivers, and sensor drivers.

[0063] It is understandable that the software architecture of the aforementioned electronic device 100 can be layered in other ways, and the modules or units in each layer can be set in a layer different from that shown in Figure 2, as long as each module or unit can achieve the aforementioned functions, the embodiment of the present application does not limit this. In other embodiments of the present application, the software architecture of the electronic device 100 may include more or fewer modules than shown in the figure, or combine certain modules, or split certain modules, or arrange modules differently. The embodiment of the present application is illustrated using the Android system as an example, but its basic principles are also applicable to terminal devices using other operating systems, and the present application does not limit the operating system used by the electronic device 100.

[0064] To facilitate understanding of the embodiments of the present application, a brief description of the terms or technologies involved in the present application is provided.

[0065] 1. Socket.

[0066] Sockets are the cornerstone of communication and the basic operational unit of network communication supporting the Transmission Control Protocol (TCP) / Internet Protocol (IP). They are an abstract representation of endpoints for bidirectional communication between application processes on different hosts on a network. Sockets connect the application process above and the network protocol stack below, providing a mechanism for application-layer processes to exchange data using network protocols. A socket can contain five pieces of information essential for network communication: the protocol used for the connection, the IP address of the local host, the protocol port of the local process, the IP address of the remote host, and the protocol port of the remote process. Each transport layer connection is uniquely defined by its two endpoints (i.e., two sockets). During communication, one network application writes a message to be transmitted into a socket on its host. The socket then sends this message to the socket on the other host via the transmission medium connected to the network interface card (NIC), allowing the other host to receive the message.

[0067] 2. Application server.

[0068] An application server is a type of middleware built on a server-side architecture, primarily used to support the development, operation, and deployment of distributed applications. In layman's terms, it acts as a "hosting platform" for applications, providing various services such as transaction processing, message queuing, and security authentication, while also enabling communication with a variety of adapters and protocols.

[0069] 3. Round trip time (RTT).

[0070] The electronic device 100 can receive or send data via wireless communication, and data transmission may experience data delay, which can be packet data convergence protocol (PDCP) layer buffer delay, TCP RTT, actual service delay, etc.

[0071] RTT consists of three components: link propagation delay, end-system processing time, and queuing and processing time in the router cache. The first two components are relatively fixed for a TCP connection, while the queuing and processing time in the router cache increases with network congestion. Therefore, the RTT value can, to a certain extent, reflect the degree of network congestion.

[0072] The RTT may be the time interval between when the electronic device 100 sends a data packet to the application server and when the application server sends a data packet confirmation message to the electronic device 100 .

[0073] For example, the actual service delay may be the data delay in the current application of the electronic device 100. For example, when a user opens a browser to search for a web page, the actual service delay may be the delay between the user clicking on the web page and the web page being opened.

[0074] It should be understood that, generally, the actual service delay is greater than the RTT delay, and the actual service delay also includes the time interval between the electronic device 100 detecting the user's operation and the electronic device 100 sending the data packet to the application server.

[0075] For example, the network link parameters involved in the embodiments of the present application may include one or more of the following parameters:

[0076] (1) Received signal strength indicator (RSSI): The total received power on all resource elements (REs) on an orthogonal frequency division multiplexing (OFDM) symbol within the detection bandwidth of the electronic device 100 (for a 20M system bandwidth, when there is no downlink data, it is the sum of the received power on 200 pilot REs; when there is downlink data, it is the sum of the received power on 1200 REs), including the serving cell and non-serving cell, adjacent channel interference, internal thermal noise of the system, etc., that is, the total power S+I+N, where I is the interference power and N is the noise power. RSSI can reflect the received signal strength and interference level of the current channel and is widely used in characterizing the signal strength received by the electronic device 100. The value range of RSSI is negative. Generally speaking, the larger the RSSI, the better the current signal, but the presence of interference signals may also cause the RSSI to be large.

[0077] (2) Downlink data packet interval: obtained by measuring the arrival time of the downlink packet of the network link by the electronic device. The downlink data packet interval can be the time when the M'th downlink data packet arrives at the electronic device 100 minus the average time when the Mth to M'th downlink data packets arrive at the electronic device 100, where M' is a positive integer greater than or equal to 2, M is a positive integer greater than or equal to 1, and M'>M.

[0078] Exemplarily, the electronic device 100 detects 5 consecutive downlink data packets of the network link 1, and the times when the 5 consecutive downlink data packets arrive at the electronic device 100 are t1, t2, t3, t4 and t5 respectively. When M=1 and M'=5, the electronic device 100 calculates the downlink data packet interval of the network link 1 as [t5-(t1+t2+t3+t4+t5) / 5]. The downlink data packet interval can be used to measure the congestion of the network link and reflect the downlink channel quality. For example, when multiple electronic devices 100 have accessed a certain network link or the bandwidth occupied by a certain network link accessed by the electronic device 100 is large, the downlink data packet interval of the network link may be large. The smaller the downlink data packet interval, the better the downlink channel quality of the measured network link. It should be understood that the value of the above-mentioned M or M' can be flexibly set according to the actual network link situation, the performance of the hardware of the electronic device 100, or the service delay requirements of the application running on the electronic device 100, etc., and the embodiments of the present application are not limited to this.

[0079] It should be understood that the parameters of the network link may also include one or more parameters of the network link such as reference signal receiving power (RSRP), reference signal receiving quality (RSRQ), channel quality indication (CQI), signal to interference plus noise ratio (SINR), etc. As long as the parameters can be used to represent the network status of the network link, they can be applied to the solution provided in the embodiment of the present application, and the embodiment of the present application is not limited to this.

[0080] As more and more application software is installed and run in electronic devices, users' requirements for network service latency are also increasing. In areas covered by wireless networks, electronic devices can provide network services to users by accessing the network. When users use application software, if the network status of the network link used by the application software to communicate with the corresponding server is poor, lag will occur, affecting the user experience. When the network status of the network link currently used by the electronic device is poor, the electronic device can switch to a network link with better network status. Therefore, how to improve the accuracy of detecting the network status of the network link has become an urgent problem to be solved.

[0081] In response to the above problems, embodiments of the present application provide a method and electronic device for detecting network status, which help to improve the accuracy of the detection results of the network status of a network link.

[0082] When an electronic device is in an area covered by a wireless network, there may be one or more network links that the electronic device can access in the area. The signal strength, signal quality, or downlink channel quality of the network link may be affected by various factors.

[0083] For example, taking the network link as a Wi-Fi network link, the signal strength of the Wi-Fi network link will be affected by the distance between the electronic device and the wireless router. The farther the distance between the two (for example, the electronic device gradually moves away from the location where the wireless network signal is sent), the weaker the signal strength of the Wi-Fi network link, and the more likely network jams will occur. When the distance between the electronic device and the wireless router exceeds a certain range, the electronic device cannot receive the wireless network signal sent by the wireless router and is disconnected from the wireless network provided by the wireless router.

[0084] For example, the downlink channel quality of a network link will be affected by the remaining network bandwidth of the network link. The more devices connected to the network link or the larger the bandwidth occupied by the network link, the worse the downlink channel quality of the network link. Even if the signal strength of the network link is strong at this time, network lag may still occur.

[0085] Exemplarily, the downlink channel quality of the network link may be determined by the downlink data packet interval.

[0086] FIG3 shows a schematic diagram of a possible method for detecting network status according to an embodiment of the present application. The method 300 can be applied to an electronic device. As shown in FIG3 , the method 300 for detecting network status can include the following steps:

[0087] S301: When parameters of a first network link meet preset conditions, send a data packet to a server, wherein the parameters of the first network link may include one or more of a signal strength of the first network link or a downlink data packet interval.

[0088] Exemplarily, the signal strength of the first network link may be the RSSI of the first network link.

[0089] Optionally, before the above step S301, the network status detection method 300 may further include: acquiring a second network status of the first network link; and sending a data packet to the server when the second network status and parameters of the first network link meet preset conditions.

[0090] Optionally, when the second network state is the first preset state and the downlink data packet interval is greater than or equal to the preset interval, a data packet is sent to the server.

[0091] Exemplarily, the parameters of the first network link may include a downlink data packet interval, and the above-mentioned preset condition may include that when the second network state is the first preset state, the downlink data packet interval of the first network link is greater than or equal to the preset interval. When the second network state and the parameters of the first network link meet the preset condition, a data packet can be sent to the server through the first network link, and the first network state of the first network link can be determined based on the packet return rate of the data packet. The first preset state can be used to indicate that there will be no network lag when using a network link with the first preset state for data transmission, or the first preset state can indicate that the network state of the first network link is better.

[0092] When the second network status indicates that the network status of the first network link is good, but the downlink data packet interval of the first network link is greater than or equal to the preset interval, the electronic device can determine that multiple electronic devices may be connected to the first network link at the same time, and network lag may occur when using the first network link for data transmission. In this way, the electronic device can determine to detect the network status of the first network link.

[0093] Optionally, when the second network state is the first preset state, the signal strength of the first network link is greater than or equal to the preset signal strength, but the downlink data packet interval of the first network link is greater than or equal to the preset interval, a data packet is sent to the server.

[0094] Exemplarily, the parameters of the first network link may include a downlink data packet interval and signal strength, and the preset condition may include that, when the second network state is the first preset state, the downlink data packet interval of the first network link is greater than or equal to the preset interval, and the signal strength is greater than or equal to the preset signal strength. When the second network state and the parameters of the first network link meet the preset conditions, the electronic device may send a data packet to the server via the first network link, and may determine the first network state of the first network link based on the packet return rate of the data packet.

[0095] When the second network status indicates that the network status of the first network link is good, and the measurement result of the signal strength indicates that there will be no network jam when using the first network link for data transmission (for example, the signal strength of the first network link is greater than or equal to the preset signal strength), but the measurement result of the downlink data packet interval indicates that there may be network jam when using the first network link for data transmission (for example, the downlink data packet interval of the first network link is greater than or equal to the preset interval), the electronic device can be triggered to send a data packet to the server to re-detect the network status of the first network link. In this way, the problem of untimely judgment of the risk of jamming when judging whether the network status of the first network link needs to be re-determined only by the measurement result of the signal strength is avoided.

[0096] Based on the solution provided in the embodiments of the present application, if the second network status of the first network link is good and the interval between downlink data packets of the first network link is greater than or equal to the preset interval, it means that multiple electronic devices may be connected to the first network link at the same time, and network lag may occur when electronic devices use the first network link for data transmission. In this way, electronic devices can determine the risk of lag in advance and re-determine the network status of the first network link by the packet return rate of data packets sent to the server, which helps to improve the accuracy of network status detection results.

[0097] Optionally, the parameters of the first network link may include a downlink data packet interval. When the second network state is the first preset state and the downlink data packet interval is less than the preset interval, the network state of the first network link may remain unchanged.

[0098] Optionally, when the second network state is the first preset state, the downlink data packet interval is less than the preset interval and the signal strength is less than the preset signal strength, a data packet is sent to the server.

[0099] Exemplarily, the parameters of the first network link include a downlink data packet interval and a signal strength. The preset condition may include that, when the second network state is the first preset state, the downlink data packet interval of the first network link is less than a preset interval and the signal strength is less than a preset signal strength. When the second network state and the parameters of the first network link meet the preset conditions, data packets may be sent to the server via the first network link, and the first network state of the first network link is determined based on the packet return rate of the data packets.

[0100] When the second network status indicates that the network status of the first network link is better, and the measurement result of the downlink data packet interval indicates that there will be no network jam when using the first network link for data transmission (for example, the downlink data packet interval of the first network link is less than the preset interval), but the measurement result of the signal strength indicates that network jam may occur when using the first network link for data transmission (for example, the signal strength of the first network link is less than the preset signal strength), the electronic device can be triggered to send a data packet to the server to re-detect the network status of the first network link.

[0101] Based on the solution provided in the embodiments of the present application, if the second network status of the first network link is good and the downlink data packet interval of the first network link is less than the preset interval, but the signal strength of the first network link is less than the preset signal strength, it means that the electronic device may be at the edge of the coverage area of ​​the first network link, and network lag may occur when using the first network link for data transmission. In this way, the electronic device can determine the risk of lag in advance and re-determine the network status of the first network link by the packet return rate of the data packets sent to the server, which helps to improve the accuracy of the network status detection results.

[0102] Optionally, when the second network state is a second preset state and the signal strength is greater than or equal to a preset signal strength, a data packet is sent to the server.

[0103] Exemplarily, the parameters of the first network link include signal strength, and the above-mentioned preset condition may be that when the second network state is the second preset state, the signal strength of the first network link is greater than or equal to the preset signal strength. When the second network state and the parameters of the first network link meet the preset condition, a data packet can be sent to the server through the first network link, and the first network state of the first network link can be determined based on the packet return rate of the data packet. The second preset state can be used to indicate that network lag may occur when using a network link with the second preset state for data transmission, or it can indicate that the network state of the first network link is poor.

[0104] When the second network status indicates that the network status of the first network link is poor, but the measurement result of the signal strength of the first network link (for example, the signal strength of the first network link is greater than or equal to the preset signal strength) indicates that no network lag will occur when using the first network link for data transmission, the electronic device can be triggered to send a data packet to the server to re-detect the network status of the first network link.

[0105] Based on the solution provided in the embodiment of the present application, if the second network status of the first network link is poor, but the signal strength of the first network link is greater than or equal to the preset signal strength, re-detection of the network status of the first network link can be triggered, which helps to improve the accuracy of the network status detection results.

[0106] It is understandable that in the above network status detection method, the second network status and the parameters of the first network link can be obtained simultaneously, or the second network status can be obtained first and then the required parameters of the first network link can be obtained based on the second network status.

[0107] Optionally, in the method 300 for detecting the network status, before determining the first network status of the first network link, the method 300 further includes: using the first network link to perform an Internet access operation; wherein, the method 300 further includes: when the first network status is a second preset status, switching the network link used by the electronic device from the first network link to a second network link, wherein the network status of the second network link is the first preset status within the detection time period.

[0108] Specifically, when the first network state of the first network link currently used by the electronic device to perform an Internet access operation is the second preset state, the electronic device can switch the network link currently used to perform the Internet access operation to the second network link with the first preset state.

[0109] Based on the solution provided in the embodiment of the present application, when the electronic device determines that the network status of the first network link currently used for performing Internet operations is poor, it can promptly switch to the second network link with better network status, making data transmission smoother, avoiding lag when the user is surfing the Internet, and improving the user's Internet experience.

[0110] Optionally, before the above step S301, the network status detection method 300 may further include: determining that the electronic device is acquiring data in real time.

[0111] Specifically, services that require real-time data acquisition have high requirements for the accuracy of network status detection results. Before obtaining the second network status of the first network link, the electronic device can determine whether data is being acquired in real time. For example, an application that may require real-time data acquisition can be set as a preset application. When the electronic device determines that the running application belongs to the preset application, it can be determined that the electronic device is acquiring data in real time. The electronic device can execute the above-mentioned network status detection method 300 to determine the network status of some or all network links that the electronic device has searched for and can access.

[0112] Exemplarily, the electronic device can preset applications that may obtain data in real time by setting a whitelist. When the application running in the electronic device is an application in the whitelist (the electronic device can determine whether a running application belongs to an application in the preset whitelist. For example, the whitelist of the electronic device is preset with application A, application B, application C and application D, and the electronic device determines that the currently running application A belongs to an application in the whitelist), the electronic device can execute the above-mentioned network status detection method 300 to determine the network status of some or all network links that the electronic device has searched for and can access.

[0113] Exemplarily, the preset applications include audio call applications, video call applications, web conferencing applications, or online live broadcast applications.

[0114] Based on the solution provided in the embodiment of the present application, when it is determined that the application running on an electronic device is a preset application, the above-mentioned network status detection mechanism can be used. This can ensure that the electronic device runs audio call applications, video call applications, network conferencing applications or online live broadcast applications in a better network state, avoiding the electronic device from freezing when using these preset applications, and helping to improve the user experience.

[0115] For example, the electronic device can determine the application that may obtain data in real time by determining whether the data obtained by the running application can be cached in advance. When the application running in the electronic device is performing a business that cannot cache data in advance, it can be considered that the electronic device is obtaining data in real time (for example, an application running in the electronic device is conducting an audio or video call, an online conference, an online live broadcast, or playing an online live broadcast, in which case it can be considered that the application is obtaining data in real time). The electronic device can execute the above-mentioned network status detection method 300 to determine the network status of some or all network links that the electronic device has searched for and can access.

[0116] S302: Determine a first network state of a first network link according to a packet return rate of data packets within a detection period.

[0117] Specifically, the electronic device searches for one or more network links that can be accessed. When parameters of a first network link among the network links that the electronic device searches for and can access meet preset conditions, the electronic device can determine a first network state of the first network link based on a packet return rate of data packets sent to the server within a detection period.

[0118] It can be understood that the data packet sent by the electronic device to the server can be an application data packet that the electronic device's application needs to send to the server during operation, for example, the audio and video data packet of the electronic device's application during an audio and video call (the application data packet contains application data such as the application's video frames and voice frames); or, the data packet sent by the electronic device to the server can also be a detection packet created for detecting the packet return rate, which is different from the aforementioned application data packet.

[0119] Based on the solution provided in the embodiment of the present application, the electronic device sends a data packet to the server when the parameters of the network link meet the preset conditions, and determines the network status of the network link based on the packet return rate of the data packet. In this way, on the one hand, by combining the signal strength of the network link or one or more of the downlink data packet intervals, it is possible to judge whether it is necessary to detect the network status of the network link, which helps to reduce unnecessary network status detection and also helps to reduce the resources occupied by network status detection; on the other hand, determining the network status by the packet return rate of the data packet sent to the server helps to improve the accuracy of the network status detection results.

[0120] FIG4 shows a schematic diagram of another possible method for detecting network status provided by an embodiment of the present application. This method 400 is a possible implementation of S301 in the above-mentioned method 300 for detecting network status. It is understandable that the method 400 for detecting network status shown in FIG4 can be executed by an electronic device or by a processor in an electronic device. For ease of understanding, the execution subject of the method described below takes an electronic device as an example, and the method 400 for detecting network status is described in detail in conjunction with FIG4. The method 400 for detecting network status may include the following steps:

[0121] S401: Acquire a second network status of a first network link.

[0122] S402: Determine whether the second network status is good.

[0123] Exemplarily, when it is determined that the second network state is better, S403 may be executed; or, when it is determined that the second network state is worse, S407 may be executed.

[0124] S403: When it is determined that the second network state is better, obtain the downlink data packet interval of the first network link.

[0125] S404: Determine whether the interval between downlink data packets of the first network link is less than a preset interval.

[0126] Exemplarily, when the downlink data packet interval of the first network link is less than a preset interval, S405 may be executed; otherwise, S409 may be executed.

[0127] S405: When the downlink data packet interval of the first network link is less than the preset interval, obtain the signal strength of the first network link.

[0128] S406: Determine whether the signal strength of the first network link is less than a preset signal strength.

[0129] Exemplarily, when the signal strength of the first network link is less than a preset signal strength, S409 may be executed; otherwise, the network state of the first network link may be kept unchanged.

[0130] Specifically, the electronic device can obtain the second network status of the first network link. When the second network status indicates that the network status of the first network link is better, the electronic device can obtain the downlink data packet interval of the first network link. When the downlink data packet interval is greater than or equal to the preset interval, the electronic device can send a data packet to the service and can re-detect the network status of the first network link based on the packet return rate of the data packet. When the downlink data packet interval is less than the preset interval, the electronic device can obtain the signal strength of the first network link. When the signal strength is less than the preset signal strength, the electronic device can send a data packet to the service and can re-detect the network status of the first network link based on the packet return rate of the data packet. When the signal strength is greater than or equal to the preset signal strength, the electronic device may not trigger re-detection of the network status of the first network link, or the electronic device may not send a data packet to the server.

[0131] Illustratively, in step S404, when the downlink data packet interval of the first network link is less than the preset interval, the network state of the first network link may be kept unchanged and S405 is no longer executed, that is, step S405 and step S406 may be optional steps.

[0132] S407: When it is determined that the second network state is poor, obtain the signal strength of the first network link.

[0133] S408: Determine whether the signal strength of the first network link is less than a preset signal strength.

[0134] Exemplarily, when the signal strength of the first network link is less than a preset signal strength, the network state of the first network link may be kept unchanged; otherwise, S409 may be executed.

[0135] S409: Send a data packet to the server.

[0136] It is understandable that the electronic device can first determine the second network status of the first network link, and then obtain the signal strength of the network link or one or more of the downlink data packet interval; or, the electronic device can also obtain the second network status and the parameters of the first network link at the same time, and can determine whether to trigger re-detection of the network status of the first network link based on the above preset conditions. The embodiments of the present application are not limited to this.

[0137] Optionally, before obtaining the second network state of the first network link, the network state detection method may further include: obtaining a third network state of one or more network links, the third network state being a second preset state or initialization, and the one or more network links including the first network link.

[0138] For example, after initially searching for one or more accessible network links, the electronic device may set the network status of the one or more accessible network links to "initialization" or "bad." For example, when the electronic device initially searches for wireless network link 1, cellular network link 2, and cellular network link 3, the network status list shown in Table 1 may be stored.

[0139] Table 1 Network links and their network status

[0140] When an electronic device determines that the network status of a network link is "initializing" or "poor," it can determine whether to recheck the network status of the network link based on the relationship between the RSSI of the network link and a preset signal strength. For example, after obtaining the third network status of wireless network link 1, cellular network link 2, and cellular network link 3, the electronic device can check the RSSI of wireless network link 1, cellular network link 2, and cellular network link 3. If the electronic device detects that the RSSI of wireless network link 1 is less than the preset signal strength, the RSSI of cellular network link 2 is greater than or equal to the preset signal strength, and the RSSI of cellular network link 3 is greater than or equal to the preset signal strength, the electronic device can determine that the network status of wireless network link 1 is still "initializing" or "poor," and can send data packets to the server via cellular network link 2 and cellular network link 3, respectively, and calculate the packet return rate of the data packets within the detection period. If the electronic device determines that the packet return rate of the data packets sent via cellular network link 2 and cellular network link 3 is greater than a threshold, the electronic device can refresh the network status of cellular network link 2 and cellular network link 3 to "good," respectively. The network statuses of wireless network link 1, cellular network link 2, and cellular network link 3 after being refreshed by the above method may be as shown in Table 2.

[0141] Table 2 Network links and their network status

[0142] FIG5 shows a schematic diagram of another possible method for detecting network status provided by an embodiment of the present application. This method 500 is a possible implementation of step S302 of the above-mentioned method 300 for detecting network status. It is understandable that the method 500 for detecting network status shown in FIG5 can be executed by an electronic device or by a processor in the electronic device. For ease of understanding, the execution subject of the method described below takes an electronic device as an example, and the method 500 for detecting network status is described in detail in conjunction with FIG5. The method 500 for detecting network status may include the following steps:

[0143] S501: Determine the packet return rate of data packets sent to the server within a detection period.

[0144] S502: Determine whether the packet return rate of data packets within the detection time period is less than a threshold.

[0145] Exemplarily, a data packet is sent to the server via the first network link. When it is determined that the packet return rate of the data packet within the detection time is less than a threshold, S504 can be executed; or, when it is determined that the packet return rate of the data packet within the detection time is greater than or equal to the threshold, S503 can be executed.

[0146] S503: When the packet return rate is greater than or equal to a threshold, determine that the first network state of the first network link is better.

[0147] S504: When the packet return rate is less than a threshold, determine that the first network state of the first network link is poor.

[0148] Specifically, the electronic device may send a data packet to the server on the first network link and may determine whether the packet return rate of the data packet within the detection time is less than a threshold value. When it is determined that the packet return rate of the data packet within the detection time is greater than or equal to the threshold value, the electronic device may determine that the first network state of the first network link used to send the data packet is good; or when it is determined that the packet return rate of the data packet within the detection time is less than the threshold value, the electronic device may determine that the first network state of the first network link used to send the data packet is poor.

[0149] Optionally, after the electronic device determines that the first network status of the first network link is better, the network status of the first network link stored on the electronic device can be refreshed to "better"; or, after the electronic device determines that the first network status of the first network link is worse, the network status of the first network link stored on the electronic device can be refreshed to "worse".

[0150] Figure 6 is a possible schematic diagram of the communication between an electronic device and an application server provided in an embodiment of the present application. The user can transmit data to the application server through the application running / installed on the electronic device. In order to reduce the impact of network lag on data transmission and improve user experience, network status detection of the network link can be performed. The network status detection method of the network link can be completed by several modules or all modules in the link management module, detection strategy management module, signal strength perception module, downlink packet interval calculation module, and detection strategy execution module shown in Figure 6. The above modules can be set in the electronic device. Among them, the link management module can be used to store the network status of the network link that the electronic device can access by searching; the detection strategy management module can be used to determine whether it is necessary to send a data packet and trigger the operation of other modules (for example, the detection strategy management module can be used to trigger the operation of the signal strength perception module, the downlink packet interval calculation module, and the link management module); the signal strength perception module or the downlink packet interval calculation module can be used to detect the parameters of the network link that the electronic device can access (for example, the signal strength perception module can be used to obtain the RSSI of the network link, and the downlink packet interval calculation module can be used to obtain the downlink data packet interval of the network link); the detection strategy execution module can be used to send a data packet on a specified network link to determine the packet return rate of the data packet and determine the network status of the network link based on the packet return rate. Among them, the link management module can also be called a path management submodule. It can be understood that the names and relationships of the aforementioned modules are only examples. Any module or device that can implement the solution provided in the embodiment of the present application and achieve the same effect can be included in the present application, and the embodiment of the present application is not limited to this.

[0151] Exemplarily, one or more of the link management module, detection strategy management module, signal strength perception module, and downlink packet interval calculation module shown in FIG6 can be set in the application framework layer / system library in the layered architecture of the software shown in FIG2 , and the detection strategy execution module shown in FIG6 can be set in the kernel layer in the layered architecture of the software shown in FIG2 . It is understandable that the various modules shown in FIG6 can also be set in the layers of the layered architecture of the software shown in FIG2 in other ways, and any layered architecture of modules that can implement the solution provided in the embodiment of the present application and achieve the same function can be included in the present application, and the embodiment of the present application does not limit this.

[0152] It is understandable that the action of causing a module to run / work can have different names, but their function is to cause the module to run / work. For example, running a module can be called calling a module, or it can be called triggering the operation of a module. Any action on a module that can implement the solution provided in the embodiments of the present application and achieve the same function can be included in the present application, and the embodiments of the present application are not limited to this.

[0153] It can be understood that steps S401 to S408 in the network status detection method 400 described above can also be executed by the detection policy management module shown in Figure 6, and step S409 in the network status detection method 400 described above and steps S501 to S504 in the network status detection method 500 described above can also be executed by the detection policy execution module shown in Figure 6.

[0154] FIG7 shows a schematic diagram of another possible network status detection method 700 provided in an embodiment of the present application. The network status detection method 700 may include the following steps:

[0155] S7002, the detection strategy management module calls the signal strength perception module, and the signal strength perception module obtains the signal strength of the specified network link through the mobile phone network component.

[0156] S7003: The mobile phone network component sends the signal strength of the network link to the detection strategy management module.

[0157] Specifically, the detection policy management module can obtain the signal strength of the network link by calling the signal strength perception module. The signal strength perception module can obtain the signal strength of the specified network link through the mobile phone network component, and the mobile phone network component can return the detected signal strength of the network link to the detection policy management module. In some possible embodiments, the signal strength perception module can be included in the detection policy management module.

[0158] It can be understood that the above steps S7002 to S7003 are a possible implementation of step S405 or step S407 in the above method 400 for detecting the network status.

[0159] The network status detection method 700 may further include the following steps:

[0160] S7004, the detection strategy management module calls the downlink packet interval calculation module, and the downlink packet interval calculation module records the downlink data packet interval of the specified network link through the mobile phone network component.

[0161] S7005: The mobile phone network component sends the downlink data packet interval of the network link to the detection policy management module.

[0162] Specifically, the detection policy management module can obtain the downlink packet interval of the network link by calling the downlink packet interval calculation module. The downlink packet interval calculation module can obtain the downlink packet interval of the specified network link through the mobile phone network component, and the mobile phone network component can return the downlink packet interval of the detected network link to the detection policy management module. In some possible embodiments, the downlink packet interval calculation module can be included in the detection policy management module.

[0163] It can be understood that the above steps S7004 to S7005 are a possible implementation of step S403 in the above method 400 for detecting the network status.

[0164] Exemplarily, before steps S7002 to S7003 or steps S7004 to S7005, the network status detection method 700 may further include the following steps:

[0165] S7001, the detection policy management module starts regularly to detect the parameters of the network link.

[0166] Specifically, the detection strategy management module can obtain the initial network status of the network link through the link management module, and can determine whether to execute the above steps S7002~S7003, steps S7004~S7005 or steps S7002~S7005 based on the initial network status to detect the parameters of the network link.

[0167] Illustratively, when the initial network status of the network link is poor, the detection strategy management module may execute steps S7002 to S7003 to detect the signal strength of the network link.

[0168] For example, when the initial network status of the network link is good, the detection policy management module may execute steps S7004-S7005 to detect the downlink packet interval of the network link. When the downlink packet interval of the network link is less than the preset interval, the detection policy management module may execute steps S7002-S7003 to determine whether to trigger a re-detection of the network status of the network link based on the signal strength of the network link.

[0169] Exemplarily, the detection policy management module can run periodically to regularly detect the parameters of the network link. The period can be flexibly set according to the different hardware performance of the electronic device, the requirements of different data services for latency, or the conditions of the network link. The period can also be stored in the electronic device as a fixed value. For example, the period for running the detection policy management module in the electronic device can be fixedly set to 200ms, or the user can choose to set the period to 200ms or 300ms. This embodiment of the present application is not limited to this.

[0170] The network status detection method 700 may further include the following steps:

[0171] S7006: The detection strategy management module determines whether to trigger the detection strategy execution module.

[0172] Specifically, the detection strategy management module may determine whether to trigger the detection strategy execution module based on the signal strength of the network link, the downlink data packet interval, or the signal strength and the downlink data packet interval.

[0173] It can be understood that the above step S7006 is a possible implementation method for determining whether to execute step S409 in the above method 400.

[0174] The network status detection method 700 may further include the following steps:

[0175] S7007, the detection policy management module triggers the detection policy execution module.

[0176] S7008: The detection policy execution module sends a packet detection start request back to the application server.

[0177] S7009: Application server responds to packet detection.

[0178] Specifically, after the detection policy management module triggers the detection policy execution module, the detection policy execution module can send a data packet to the application server and perform packet return detection through the network link that needs to re-detect the network status. The application server can respond to the data packet, and the detection policy execution module can calculate the packet return rate of the data packet based on the response of the application server.

[0179] Exemplarily, the data packet can be transmitted from the application started / running in the electronic device to the application server corresponding to the application via a socket. For example, when the detection strategy execution module creates a data packet, it can write information about the network link used to send the data packet into the socket used to transmit the data packet. The network link used to send the data packet can be the network link for the detection strategy execution module to re-detect the network status. When the network status of the network link is poor, the application may not transmit data through the network link, but may detect the packet return rate of the data packet on the network link through the data packet.

[0180] For example, the detection policy management module may send an indication to the detection policy execution module. This indication may be used to indicate the network path of the network link for which the network status needs to be detected. After receiving the indication, the detection policy execution module may send a data packet to the server on the network link indicated by the indication and determine the packet return rate of the data packet. The detection policy execution module may determine the packet return rate and compare it with a threshold. The value of the threshold may be selected within a certain range.

[0181] The detection time period for calculating the packet return rate by the detection strategy execution module may start from the sending of the first data packet to the end of the detection duration.

[0182] For example, if the detection duration is set to 100ms, the detection policy execution module can calculate the packet response rate for data packets within 100ms after sending the first data packet. Packets received after this 100ms period are not included in the packet response rate calculation. For example, during a particular detection policy execution module operation, the detection policy execution module sends five data packets continuously. Within 100ms after sending the first data packet, the detection policy execution module detects packet response information for four data packets, resulting in a packet response rate of 80%.

[0183] Exemplarily, the detection duration used by the detection policy execution module to calculate the packet return rate can be an RTT value. For example, the RTT threshold for the allowed packet return is set to 150ms. During a certain detection policy execution module operation, the detection policy execution module continuously sends 8 data packets, and these 8 data packets are sent simultaneously. Within 150ms of sending the 8 data packets, the detection policy execution module receives information indicating that the application server confirms that the number of received data packets is 8, and the packet return rate is 100%.

[0184] The network status detection method 700 may further include the following steps:

[0185] S7010: The detection policy execution module sends a detection result of the network status obtained based on the packet return rate to the detection policy management module.

[0186] S7011: The link management module updates the network status of the network link.

[0187] Specifically, the detection strategy execution module can determine the detection result of the network status of the network link based on the packet return rate, and can send the detection result to the detection strategy management module. The link management module can refresh the network status of the network link based on the information indicating the network status sent by the detection strategy management module.

[0188] Exemplarily, the threshold value of the packet return rate can be between 80% and 100%. For example, if the threshold value is 90%, when the packet return rate is greater than or equal to 90%, the detection policy management module can send a second indication message, which can include information indicating that the link management module refreshes the network status of the network link 1 to "better", and the link management module can refresh the network status of the network link 1 to "better" according to the second indication message; when the packet return rate is less than 90%, the detection policy management module can send a third indication message, which can include information indicating that the link management module refreshes the network status of the network link 1 to "poor", and the link management module can refresh the network status of the network link 1 to "poor" according to the third indication message.

[0189] It can be understood that the above steps S7007 to S7011 are a possible implementation of the above network status detection method 500.

[0190] The network status detection method 700 may further include the following steps:

[0191] S7012, the mobile phone network component sends a request to select a network link to the link management module.

[0192] S7013: The link management module sends information about network links with better network status to the mobile phone network component.

[0193] Specifically, the mobile network component can send a network link selection request to the link management module, and the link management module can return a network link with better network status to the mobile network component. The mobile network component can switch the used network link to a network link with better network status for data transmission.

[0194] It is understandable that when an electronic device can use multiple network links at the same time (for example, in a dual-SIM dual-pass scenario, the electronic device can simultaneously maintain access to the cellular network link of data service card 1 and the cellular network link of data service card 2, and data service card 1 and data service card 2 can send and receive network signals at the same time), the electronic device can simultaneously detect the network status of the multiple network links.

[0195] It is understandable that the user can perform network link switching operations according to the network status of the network link, and the electronic device can also automatically switch the network link used according to the network status of the network link. For example, the user can view the network status through the display screen of the electronic device, and the user can also switch the network link used by the electronic device to perform Internet access operations from a network link with a "poor" network status to a network link with a "better" network status; or, if the electronic device determines that the network status of the network link currently used to perform Internet access operations is "poor", the electronic device can automatically switch the network link currently used to perform Internet access operations to a network link with a "better" network status. Switching network links based on the above-mentioned network status detection method can provide smoother network services and enhance user experience.

[0196] For example, Table 3 shows a possible correspondence between network links and parameter value ranges.

[0197] Table 3 Correspondence between network links and parameter value ranges

[0198] dB is a relative value. For example, when considering how many dB greater or smaller the power of A is than the power of B, the calculation formula can be 10lg (power of A / power of B). For example, the power of A is twice as large as the power of B, then 10lg (power of A / power of B) is equal to 10lg2, which is approximately 3dB. dBm represents the power dB value relative to the reference power of 1 milliwatt (mW). For example, the meter transmission loss of a 7 / 8-inch GSM900 feeder is about 3.9dBm. For example, the power of A is 46dBm and the power of A is 40dBm, then A is 6dBm greater than B. For example, the power of antenna A is 12dBm and the power of antenna B is 14dBm, then A is 2dBm less than B.

[0199] Exemplarily, the preset interval of the network link of the electronic device (the preset interval may be a preset downlink data packet interval) may range from 150ms to 300ms. The preset interval of the network link of the electronic device may be set to any value between 150ms and 300ms. For example, the preset downlink data packet interval of the network link of the electronic device may be set to 200ms. When the downlink data packet interval of a Wi-Fi network link / cellular network link with an initial network status of "good" is less than 200ms and the RSSI is greater than or equal to a preset signal strength, the network status of the Wi-Fi network link / cellular network link may remain "good"; when the RSSI of the Wi-Fi network link / cellular network link with an initial network status of "good" is less than the preset signal strength, or the downlink data packet interval is greater than or equal to 200ms, the detection strategy execution module may be run to redetect the network status of the Wi-Fi network link / cellular network link.

[0200] For example, the preset signal strength of the Wi-Fi network link of the electronic device (the preset signal strength may be a preset RSSI) may range from -75dBm to -65dBm. The preset signal strength of the Wi-Fi network link of the electronic device may be set to any value between -75dBm and -65dBm. For example, the preset RSSI of the network link of the electronic device may be set to -70dBm. When the RSSI of a Wi-Fi network link whose initial network status is "poor" is greater than or equal to -70dBm, the detection policy execution module may be executed to re-detect the network status of the Wi-Fi network link. When the RSSI of a Wi-Fi network link whose initial network status is "poor" is less than -70dBm, the network status of the Wi-Fi network link may remain "poor."

[0201] For example, the preset signal strength of the cellular network link of the electronic device may range from -95dBm to -85dBm, and the preset RSSI of the cellular network link of the electronic device may be set to -90dBm. When the RSSI of a cellular network link whose initial network status is "poor" is greater than or equal to -90dBm, the detection strategy execution module may be executed to re-detect the network status of the cellular network link; when the RSSI of a cellular network link whose initial network status is "poor" is less than -90dBm, the network status of the cellular network link may remain "poor."

[0202] The network status detection method 700 may further include the following steps:

[0203] S7000 detects that a user has started an application service.

[0204] S7014, sends data through the mobile phone network component.

[0205] S7015, the mobile network component sends data to the application server through the specified network link.

[0206] S7016: The server sends a response to the data to the mobile network component.

[0207] S7017: The mobile network component returns the server's response to the application.

[0208] Specifically, after an application on an electronic device is started / running, the mobile phone network component can send application data to the application server over a designated network link, or receive responses from the application server. For example, after a browser on an electronic device is started / running, the mobile phone network component can transmit data to the application server over a designated network link, allowing the user to browse web pages provided by the application server through the browser on the electronic device.

[0209] It can be understood that the above steps S7000 and S7014 to S7017 are operations performed by the electronic device when the user is surfing the Internet.

[0210] Figure 8 shows a set of graphical user interfaces (GUIs) provided in an embodiment of the present application. Referring to (a) and (b) in Figure 8, the GUI is a video call interface of an application on a mobile phone. The user can make a video call by clicking the "Answer" icon on the screen. As shown in (a) in Figure 8, the signal indication component 801 on the GUI shows that the current cellular network link 1 is not transmitting data, and the signal indication component 802 shows that the current Wi-Fi network link 3 is performing uplink and downlink data transmission. The network links that can be accessed by the mobile phone shown in (a) in Figure 8 include cellular network link 1, cellular network link 2 and Wi-Fi network link 3, among which the network status of cellular network link 1 is "poor" and the network status of Wi-Fi network link 3 is "good". The mobile phone can transmit data with the application server through the Wi-Fi network link 3 whose current network status is "good". During the user's video call, the mobile phone can detect the network status of cellular network link 1 and Wi-Fi network link 3 using the above-mentioned network status detection method. The mobile phone can determine whether to recheck the network status of cellular network link 1 by detecting the signal strength of cellular network link 1. Furthermore, the mobile phone can determine whether to recheck the network status of Wi-Fi network link 3 by detecting the signal strength or downlink packet interval of Wi-Fi network link 3. When the mobile phone detects that the downlink packet interval of Wi-Fi network link 3 is greater than or equal to a preset interval, the mobile phone can send a data packet to the application server via Wi-Fi network link 3 and recheck the network status of Wi-Fi network link 3 based on the packet return rate of the data packet. When the mobile phone detects that the signal strength of cellular network link 1 is greater than or equal to a preset signal strength, the mobile phone can send a data packet to the application server via cellular network link 1 and recheck the network status of cellular network link 1 based on the packet return rate of the data packet. If rechecking the network status of cellular network link 1 and Wi-Fi network link 3 is triggered, and the mobile phone detects that the packet return rate of cellular network link 1 is greater than a threshold and the packet return rate of Wi-Fi network link 3 is less than a threshold, the mobile phone can determine, based on the packet return rates, that the network status of cellular network link 1 is "good" and that of Wi-Fi network link 3 is "poor." As a result, the phone can switch the currently used network link from Wi-Fi network link 3 to cellular network link 1, and the phone can continue the video call using cellular network link 1, which has a "better" network status. As shown in Figure 8(b), after the network link is switched, the signal indicator component 803 on the GUI shows that the current cellular network link 1 is performing uplink and downlink data transmission, and the signal indicator component 804 shows that the current Wi-Fi network link 3 is not transmitting data. The phone can then use cellular network link 1 to conduct video calls and data transmission with the application server.

[0211] When the mobile phone sends a data packet to the application server through a designated network link and determines the packet return rate, the signal indication component corresponding to the designated network link can display that the link is performing uplink and downlink data transmission. For example, when the mobile phone performs data transmission with the application server through Wi-Fi network link 3, the mobile phone can also send a data packet to the application server through cellular network link 1 to detect the network status of cellular network link 1. At this time, the signal indication components of Wi-Fi network link 3 and cellular network link 1 can simultaneously display that the links are performing uplink and downlink data transmission.

[0212] Those skilled in the art will appreciate that, in order to implement the above functions, the electronic device includes hardware or software modules that perform the corresponding functions. The units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0213] In the embodiment of the present application, the electronic device can be divided into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. In actual implementation, other division methods can be used.

[0214] Figure 9 is a schematic block diagram of an electronic device provided in an embodiment of the present application. As shown in Figure 9, the electronic device 1000 may include one or more processors 1010; one or more memories 1020; the one or more memories 1020 store one or more programs. When the one or more programs are executed by the one or more processors 1010, the network status detection method described in any possible implementation manner described above is executed.

[0215] For example, the electronic device 1000 may be used to execute the aforementioned method 300, method 400, method 500, method 700, etc. The electronic device 1000 may also be the aforementioned electronic device 100.

[0216] An embodiment of the present application also provides a chip, which includes a processor and a communication interface, wherein the communication interface is used to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the method for network status detection described in any possible implementation method described above is executed.

[0217] This embodiment further provides a computer storage medium, which stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the network status detection method in the above-mentioned embodiment.

[0218] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the network status detection method in the above-mentioned embodiment.

[0219] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the network status detection method in the above-mentioned method embodiments.

[0220] Among them, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding 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.

[0221] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0222] Through the description of the above implementation methods, technical personnel in the relevant field can 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 distributed and completed by 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.

[0223] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, 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.

[0224] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0225] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0226] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0227] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for detecting a network status, characterized in that: Applied to electronic equipment, the method includes: When the parameters of the first network link meet the preset conditions, sending a data packet to the server, wherein the parameters of the first network link include one or more of the signal strength of the first network link or the downlink data packet interval; A first network state of the first network link is determined according to a packet return rate of the data packets within a detection period.

2. The method according to claim 1, characterized in that Before sending the data packet to the server, the method further includes: Acquire a second network status of the first network link; The step of sending a data packet to the server when the parameters of the first network link meet a preset condition includes: When the second network state is the first preset state and the downlink data packet interval is greater than or equal to the preset interval, the data packet is sent to the server.

3. The method according to claim 1, characterized in that Before sending the data packet to the server, the method further includes: Acquire a second network status of the first network link; The step of sending a data packet to the server when the parameters of the first network link meet a preset condition includes: When the second network state is the first preset state, the downlink data packet interval is less than the preset interval and the signal strength is less than the preset signal strength, the data packet is sent to the server.

4. The method according to claim 1, wherein Before sending the data packet to the server, the method further includes: Acquire a second network status of the first network link; The step of sending a data packet to the server when the parameters of the first network link meet a preset condition includes: When the second network state is a second preset state and the signal strength is greater than or equal to a preset signal strength, the data packet is sent to the server.

5. The method according to any one of claims 1 to 4, characterized in that Before determining the first network status of the first network link, the method further includes: Using the first network link to perform Internet access operations; The method further comprises: When the first network state is a second preset state, the network link used by the electronic device is switched from the first network link to a second network link, wherein the network state of the second network link is the first preset state within the detection time period.

6. An electronic device, characterized in that: One or more processors; one or more memories; the one or more memories storing one or more programs, when the one or more programs are executed by one or more processors, the method according to any one of claims 1 to 5 is executed.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is run, the electronic device executes the method according to any one of claims 1 to 5.

8. A computer program product, characterized in that The computer program product comprises: a computer program, and when the computer program is executed, an electronic device executes the method according to any one of claims 1 to 5.

9. A chip, characterized in that: include: The chip includes a processor and a communication interface, wherein the communication interface is configured to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the method according to any one of claims 1 to 5 is executed.