Network quality detection method and apparatus, electronic device, and medium

By acquiring the number of data packets within a transmission rate range and calculating the ratio when electronic devices access the network, the problem of inaccurate wireless network quality detection results is solved, and a more accurate network quality assessment is achieved.

WO2026037185A1PCT designated stage Publication Date: 2026-02-19VIVO MOBILE COMM CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/113294
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-12
Filing Date
2025-08-07
Publication Date
2026-02-19

AI Technical Summary

Technical Problem

In existing technologies, when electronic devices detect the quality of wireless networks, the detection results differ significantly from the actual network quality, resulting in low accuracy.

Method used

The network quality is determined by obtaining the number of data packets corresponding to the transmission rate intervals within the first time period, calculating the ratio of each interval, and then using the ratio as a basis.

Benefits of technology

This improves the accuracy of network quality testing results, making the results closer to the actual network quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025113294_19022026_PF_FP_ABST
    Figure CN2025113294_19022026_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communications, and discloses a network quality detection method and apparatus, an electronic device, and a storage medium. The network quality detection method comprises: when an electronic device is connected to a first network, acquiring a first quantity corresponding to each transmission rate interval within a first transmission rate range over a first duration, wherein the first quantity is the number of first data packets with transmission rates falling within the transmission rate interval among first data packets transmitted by the electronic device over the first duration, the first transmission rate range comprises at least two transmission rate intervals, and the first quantities are in one-to-one correspondence with the transmission rate intervals; summing the first quantities corresponding to the transmission rate intervals to obtain a second quantity; acquiring, for each transmission rate interval, a first ratio of the corresponding first quantity to the second quantity; and determining the network quality of the first network on the basis of the first ratios corresponding to the transmission rate intervals.
Need to check novelty before this filing date? Find Prior Art

Description

Network quality detection method and device, electronic device and medium

[0001] Cross-reference to Related Applications

[0002] The present application claims priority to the Chinese patent application No. 202411101153.5 filed on August 12, 2024 in China, the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0003] The present application belongs to the field of communication technology, and particularly relates to a network quality detection method, device, electronic device and readable storage medium. BACKGROUND

[0004] With the rapid development of wireless network technology, more and more electronic devices can access a wireless network through a wireless network access point to access the network. For example, after a mobile phone accesses a wireless network, a user can shop online, watch videos, listen to music and other entertainment activities through the mobile phone.

[0005] In the related art, an electronic device can access a wireless network, obtain a transmission rate of a last data packet transmitted within a preset time period, and then determine the network quality of a first network accessed by the electronic device according to the transmission rate of the last data packet, so that the electronic device can switch to other networks when the network quality of the wireless network is poor, to ensure the fluency of the user using the electronic device to access the network. The greater the transmission rate of the last data packet transmitted by the electronic device within the preset time period, the better the network quality of the wireless network accessed by the electronic device.

[0006] In some cases, for example, when the transmission rate of most data packets transmitted within a preset time period is low, and the transmission rate of the last transmitted data packet is high, the network quality of the wireless network detected by the related technology is good. However, since the transmission rate of most data packets transmitted within the preset time period is low, the actual network quality of the wireless network is poor. Therefore, the network quality of the wireless network detected by the related technology is greatly different from the actual network quality, resulting in low accuracy of the detection result. SUMMARY

[0007] The purpose of the embodiments of the present application is to provide a network quality detection method, device, electronic device and readable storage medium, which can improve the accuracy of the network quality detection result.

[0008] To solve the above technical problems, the present application is implemented as follows:

[0009] In a first aspect, the embodiments of the present application provide a network quality detection method, comprising:

[0010] In a case where the electronic device accesses the first network, a first quantity corresponding to a transmission rate interval in a first transmission rate range within a first time length is obtained, the first quantity being a quantity of first data packets with a transmission rate in the transmission rate interval in first data packets transmitted by the electronic device within the first time length, the first transmission rate range including at least two transmission rate intervals, and the first quantity being in one-to-one correspondence with the transmission rate interval;

[0011] The first quantities corresponding to the transmission rate intervals are added to obtain a second quantity;

[0012] A first ratio between the first quantity corresponding to the transmission rate interval and the second quantity is obtained;

[0013] The network quality of the first network is determined based on the first ratio corresponding to the transmission rate interval.

[0014] In a second aspect, an embodiment of the present application provides a network quality detection device, comprising:

[0015] a first obtaining module, a first processing module, a second obtaining module, and a second processing module; wherein

[0016] The first obtaining module is configured to, in a case where the electronic device accesses the first network, obtain a first quantity corresponding to a transmission rate interval in a first transmission rate range within a first time length, the first quantity being a quantity of first data packets with a transmission rate in the transmission rate interval in first data packets transmitted by the electronic device within the first time length, the first transmission rate range including at least two transmission rate intervals, and the first quantity being in one-to-one correspondence with the transmission rate interval.

[0017] The first processing module is configured to add the first quantities corresponding to the transmission rate intervals to obtain a second quantity.

[0018] The second obtaining module is configured to obtain a first ratio between the first quantity corresponding to the transmission rate interval and the second quantity.

[0019] The second processing module is configured to determine the network quality of the first network based on the first ratio corresponding to the transmission rate interval.

[0020] In a third aspect, an embodiment of the present application provides an electronic device, which comprises a processor and a memory, the memory storing programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the method according to the first aspect.

[0021] In a fourth aspect, an embodiment of the present application provides a readable storage medium, the readable storage medium storing programs or instructions, and the programs or instructions are executed by a processor to implement the steps of the method according to the first aspect.

[0022] In a fifth aspect, an embodiment of the present application provides a chip, which comprises a processor and a communication interface, the communication interface is coupled with the processor, and the processor is configured to run programs or instructions to implement the method in the first aspect.

[0023] In a sixth aspect, an embodiment of the present application provides a computer program product stored in a storage medium, which is executed by at least one processor to implement the method in the first aspect.

[0024] In the embodiment of the present application, in the case that the electronic device accesses the first network, a first quantity corresponding to a transmission rate interval in a first transmission rate range in a first time length is obtained, wherein the first quantity is the number of first data packets with a transmission rate in the transmission rate interval in the first data packets transmitted by the electronic device in the first time length, the first transmission rate range comprises at least two transmission rate intervals, and the first quantity is one-to-one corresponding to the transmission rate interval; a second quantity is obtained by adding the first quantities corresponding to the transmission rate intervals; a first ratio between the first quantity corresponding to the transmission rate interval and the second quantity is obtained; and the network quality of the first network is determined based on the first ratio corresponding to the transmission rate interval. By adding the first quantities corresponding to the transmission rate intervals, the total number of the first data packets transmitted by the electronic device in the first time length can be obtained. By obtaining the first ratio between the first quantity corresponding to the transmission rate interval and the second quantity, the proportion of the first data packets with the transmission rate in the transmission rate interval in all the first data packets transmitted in the first time length can be obtained. Then, when the network quality is determined based on the proportion of the first data packets with the transmission rate in the transmission rate interval in all the first data packets transmitted in the first time length, the network quality can be determined according to the size of the proportion of the first data packets with the transmission rate in the transmission rate interval in all the first data packets transmitted in the first time length, so that the detection result of the network quality is closer to the actual network quality, and the accuracy of the detection result of the network quality is improved. BRIEF DESCRIPTION OF DRAWINGS

[0025] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the description of the embodiments of the present application will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0026] FIG. 1 is a flowchart of a network quality detection method according to an embodiment of the present application;

[0027] FIG. 2 is a flowchart of a network quality detection method according to another embodiment of the present application;

[0028] FIG. 3 is a third flowchart of the network quality detection method according to an embodiment of the present application;

[0029] FIG. 4 is a fourth flowchart of the network quality detection method according to an embodiment of the present application;

[0030] FIG. 5 is a fifth flowchart of the network quality detection method according to an embodiment of the present application;

[0031] FIG. 6 is a structural schematic diagram of the network quality detection apparatus according to an embodiment of the present application;

[0032] FIG. 7 is a structural schematic diagram of the electronic device according to an embodiment of the present application;

[0033] FIG. 8 is a hardware structural schematic diagram of the electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0034] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.

[0035] The terms "first", "second", and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second", and the like are generally of a kind and are not limited in number, for example, the first object can be one or more. In addition, "and / or" in the specification and claims indicates at least one of the connected objects, and the character " / ", generally indicates that the front and rear associated objects are in an "or" relationship.

[0036] The terms "at least one", "at least one of", and the like in the specification and claims of the present application refer to any one of the objects, a combination of any two or more of the objects. For example, at least one of a, b, and c can mean "a", "b", "c", "a and b", "a and c", "b and c", and "a, b, and c", where a, b, and c can be single or multiple. Similarly, "at least two" refers to two or more, and has a similar meaning to "at least one".

[0037] The network quality detection method provided by the embodiments of the present application will be described in detail below in combination with the drawings and specific embodiments and application scenarios.

[0038] It should be noted that the network quality detection method provided in the embodiments of the present application can be executed by a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, or the like. In some embodiments of the present application, the network quality detection method is executed by an electronic device as an execution subject, and the network quality detection method provided in the embodiments of the present application is described.

[0039] The network quality detection method, the device, the electronic device, and the medium provided in the embodiments of the present application can be applied to a scenario in which an electronic device accesses a network. Specifically, the network quality detection method provided in the embodiments of the present application can be applied to a scenario in which the network quality of an accessed network is detected after the electronic device accesses the network.

[0040] In a specific application scenario, the network quality detection method provided in the embodiments of the present application can be applied to a scenario in which a user accesses a network by using a mobile phone.

[0041] For example, after the mobile phone accesses a wireless local area network (WLAN), the user can use the mobile phone to watch an online video. However, the network quality of the WLAN can be affected by the physical distance between the mobile phone and an access point, such as a router, of the WLAN, or the physical medium barrier between the mobile phone and the access point of the WLAN, and then the smoothness of the video watched by the user is affected. Therefore, the mobile phone can detect the network quality of the WLAN every certain period of time, for example, every second, and then the network can be switched in time when the network quality of the WLAN is poor, so as to ensure the smoothness of the video watched by the user.

[0042] In the related art, when the mobile phone accesses the WLAN, the mobile phone can obtain the transmission rate of the last data packet transmitted in the current 1 second when detecting the network quality of the WLAN in the current 1 second, and then the network quality of the WLAN accessed by the mobile phone is determined according to the transmission rate of the last data packet, and then the network can be switched to another network in time when the network quality of the WLAN is poor, so as to ensure the smoothness of the video watched by the user. In this case, the greater the transmission rate of the last data packet transmitted by the electronic device in a preset time length, the better the network quality of the WLAN accessed by the electronic device.

[0043] In some cases, for example, when the transmission rate of most data packets transmitted in the current 1 second is low, and the transmission rate of the last transmitted data packet is high, the network quality of the WLAN detected by the related art is good. However, the network quality of the WLAN is poor when the transmission rate of most data packets transmitted in the current 1 second is low. For another example, when the transmission rate of most data packets transmitted in the current 1 second is high, and the transmission rate of the last transmitted data packet is low, the network quality of the WLAN detected by the related art is poor. However, the network quality of the WLAN is good when the transmission rate of most data packets transmitted in the current 1 second is high. Therefore, the network quality of the WLAN detected by the related art can be quite different from the actual network quality, and the accuracy of the detection result is low.

[0044] In the network quality detection method, apparatus, electronic device, and medium provided in the present application, when the electronic device accesses a first network, a first quantity corresponding to a transmission rate interval in a first transmission rate range in a first time length is obtained, the first quantity is the number of first data packets with a transmission rate in the transmission rate interval among first data packets transmitted by the electronic device in the first time length, the first transmission rate range includes at least two transmission rate intervals, and the first quantity is in one-to-one correspondence with the transmission rate interval. The first quantities corresponding to the transmission rate intervals are added to obtain a second quantity. A first ratio between the first quantity and the second quantity corresponding to the transmission rate interval is obtained. The network quality of the first network is determined based on the first ratio corresponding to the transmission rate interval. By adding the first quantities corresponding to the transmission rate intervals, the total number of first data packets transmitted by the electronic device in the first time length can be obtained. By obtaining the first ratio between the first quantity and the second quantity corresponding to the transmission rate interval, the proportion of the first data packets with a transmission rate in the transmission rate interval in all first data packets transmitted in the first time length can be obtained. When the network quality is determined based on the proportion of the first data packets with a transmission rate in the transmission rate interval in all first data packets transmitted in the first time length, the network quality can be determined according to the size of the proportion of the first data packets with a transmission rate in the transmission rate interval in all first data packets transmitted in the first time length, so that the detection result of the network quality is closer to the actual network quality, and the accuracy of the detection result of the network quality is improved.

[0045] FIG. 1 is a flow diagram of a network quality detection method provided in an embodiment of the present application. As shown in FIG. 1, the network quality detection method provided in the embodiment of the present application can include the following steps 101 to 104:

[0046] In step 101, when the electronic device accesses a first network, the electronic device obtains a first quantity corresponding to a transmission rate interval in a first transmission rate range in a first time length.

[0047] In some embodiments of the present application, the first quantity is the number of first data packets with a transmission rate within the transmission rate range among the first data packets transmitted by the electronic device within the first time length, the first transmission rate range includes at least two transmission rate ranges, and the first quantity is one-to-one corresponding to the transmission rate ranges.

[0048] In some embodiments of the present application, the first network can be a wireless network such as a WLAN and a mobile data network, or a wired network such as a broadband network, which is not specifically limited herein.

[0049] In some embodiments of the present application, the first transmission rate range is a range of all possible transmission rates of the data packets. For example, the first transmission rate range can be 0~+∞, with the unit of Mbps, i.e., the minimum transmission rate of the data packets can be 0 Mbps, and the maximum transmission rate can be +∞ Mbps.

[0050] In some embodiments of the present application, the first transmission rate range includes a plurality of transmission rate ranges, which can be uniformly divided from the first transmission rate range or non-uniformly divided from the first transmission rate range. For example, when the first transmission rate range is 0~+∞, the transmission rate ranges can be [0, 10], (10, 20], (20, 70], (70, 100] and (100, +∞) respectively.

[0051] In some embodiments of the present application, the electronic device can obtain a preconfigured configuration file in the initialization process of starting up, before the electronic device is connected to the first network, the configuration file storing a first transmission rate range list configured by a developer. The first transmission rate range list includes a plurality of transmission rate ranges divided from the first transmission rate range. If the configuration file is obtained, the electronic device obtains all the transmission rate ranges in the first transmission rate range list in the configuration file. If the network quality detection configuration file is not obtained, the electronic device obtains a second transmission rate range list of the electronic device, which includes a plurality of transmission rate ranges divided from the first transmission rate range.

[0052] In some embodiments of the present application, the first data packet is a data packet of a first preset type, or the first data packet is a data packet other than a second preset type, and the second preset type is different from the first preset type.

[0053] In some embodiments of the present application, the first preset type of data packet is a valid message data, and the second preset type of data packet is a non-valid message data. For example, the second preset type of data packet can be a Dynamic Host Configuration Protocol (DHCP) message, an Address Resolution Protocol (ARP) message, or the like.

[0054] In some embodiments of the present application, the electronic device can obtain the counting value of the counter corresponding to each transmission rate interval within the first time length, and then determine the first quantity corresponding to each transmission rate interval based on the counting value of the counter corresponding to each transmission rate interval within the first time length. The counter corresponding to each transmission rate interval is used to record the quantity of the first data packet whose transmission rate is located in the corresponding transmission rate interval. That is, the counting value of the counter corresponding to each transmission rate interval within the first time length is the quantity of the first data packet whose transmission rate is located in the corresponding transmission rate interval among all the first data packets transmitted by the electronic device within the first time length.

[0055] In step 102, the electronic device adds the first quantity corresponding to the transmission rate interval to obtain a second quantity.

[0056] In some embodiments of the present application, the second quantity is the total quantity of the first data packet transmitted by the electronic device within the first time length in the case of accessing the first network.

[0057] In some embodiments of the present application, the electronic device can calculate the second quantity by using the following formula: m (1)

[0058] Wherein, N represents the second quantity, N1 represents the first quantity corresponding to the first transmission rate interval in the first transmission rate range, N2 represents the first quantity corresponding to the second transmission rate interval in the first transmission rate range, and Nm represents the first quantity corresponding to the mth transmission rate interval in the first transmission rate range. The first transmission rate range includes the m transmission rate intervals divided from the first transmission rate range. m

[0059] In step 103, the electronic device obtains a first ratio between the first quantity corresponding to the transmission rate interval and the second quantity.

[0060] In some embodiments of the present application, the first ratio is the proportion of the first data packet whose transmission rate is located in the transmission rate interval among all the first data packets transmitted within the first time length. ​

[0061] For example, the first transmission rate interval can be (10, 20], the first ratio is 20% when the first quantity corresponding to the first transmission rate interval is 5 and the second quantity is 10, which means that the quantity of the first data packet with the transmission rate in (10, 20] is 5, the total quantity of the first data packet is 10, and the proportion of the first data packet with the transmission rate in (10, 20] in all the first data packet transmitted in the first time length is 20%.

[0062] In step 104, the electronic device determines the network quality of the first network based on the first ratio corresponding to the transmission rate interval.

[0063] In some embodiments of the present application, as shown in FIG. 2, the above step 104 can be implemented by the following step 104a and the following step 104b in combination with FIG. 1.

[0064] In step 104a, the electronic device determines a target transmission rate interval from the first transmission rate range.

[0065] In some embodiments of the present application, the target transmission rate interval has a first ratio greater than the first proportion threshold corresponding to the transmission rate interval.

[0066] In some embodiments of the present application, one transmission rate interval in the first transmission rate range corresponds to one first proportion threshold.

[0067] For example, the first transmission rate range 0~+∞ has transmission rate intervals [0, 10], (10, 20], (20, 70], (70, 100] and (100, +∞), and the first proportion thresholds corresponding to the transmission rate intervals [0, 10], (10, 20], (20, 70], (70, 100] and (100, +∞) are 80%, 75%, 75%, 70% and 70% respectively. If the first ratios corresponding to the transmission rate intervals [0, 10], (10, 20], (20, 70], (70, 100] and (100, +∞) are 5%, 5%, 80%, 5% and 5% respectively, the first ratio 80% corresponding to the transmission rate interval (20, 70] is greater than the first proportion threshold 75% corresponding to the transmission rate interval (20, 70], and the transmission rate interval (20, 70] is the target transmission rate interval.

[0068] In step 104a, the electronic device determines the network quality of the first network based on the interval information of the target transmission rate interval in the segment in the first transmission rate range.

[0069] In some embodiments of the present application, the interval information of the target transmission rate interval can be the segment in the first transmission rate range where the target transmission rate interval is located.

[0070] In some embodiments of the present application, if the section where the target transmission rate interval is located in the first transmission rate range is a low transmission rate section, the electronic device determines that the network quality level of the first network is level one; if the section where the target transmission rate interval is located in the first transmission rate range is a low-to-medium transmission rate section, the electronic device determines that the network quality level of the first network is level two; if the section where the target transmission rate interval is located in the first transmission rate range is a medium transmission rate section, the electronic device determines that the network quality level of the first network is level three; if the section where the target transmission rate interval is located in the first transmission rate range is a medium-to-high transmission rate section, the electronic device determines that the network quality level of the first network is level four; if the section where the target transmission rate interval is located in the first transmission rate range is a high transmission rate section, the electronic device determines that the network quality level of the first network is level five. The higher the network quality level, the better the network quality.

[0071] For example, when the target transmission rate interval is (20, 70], which is a medium transmission rate range section in the first transmission rate range 0~+∞, the electronic device determines that the network quality level of the first network is level three.

[0072] It should be noted that the electronic device can also pre-configure a second proportion threshold for all transmission rate intervals in the first transmission rate range. The electronic device can determine the target transmission rate interval from the first transmission rate range according to the size relationship between the first ratio corresponding to each transmission rate interval and the second proportion threshold. The first ratio corresponding to the target transmission rate interval is greater than the second proportion threshold. The electronic device determines the network quality of the first network based on the interval information of the target transmission rate interval.

[0073] For example, the second proportion threshold is 75%, and when the first transmission rate range is 0~+∞, if the first ratio corresponding to the transmission rate interval (20, 70] in the first transmission rate range 0~+∞ is 80%, which is greater than 75%, then the transmission rate interval (20, 70] is the target transmission rate interval.

[0074] It should be noted that the first ratio corresponding to the target transmission rate interval is greater than or equal to the first proportion threshold, which means that in the first data packets transmitted in the first time period, the transmission rate of most of the first data packets is in the target transmission rate interval. Therefore, when the electronic device determines the network quality of the first network based on the interval information of the target transmission rate interval, the network quality of the first network is closer to the actual network quality, thereby improving the accuracy of the network quality detection result.

[0075] Therefore, when the electronic device determines the network quality of the first network by using the interval information of the target transmission rate interval in the first transmission rate range, the first transmission rate interval has a first ratio value greater than or equal to the first proportion threshold value, and the network quality of the first network is closer to the actual network quality, thereby improving the accuracy of the network quality detection result.

[0076] It should be noted that in the case where the number of transmission rate intervals divided in the first transmission rate range is large, the electronic device can also determine the network quality of the first network based on the interval information of the target adjacent transmission rate interval (the section in which the target adjacent transmission rate interval is located in the first transmission rate range), the target adjacent transmission rate interval being at least two adjacent transmission rate intervals in the first transmission rate range, the first sum value of the first ratio values corresponding to all transmission rate intervals in the target adjacent transmission rate interval being greater than or equal to a corresponding third proportion threshold value, and each of the at least two adjacent transmission rate intervals corresponding to a third proportion threshold value.

[0077] For example, if the first ratio values corresponding to the transmission rate intervals [0, 5], (5, 10], (10, 20], (20, 40], (40, 60], (60, 80], (80, 100], (100, 140], (140, 200], and (200, +∞) are 45%, 35%, 5%, 5%, 3%, 3%, 3%, 1%, 0, and 0, respectively, the second proportion threshold value corresponding to the adjacent transmission rate intervals [0, 5] and (5, 10] is 75%, the third proportion threshold value corresponding to the adjacent transmission rate intervals [0, 5] and (5, 10] is 75%, the third proportion threshold value corresponding to the adjacent transmission rate intervals (10, 20] and (20, 40] is 70%, the third proportion threshold value corresponding to the adjacent transmission rate intervals (40, 60] and (60, 80] is 70%, the third proportion threshold value corresponding to the adjacent transmission rate intervals (80, 100] and (100, 140] is 70%, and the fifth threshold value corresponding to the adjacent transmission rate intervals (140, 200] and (200, +∞) is 70%. Then, the first sum value corresponding to the adjacent transmission rate intervals [0, 5] and (5, 10] is 80%, which is greater than the third proportion threshold value 75% corresponding to the adjacent transmission rate intervals [0, 5] and (5, 10], and the target adjacent transmission rate interval is the adjacent transmission rate intervals [0, 5] and (5, 10]. Further, since the target adjacent transmission rate intervals [0, 5] and (5, 10] are located in the low transmission rate section in the first transmission rate range 0~+∞, the electronic device determines that the network quality level of the first network is level one.

[0078] It should be noted that the electronic device can also pre-configure a fourth proportion threshold for all adjacent transmission rate intervals. The electronic device can determine a target adjacent transmission rate interval from the first transmission rate range according to the size relationship between the first sum value corresponding to each of at least two adjacent transmission rate intervals and the fourth proportion threshold, and the first sum value corresponding to the target adjacent transmission rate interval is greater than the fourth proportion threshold. The electronic device determines the network quality of the first network based on the interval information of the target adjacent transmission rate interval.

[0079] For example, when the transmission rate intervals in the first transmission rate range 0~+∞ are [0, 5], (5, 10], (10, 20], (20, 40], (40, 60], (60, 80], (80, 100], (100, 140], (140, 200], and (200, +∞) in total 10 transmission rate intervals, if the first proportion value corresponding to the transmission rate interval [0, 5] is 40%, and the first proportion value corresponding to the transmission rate interval (5, 10] is 37%, then the first sum value corresponding to the adjacent transmission rate intervals [0, 5] and (5, 10] is 77%. Assuming that the fourth proportion threshold is 75%, then the first sum value corresponding to the adjacent transmission rate intervals [0, 5] and (5, 10] is greater than the fourth threshold, and the adjacent transmission rate intervals [0, 5] and (5, 10] are the target adjacent transmission rate intervals. Further, since the target adjacent transmission rate intervals [0, 5] and (5, 10] are located in the low transmission rate section in the first transmission rate range 0~+∞, the electronic device determines that the network quality level of the first network is level one.

[0080] In the network quality detection method provided in the present application, by adding the first quantities corresponding to the transmission rate intervals, the total quantity of the first data packets transmitted by the electronic device within the first time length can be obtained; by obtaining the first proportion value between the first quantity and the second quantity corresponding to the transmission rate interval, the proportion of the first data packets with the transmission rate in the transmission rate interval in all the first data packets transmitted within the first time length can be obtained, and then when the network quality is determined based on the proportion of the first data packets with the transmission rate in the transmission rate interval in all the first data packets transmitted within the first time length, the good or bad of the network quality can be determined according to the size of the proportion value, so that the detection result of the network quality is closer to the actual network quality, and the accuracy of the detection result of the network quality is improved.

[0081] In some embodiments of the present application, as shown in Figure 3, before the above step 101, the network quality detection method provided by the present application further includes the following steps 105 and 106, and the above step 101 can be implemented by the following steps 101a to 101c:

[0082] Step 105, before accessing the first network, the electronic device configures a corresponding counter for each transmission rate interval in the transmission rate range.

[0083] In some embodiments of the present application, one transmission rate interval in the first transmission rate range corresponds to one counter.

[0084] In some embodiments of the present application, the electronic device can configure a corresponding counter for each transmission rate interval in the first transmission rate range after the boot initialization process is completed and before the electronic device accesses the first network. The counter corresponding to the transmission rate interval is used to record the number of first data packets with transmission rates in the transmission rate interval.

[0085] Step 106, after accessing the first network, the electronic device increments the counter corresponding to the transmission rate interval of the first data packet by 1 each time a first data packet is transmitted.

[0086] In some embodiments of the present application, after accessing the first network, the electronic device can determine the transmission rate interval in which the transmission rate of the first data packet is located according to the transmission rate of the first data packet each time a first data packet is transmitted, and then increment the counter corresponding to the transmission rate interval in which the transmission rate of the first data packet is located by 1.

[0087] For example, after accessing the first network, the electronic device transmits a first data packet with a transmission rate of 55 Mbps, and the transmission rate interval in which the transmission rate of the first data packet is located is (40, 60]. The electronic device increments the counter corresponding to the transmission rate interval (40, 60] by 1.

[0088] Step 101a, the electronic device obtains a first count value of the counter corresponding to the transmission rate interval at a first time.

[0089] In some embodiments of the present application, the first time is the starting time of the first time length.

[0090] In some embodiments of the present application, the first count value of the counter corresponding to each transmission rate interval at the first time indicates the total number of first data packets with transmission rates in the corresponding transmission rate interval at the first time.

[0091] Step 101b, the electronic device obtains a second count value of the counter corresponding to the transmission rate interval at a second time.

[0092] In some embodiments of the present application, the second time is the end time of the first time length.

[0093] In some embodiments of the present application, the first count value of the counter corresponding to the transmission rate interval at the second time indicates the total number of the first data packets whose transmission rates are within the corresponding transmission rate interval at the second time.

[0094] In step 101c, the electronic device calculates the difference between the second count value and the first count value of each counter corresponding to the transmission rate interval as the first number corresponding to each transmission rate interval.

[0095] In some embodiments of the present application, the difference between the second count value and the first count value of each counter corresponding to the transmission rate interval is the number of the first data packets whose transmission rates are within the corresponding transmission rate interval among the first data packets transmitted by the electronic device within the first time length. In other words, the difference between the second count value and the first count value of each counter corresponding to the transmission rate interval is the first number corresponding to each transmission rate interval.

[0096] For example, the count value of the counter corresponding to the transmission rate interval (20, 70] at the first time is 100, and the count value of the counter corresponding to the transmission rate interval (20, 70] at the third time is 200. Therefore, the first number corresponding to the transmission rate interval (20, 70] is 100.

[0097] In this way, the electronic device can accurately calculate the first number corresponding to each transmission rate interval by calculating the difference between the second count value and the first count value of each counter corresponding to the transmission rate interval, and can improve the accuracy of the network quality detection result when determining the network quality of the first network by using the first number corresponding to each transmission rate interval.

[0098] In some embodiments of the present application, as shown in FIG. 4, the network quality detection method provided by the present application further includes the following step 107 in combination with FIG. 1:

[0099] In step 107, the electronic device resets the counters corresponding to the transmission rate intervals when the electronic device is disconnected from the first network or when the electronic device is connected to the second network.

[0100] In some embodiments of the present application, the first network and the second network are different networks.

[0101] In some embodiments of the present application, the second network can be a wireless network such as a wireless local area network and a mobile data network, or a wired network such as a broadband network, which is not specifically limited herein.

[0102] In some embodiments of the present application, the electronic device can disconnect from the first network or connect to the second network when the second preset condition is met. The second preset condition is that the network quality level of the first network is equal to or less than a preset level, and the first network parameter of the first network is in a preset network parameter interval. The first network parameter can include at least one of a received signal strength indicator (RSSI) and a number of data packets that fail to be transmitted.

[0103] For example, the preset level can be level one, and the preset network parameter interval can be at least one of RSSI≤-80 dB and a number of data packets that fail to be transmitted≥10. Assuming that the network quality level of the first network is level one, the first network parameter is at least one of RSSI=-90 dB and a number of data packets that fail to be transmitted=20, the electronic device determines that the second preset condition is met, the electronic device disconnects from the first network, or the electronic device connects to the second network.

[0104] It should be noted that when the first network is disconnected or the electronic device accesses the second network, the electronic device will clear the counters corresponding to each of the transmission rate intervals, so that the counters corresponding to each of the transmission rate intervals will no longer record the number of data packets whose transmission rate is in the corresponding transmission rate interval when the electronic device connects to the first network, but will record the number of data packets whose transmission rate is in the corresponding transmission rate interval when the electronic device connects to the first network or the electronic device accesses the second network. Therefore, it is avoided that when the first network is disconnected or the electronic device connects to the second network, the counters corresponding to each of the transmission rate intervals continue to count, and the number of data packets whose transmission rate is in the corresponding transmission rate interval when the electronic device disconnects from the first network or the electronic device accesses the second network is added to the number of data packets whose transmission rate is in the corresponding transmission rate interval when the electronic device connects to the first network, thereby avoiding affecting the network quality detection result of the first network and improving the accuracy of the network quality detection result.

[0105] In this way, the electronic device is disconnected from the first network, or in the case of connecting the second network, the electronic device clears the counter corresponding to each transmission rate interval, so as to avoid the counter corresponding to each transmission rate interval continuing to count in the case of the electronic device being disconnected from the first network or connecting the second network, and the number of data packets with the transmission rate in the corresponding transmission rate interval being accumulated in the case of the electronic device connecting the first network, thereby avoiding affecting the detection result of the network quality of the first network, and improving the accuracy of the network quality detection result.

[0106] In some embodiments of the present application, the target transmission rate interval is a transmission rate interval in the first transmission rate range, and the first ratio is greater than or equal to a corresponding second threshold value. In combination with FIG. 2, as shown in FIG. 5, before step 104a, the network quality detection method provided by the present application further includes the following steps 108 and 109:

[0107] In step 108, the electronic device acquires a network parameter corresponding to each historical time length in N historical time lengths, and a second ratio between a third number and a fourth number corresponding to a transmission rate interval in each historical time length.

[0108] In some embodiments of the present application, the third number is the number of first data packets with the transmission rate in the transmission rate interval in the first data packets transmitted by the electronic device in the historical time length, the fourth number is a number obtained by adding the third number corresponding to the transmission rate interval, and N is a positive integer.

[0109] In some embodiments of the present application, one transmission rate interval corresponds to one second ratio.

[0110] In some embodiments of the present application, the electronic device can acquire the network parameter corresponding to each historical time length in all historical time lengths by means of big data, and the second ratio corresponding to the transmission rate interval in each historical time length.

[0111] It should be noted that the determination method of the second ratio corresponding to the transmission rate interval in each historical time length is similar to the determination method of the first ratio corresponding to the transmission rate interval in the first time length, and details are not repeated here.

[0112] In some embodiments of the present application, the network parameter corresponding to each historical time length can be at least one of the RSSI and the number of data packets with transmission failures acquired by the electronic device in each historical time length.

[0113] In step 109, the electronic device determines the proportion threshold corresponding to the first transmission rate interval based on the second ratio corresponding to the first transmission rate interval in the target historical time length.

[0114] In some embodiments of the present application, each network parameter interval corresponds to a transmission rate interval.

[0115] In some embodiments of the present application, each network parameter interval corresponds to a transmission rate interval.

[0116] In some embodiments of the present application, the number of target historical time lengths can be multiple. The electronic device can calculate the average of the second ratios corresponding to the first transmission rate interval in all target historical time lengths, and then take the average as the proportion threshold corresponding to the first transmission rate interval.

[0117] In some embodiments of the present application, the electronic device can calculate the median of the second ratios corresponding to the first transmission rate interval in all target historical time lengths, and then take the median as the proportion threshold corresponding to the first transmission rate interval.

[0118] In some embodiments of the present application, the electronic device can obtain the normal distribution of the second ratios corresponding to the first transmission rate interval in all target historical time lengths, and then determine the proportion threshold corresponding to the first transmission rate interval according to the normal distribution.

[0119] For example, the first transmission rate interval can be (20, 70], and the network parameter can be RSSI. The first network parameter interval corresponding to the first transmission rate interval (20, 70] can be the first RSSI interval (-70, -60]. Assuming that the RSSIs corresponding to the 10 historical time lengths are -85 dB, -80 dB, -75 dB, -70 dB, -60 dB, -65 dB, -68 dB, -83 dB, -78 dB, and -90 dB, respectively. The RSSIs corresponding to the 5th historical time length, the 6th historical time length, and the 7th historical time length are in the first RSSI interval (-70, -60], that is, the 5th historical time length, the 6th historical time length, and the 7th historical time length are target historical time lengths. The electronic device can determine the second ratios corresponding to the first transmission rate interval (20, 70] in the 5th historical time length, the 6th historical time length, and the 7th historical time length, respectively, and then determine the second threshold corresponding to the first transmission rate interval (20, 70] based on the second ratios corresponding to the first transmission rate interval (20, 70] in the 5th historical time length, the 6th historical time length, and the 7th historical time length.

[0120] Thus, the electronic device acquires the network parameters corresponding to each of the N historical time lengths, and the second ratio between the third quantity and the fourth quantity corresponding to the transmission rate interval in each historical time length, determines the proportion threshold corresponding to the first transmission rate interval based on the second ratio corresponding to the first transmission rate interval in the target historical time length, and can correct the proportion threshold corresponding to the transmission rate interval based on the historical data, thereby improving the accuracy of the network quality detection result.

[0121] In the following, the network quality detection method provided by the present application will be exemplarily described by taking Example One as an example.

[0122] Example One

[0123] In this embodiment, the electronic device is a mobile phone terminal, for example, an Android mobile phone terminal, and the first network is a WiFi, which is taken as an example to illustrate the network quality detection method provided by the present application. Exemplarily, the network quality detection method can include the following steps 201 to 209.

[0124] In step 201, the Android framework upper layer of the mobile phone terminal checks whether there is a corresponding configuration file in the initialization process of starting up, reads the configured transmission rate interval from the configuration file if there is one, or uses the default configured transmission rate interval if there is none.

[0125] Exemplarily, an array can be used to record the start node and the end node of the transmission rate interval. For example, [0, 10, 20, 70, 100] can represent five transmission rate intervals (unit: Mbps), which are [0, 10], (10, 20], (20, 70], (70, 100], and (100, +∞) respectively.

[0126] In step 202, after the mobile phone terminal is driven to start up, a certain time delay can be set, which can be 10-30s, and then the transmission rate interval division configuration is read from the framework through a private interface.

[0127] Exemplarily, the mobile phone terminal can set a counter for each transmission rate interval, which starts from 0, and this counter is a cumulative value, which is cleared and re-counted after being connected to a new Basic Service Set Identity document (BSSID) or a WiFi disconnection occurs. The Basic Service Set (BSS) is a special application of point-to-point Ad-hoc local area network (LAN), and a group of computers can form a group by setting the same BSS name, and the BSS name is called BSSID.

[0128] Step 203, after the mobile terminal is connected to WiFi, it starts to obtain all valid data packets per second in each transmission rate interval. The types of packets to be counted can be customized, and packets such as DHCP and ARP can be excluded. Then the transmission rate of each data packet is obtained, and the counter corresponding to the interval is incremented by 1 according to the interval divided in step 202.

[0129] Step 204, the Android framework of the mobile terminal reads the count value of the counter corresponding to each transmission rate interval from the driver through a private interface every second.

[0130] Step 205, the mobile terminal performs difference operation on the count value of each transmission rate interval and the count value of each transmission rate interval read in the previous several seconds in the corresponding transmission rate interval, to obtain the count difference of each transmission rate interval in this period of time, that is, the number of data packets in different transmission rate intervals in this period of time.

[0131] Step 206, the mobile terminal calculates the proportion of the number of data packets corresponding to different transmission rate intervals according to the number of data packets corresponding to different transmission rate intervals counted above.

[0132] Step 207, the mobile terminal compares the proportion of the number of data packets corresponding to different transmission rate intervals with the preset threshold value to determine the network quality level of the current WiFi.

[0133] For example, the preset threshold value can be hard-coded into the code, or it can be set in the form of an online configuration file. It can also be learned by artificial intelligence AI.

[0134] Step 208, the mobile terminal determines whether it needs to switch WiFi according to the network quality level of the current WiFi calculated above, combined with RSSI, the number of failed data packets and other dimensional information.

[0135] Step 209, this step is connected to step 207. The mobile terminal collects data on the proportion of different transmission rate intervals, the network quality level of the current WiFi, and other dimensional information such as RSSI and the number of failed data packets. By associating RSSI, the number of failed data packets and the proportion of different transmission rate intervals, the threshold value in step 207 is corrected, thereby improving the accuracy of the network quality detection result.

[0136] To sum up, the network quality detection method provided in the application, on the one hand, compared with the related art which directly determines the network quality of the currently connected WiFi of the device based on the transmission rate of the last data packet, the application will statistically determine the transmission rates of all valid data packets. Then the transmission rate distribution of the data packets is calculated, and then the network quality of the WiFi in this second is obtained, which is theoretically closer to the real network quality of the currently connected WiFi, avoiding the problem that when most of the high transmission rate data packets in 1s are concentrated in the first half, but a small part of the low transmission rate data packets are concentrated in the second half, the network quality detection result is deviated greatly by using the transmission rate of the last data packet to determine the network quality, thereby improving the accuracy of the network quality detection result. On the other hand, the transmission rate interval can be dynamically adjusted through the configuration file, and the type of the data packet can be set, leaving space for more detailed statistics in the future.

[0137] It should be noted that each of the above method embodiments, or each of the various possible implementation manners in each method embodiment, can be executed alone or in combination with any two or more of them. The specific execution can be determined according to actual use requirements, and the embodiments of the application do not limit this.

[0138] The network quality detection method provided in the embodiments of the application can be executed by a network quality detection device. In the embodiments of the application, the network quality detection device is taken as an example to illustrate the network quality detection device provided in the embodiments of the application.

[0139] FIG. 6 is a structural schematic diagram of the network quality detection device provided in the embodiments of the application. As shown in FIG. 6, the network quality detection device 600 includes a first acquisition module 601, a first processing module 602, a second acquisition module 603, and a second processing module 604; wherein,

[0140] The first acquisition module 601 is configured to, in a case where an electronic device accesses a first network, acquire a first quantity corresponding to a transmission rate interval in a first transmission rate range within a first time length, wherein the first quantity is a quantity of first data packets with a transmission rate in the transmission rate interval among first data packets transmitted by the electronic device within the first time length, the first transmission rate range includes at least two transmission rate intervals, and the first quantity is one-to-one corresponding to the transmission rate interval;

[0141] The first processing module 602 is configured to add the first quantities corresponding to the transmission rate intervals to obtain a second quantity;

[0142] The second acquisition module 603 is configured to acquire a first ratio between the first quantity corresponding to the transmission rate interval and the second quantity;

[0143] The second processing module 604 is configured to determine the network quality of the first network based on the first ratio corresponding to the transmission rate interval.

[0144] In some embodiments of the present application, the first data packet is a data packet of a first preset type, or the first data packet is a data packet other than a second preset type, and the second preset type is different from the first preset type.

[0145] In some embodiments of the present application, the second processing module 604 is specifically configured to:

[0146] determine a target transmission rate interval from the first transmission rate range, the target transmission rate interval being a transmission rate interval in which the first ratio is greater than the proportion threshold corresponding to the transmission rate interval; and determine the network quality of the first network based on interval information of the target transmission rate interval.

[0147] In some embodiments of the present application, the second processing module 604 is further configured to, before determining the target transmission rate interval from the first transmission rate range, obtain a network parameter corresponding to each of N historical time lengths, and a second ratio between a third number and a fourth number corresponding to the transmission rate interval in each historical time length, wherein the third number is the number of first data packets with transmission rates in the transmission rate interval among the first data packets transmitted by the electronic device in the historical time length, the fourth number is a number obtained by adding the third number corresponding to the transmission rate interval, and N is a positive integer; determine the proportion threshold corresponding to the first transmission rate interval based on the second ratio corresponding to the first transmission rate interval in the target historical time length, wherein the target historical time length is a historical time length in which the network parameter is in the first network parameter interval among the N historical time lengths, the first network parameter interval corresponds to the first transmission rate interval, and the first transmission rate interval is one transmission rate interval in the first transmission rate range.

[0148] In the network quality detection apparatus provided in the present application, the first number corresponding to the transmission rate interval is added to obtain the total number of the first data packets transmitted by the electronic device in the first time length; the first ratio between the first number and the second number corresponding to the transmission rate interval is obtained to obtain the proportion of the first data packets with transmission rates in the transmission rate interval in all the first data packets transmitted in the first time length, and then the network quality is determined based on the proportion of the first data packets with transmission rates in the transmission rate interval in all the first data packets transmitted in the first time length, so that the network quality is determined according to the size of the proportion of the first data packets with transmission rates in the transmission rate interval in all the first data packets transmitted in the first time length, the detection result of the network quality is closer to the actual network quality, and the accuracy of the detection result of the network quality is improved.

[0149] The network quality detection apparatus in the embodiments of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other device than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or the like, and can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, and the like, and the embodiments of the present application are not limited in this regard.

[0150] The network quality detection apparatus in the embodiments of the present application can be a device with an operating system. The operating system can be an Android operating system, an ios operating system, or other possible operating system, and the embodiments of the present application are not limited in this regard.

[0151] The network quality detection apparatus provided in the embodiments of the present application can implement each process implemented by the method embodiments of FIGS. 1 to 5, and thus repeated description is omitted here.

[0152] Optionally, as shown in FIG. 7, the embodiments of the present application further provide an electronic device 700, which includes a processor 701 and a memory 702, and the memory 702 has a program or instruction stored thereon, which can be run on the processor 701, and when the program or instruction is executed by the processor 701, each step of the above network quality detection method embodiments is implemented, and the same technical effects are achieved, and thus repeated description is omitted here.

[0153] It should be noted that the electronic device in the embodiments of the present application includes the mobile electronic device and the non-mobile electronic device.

[0154] FIG. 8 is a schematic diagram of a hardware structure of an electronic device for implementing the embodiments of the present application.

[0155] The electronic device 800 includes, but is not limited to, a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, and a processor 810, etc.

[0156] Those skilled in the art can understand that the electronic device 800 can further include a power supply (such as a battery) for supplying power to each component, and the power supply can be logically connected to the processor 810 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The electronic device structure shown in FIG. 8 does not constitute a limitation on the electronic device, and the electronic device can include more or fewer components than those shown, or combine certain components, or different component arrangements, which are not described here.

[0157] The processor 810 is configured to: in a case where the electronic device accesses a first network, obtain a first quantity corresponding to a transmission rate interval in a first transmission rate range within a first time length, wherein the first quantity is a quantity of first data packets with a transmission rate in the transmission rate interval in first data packets transmitted by the electronic device within the first time length, the first transmission rate range includes at least two transmission rate intervals, and the first quantity is one-to-one corresponding to the transmission rate interval; add the first quantities corresponding to the transmission rate intervals to obtain a second quantity; obtain a first ratio between the first quantity and the second quantity corresponding to the transmission rate interval; and determine a network quality of the first network based on the first ratio corresponding to the transmission rate interval.

[0158] In some embodiments of the present application, the first data packet is a data packet of a first preset type, or the first data packet is a data packet other than a data packet of a second preset type, and the second preset type is different from the first preset type.

[0159] In some embodiments of the present application, the processor 810 is specifically configured to: determine a target transmission rate interval from the first transmission rate range, the target transmission rate interval being a transmission rate interval with a first ratio value greater than a proportion threshold value corresponding to the transmission rate interval; and determine the network quality of the first network based on interval information of the target transmission rate interval.

[0160] In some embodiments of the present application, the processor 810 is further configured to, before determining the target transmission rate interval from the first transmission rate range, obtain a network parameter corresponding to each of the N historical time lengths, and a second ratio between a third quantity and a fourth quantity corresponding to the transmission rate interval in each of the historical time lengths, wherein the third quantity is a number of first data packets with a transmission rate in the transmission rate interval among first data packets transmitted by the electronic device in the historical time length, the fourth quantity is a number obtained by adding the third quantity corresponding to the transmission rate interval, and N is a positive integer; determine a proportion threshold corresponding to the first transmission rate interval based on a second ratio corresponding to the first transmission rate interval in a target historical time length, wherein the target historical time length is a historical time length in the N historical time lengths in which the network parameter is in a first network parameter interval corresponding to the first transmission rate interval, and the first transmission rate interval is one transmission rate interval in the first transmission rate range.

[0161] In the electronic device provided in the present application, the electronic device can obtain a total number of first data packets transmitted by the electronic device in a first time length by adding a first quantity corresponding to the transmission rate interval, and obtain a proportion of the first data packets with a transmission rate in the transmission rate interval in all first data packets transmitted in the first time length by obtaining a first ratio between the first quantity and a second quantity corresponding to the transmission rate interval, and then determine the network quality based on the proportion of the first data packets with a transmission rate in the transmission rate interval in all first data packets transmitted in the first time length, so that the network quality can be determined according to the size of the proportion of the first data packets with a transmission rate in the transmission rate interval in all first data packets transmitted in the first time length, the detection result of the network quality is closer to the actual network quality, and the accuracy of the detection result of the network quality is improved.

[0162] It should be understood that in the embodiments of the present application, the input unit 804 can include a graphics processor (GPU) 8041 and a microphone 8042. The graphics processor 8041 processes image data of a still picture or a video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 806 can include a display panel 8061, which can be configured in the form of a liquid crystal display, an organic light-emitting diode, etc. The user input unit 807 includes at least one of a touch panel 8071 and other input devices 8072. The touch panel 8071 is also called a touch screen. The touch panel 8071 can include a touch detection device and a touch controller. The other input devices 8072 can include, but are not limited to, a physical keyboard, function keys (such as volume control keys, on-off keys, etc.), trackballs, mice, joysticks, and the like, which will not be described here.

[0163] The memory 809 can be used to store software programs and various data. The memory 809 can mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area can store an operating system, application programs or instructions required by at least one function (such as a sound playing function, an image playing function, etc.), and the like. In addition, the memory 809 can include a volatile memory or a non-volatile memory, or the memory 809 can include both a volatile memory and a non-volatile memory. The non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch link DRAM (SLDRAM), and a Direct Rambus RAM (DRRAM). The memory 809 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.

[0164] The processor 810 can include one or more processing units; optionally, the processor 810 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and an application program, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 810.

[0165] The embodiments of the present application also provide a readable storage medium, the readable storage medium stores programs or instructions, the programs or instructions are executed by a processor to realize various processes of the above network quality detection method embodiments, and achieve the same technical effects. To avoid repetition, details are not described here.

[0166] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0167] The embodiment of the present application further provides a chip, which comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions to realize the processes of the network quality detection method embodiments and achieve the same technical effects. To avoid repetition, details are not described here.

[0168] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system on chip, a system chip, a chip system or a system on chip, etc.

[0169] The embodiment of the present application provides a computer program product, which is stored in a storage medium, and the program product is executed by at least one processor to realize the processes of the network quality detection method embodiments and achieve the same technical effects. To avoid repetition, details are not described here.

[0170] It should be noted that in this paper, the term "includes", "contains" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to the order of the functions shown or discussed, but can also include the functions performed in a substantially simultaneous manner or in the opposite order according to the functions involved, for example, the described method can be performed in an order different from the described order, and various steps can also be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.

[0171] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned example methods can be realized by means of software and a necessary general hardware platform, and of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product in essence or in the form of a part that contributes to the prior art, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) and includes a plurality of instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application.

[0172] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative and not restrictive. Those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims.

Claims

1. A network quality detection method applied to an electronic device, comprising: obtaining a first quantity corresponding to a transmission rate interval in a first transmission rate range in a first time duration when the electronic device accesses a first network, wherein the first quantity is a number of first data packets with a transmission rate in the transmission rate interval in a first data packet transmitted by the electronic device in the first time duration, the first transmission rate range comprises at least two transmission rate intervals, and the first quantity is one-to-one corresponding to the transmission rate interval; adding the first quantity corresponding to the transmission rate interval to obtain a second quantity; obtaining a first ratio between the first quantity corresponding to the transmission rate interval and the second quantity; determining a network quality of the first network based on the first ratio corresponding to the transmission rate interval.

2. The method of claim 1, wherein, The first data packet is a data packet of a first preset type, or the first data packet is a data packet other than a second preset type, and the second preset type is different from the first preset type.

3. The method of claim 1, wherein, The determining of the network quality of the first network based on the first ratio corresponding to the transmission rate interval comprises: determining a target transmission rate interval from the first transmission rate range, wherein the target transmission rate interval is a transmission rate interval with a first ratio greater than a proportion threshold corresponding to the transmission rate interval; determining the network quality of the first network based on interval information of the target transmission rate interval.

4. The method of claim 3, wherein, Before the determining of the target transmission rate interval from the first transmission rate range, the method further comprises: obtaining a network parameter corresponding to each of N historical time durations, and a second ratio between a third quantity corresponding to the transmission rate interval and a fourth quantity in each of the historical time durations, wherein the third quantity is a number of first data packets with a transmission rate in the transmission rate interval in a first data packet transmitted by the electronic device in the historical time duration, the fourth quantity is a quantity obtained by adding the third quantity corresponding to the transmission rate interval, and N is a positive integer; determining a proportion threshold corresponding to a first transmission rate interval based on a second ratio corresponding to the first transmission rate interval in a target historical time duration; wherein the target historical time duration is a historical time duration in the N historical time durations with a network parameter in a first network parameter interval, the first network parameter interval corresponds to the first transmission rate interval, and the first transmission rate interval is one transmission rate interval in the first transmission rate range. 5.A network quality detection apparatus applied to an electronic device, comprising: a first obtaining module, a first processing module, a second obtaining module, and a second processing module; wherein, The first obtaining module is configured to, in a case where the electronic device accesses a first network, obtain a first quantity corresponding to a transmission rate interval in a first transmission rate range within a first time length, wherein the first quantity is a number of first data packets with a transmission rate in the transmission rate interval in first data packets transmitted by the electronic device within the first time length, the first transmission rate range includes at least two transmission rate intervals, and the first quantity is in one-to-one correspondence with the transmission rate interval. The first processing module is configured to add the first quantity corresponding to the transmission rate interval to obtain a second quantity. The second obtaining module is configured to obtain a first ratio between the first quantity corresponding to the transmission rate interval and the second quantity. The second processing module is configured to determine a network quality of the first network based on the first ratio corresponding to the transmission rate interval.

6. The apparatus of claim 5, wherein, The first data packet is a data packet of a first preset type, or the first data packet is a data packet other than a second preset type, and the second preset type is different from the first preset type.

7. The apparatus of claim 5, wherein, The second processing module is specifically configured to: determine a target transmission rate interval from the first transmission rate range, the target transmission rate interval being a transmission rate interval with the first ratio greater than a proportion threshold corresponding to the transmission rate interval; and determine the network quality of the first network based on interval information of the target transmission rate interval.

8. The apparatus of claim 7, wherein, The second processing module is further configured to: obtain a network parameter corresponding to each historical time length in N historical time lengths and a second ratio between a third quantity corresponding to the transmission rate interval and a fourth quantity within the each historical time length before determining the target transmission rate interval from the first transmission rate range, wherein the third quantity is a number of first data packets with a transmission rate in the transmission rate interval in first data packets transmitted by the electronic device within the historical time length, the fourth quantity is a quantity obtained by adding the third quantity corresponding to the transmission rate interval, and N is a positive integer; and determine a proportion threshold corresponding to the first transmission rate interval based on the second ratio corresponding to the first transmission rate interval within a target historical time length. The target historical time length is a historical time length in the N historical time lengths with a network parameter in a first network parameter interval, the first network parameter interval corresponds to the first transmission rate interval, and the first transmission rate interval is one transmission rate interval in the first transmission rate range.

9. An electronic device, comprising a processor and a memory, the memory storing programs or instructions executable on the processor, and the programs or instructions are executed by the processor to implement the steps of the network quality detection method in any one of claims 1-4.

10. A readable storage medium, the readable storage medium storing programs or instructions, and the programs or instructions are executed by a processor to implement the steps of the network quality detection method in any one of claims 1-4.

Citation Information

Patent Citations

  • Method and device for calculating packet loss rate as well as method and device for controlling network transmission

    CN101964732A

  • Network quality detection method and device, electronic equipment and storage medium

    CN111556345A

  • Network quality detection method and device, electronic equipment and medium

    CN118828670A

  • Network quality estimation method and network quality estimation device

    JP2019050455A

  • Network quality analysis method and system, and electronic device

    WO2024125207A1