Network quality detection method and device, equipment, storage medium and program product
By collecting data from multiple data sources and using time-weighted processing, combined with timed detection and event-triggered network quality assessment methods, the problems of single data source and insufficient accuracy in mobile client network quality detection are solved, achieving more accurate and real-time network quality assessment.
Patent Information
- Application Number
- CN202511890096.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-15
- Publication Date
- 2026-03-03
AI Technical Summary
In mobile client network quality testing, existing technologies suffer from problems such as limited data sources, insufficient accuracy and real-time performance, and are unable to fully reflect complex network conditions.
Network performance data is collected from multiple data sources. By combining timed detection and event triggering, network quality assessment is achieved through time-weighted processing and multi-source weighted scoring.
It improves the accuracy and real-time performance of network quality detection, reduces false positives and system overhead, and can more comprehensively reflect the true quality of the network.
Smart Images

Figure CN121604010A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a network quality testing method, apparatus, device, storage medium, and program product. Background Technology
[0002] Mobile network stability is generally lower than that of traditional wired networks, often experiencing significant network fluctuations within a short period. For example, weak Wi-Fi signals or poor Wi-Fi connection quality can lead to a marked degradation in overall network performance. In certain scenarios, mobile clients need to obtain real-time network quality information and adopt different strategies under varying network conditions to improve application performance and optimize user experience. For this application scenario, the industry has proposed several solutions: The system periodically performs ping tests on the client side (e.g., by detecting packet loss rate and latency) to determine network status (normal / weak / unavailable). When the network is normal, it checks the session connection status; if the session is interrupted, it reconnects. However, this system uses only ping as its data source, resulting in a single data source and poor accuracy and real-time performance.
[0003] On the APP side, network detection is triggered based on preset check conditions. When the conditions are met, a DNS query is performed and a test message (e.g., ping) is sent to the target server. The network is judged to be weak or unavailable based on whether the test fails / times out / packet is lost. This method mainly relies on active data detection, with a single data source and lacks the use of multi-dimensional data.
[0004] By utilizing a large number of client devices to report link / access point observations (such as signal strength, link quality from the client's perspective, etc.) to the network controller, network planning, access, and management can be improved (client-side measurements are used to supplement access point measurements, and aggregation is used for network-side decision-making). This approach focuses on using clients as network measurement points to report to the network side / controller to improve coverage and site selection, rather than performing real-time network quality assessment and low-cost triggering strategies on the client's local machine for individual mobile applications.
[0005] For encrypted transmission protocols (such as QUIC), a method is proposed to infer the data transmission mode from packet header feature parameters and calculate measurement indicators such as RTT and packet loss accordingly, which solves the measurement challenges such as the inability to directly read ACK in encrypted scenarios. This solution focuses on how to extract measurement features from encrypted streams and perform targeted measurements, but does not pay attention to network quality detection on mobile devices. Summary of the Invention
[0006] This application provides a network quality testing method, apparatus, device, storage medium, and program product, which can more comprehensively, accurately, and timely assess network quality.
[0007] The first aspect of this application proposes a network quality detection method, comprising: Collect the original network data corresponding to the target network. The original network data includes the original data corresponding to each data source in the data source set. The data source set includes N network performance data sources and network type data sources. The original data corresponding to the network type data source includes whether there is a network and the network type. N is an integer greater than or equal to 1. Determine whether the target network meets the triggering conditions for network quality assessment, wherein the triggering conditions include at least one of timed triggering, network change triggering, and active triggering; If the target network meets the triggering condition, then calculate the network quality score for each data source in the data source set based on the original network data; The overall network quality score of the target network is determined based on the network quality score of each data source. The network quality level of the target network is determined based on the comprehensive network quality score.
[0008] Optionally, determining the overall network quality score of the target network based on the network quality score of each data source includes: The overall network quality score of the target network is determined using the following formula:
[0009] in, The overall network quality score is as follows. For each of the data sources, the weight value is... A network quality score is assigned to each of the data sources.
[0010] Optionally, calculating the network quality score for each data source in the data source set based on the raw network data includes: Determine the time weight of each target data in the first data source, where the first data source is any one of the N network performance data sources; Determine the data type corresponding to the first data source, wherein the data type includes value type and success rate type; Calculate the network quality score for each of the N network performance data sources based on the data type and the time weight of each target data source. The network quality score corresponding to the network type data source is determined based on the original network data corresponding to the network type data source.
[0011] Optionally, determining the time weight of each target data in the first data source includes: The time weight of each target data point is determined using the following formula:
[0012] in, Assigning a time weight to each of the target data points. This is the difference between the current time and the timestamp corresponding to each of the target data. It is the half-life.
[0013] Optionally, calculating the network quality score of each of the N network performance data sources based on the data type and the time weight of each target data source includes: A time-weighted value is determined based on the time weight of each target data and the data type, wherein the time-weighted value includes a time-weighted median or a time-weighted average. The time-weighted value is compared with the configuration threshold corresponding to the first data source to determine the initial network quality level of the first data source; The network quality score of each of the N network performance data sources is determined based on the initial network quality level of the first data source.
[0014] Optionally, the method further includes: Determine the network quality threshold and access interface type for each of the N network performance data sources; Based on the network quality threshold and the access interface type, a corresponding general interface is registered for each of the N network performance data sources; The collection of raw network data corresponding to the target network includes: The raw network data corresponding to each of the N network performance data sources is collected through the general interface.
[0015] Optionally, the step of determining whether the target network meets the triggering conditions for network quality assessment includes: Determine whether the time interval set in the timed event has been reached; if so, determine that the target network meets the triggering condition. or, Determine whether the network state of the target network has changed; if so, determine that the target network meets the triggering condition. or, Determine whether the sum of the effective data volume corresponding to each of the N network performance data sources reaches the data volume threshold. If so, determine that the target network meets the triggering condition. or, Traverse each of the N network performance data sources to determine the initial classification of the network data of the second data source at each of the multiple collection times, wherein the second data source is any one of the N network performance data sources. If the initial grade of the second data source is the same in M consecutive acquisition times, and the same initial grade does not match the current network quality level of the target network, then the second data source is marked as a trigger data source, and the current network quality level of the target network is the network quality level obtained in the last quality assessment of the target network. If the number of triggering data sources among the N network performance data sources reaches the triggering threshold, then the target network is determined to meet the triggering condition.
[0016] A second aspect of this application provides a network quality detection device, comprising: The acquisition module is used to acquire the original network data corresponding to the target network. The original network data includes the original data corresponding to each data source in the data source set. The data source set includes N network performance data sources and network type data sources. The original data corresponding to the network type data source includes whether there is a network and the network type. The judgment module is used to determine whether the target network meets the triggering conditions for network quality assessment. The triggering conditions include at least one of timed triggering, network change triggering, and active triggering. The calculation module is used to calculate the network quality score of each data source in the data source set based on the original network data when the target network meets the triggering condition. The determination module is used to determine the overall network quality score of the target network based on the network quality score of each data source. The detection module is used to determine the network quality level of the target network based on the comprehensive network quality score.
[0017] A third aspect of this application provides a network quality testing device, comprising: processor; Memory, used to store computer programs; The processor executes the computer program to implement the network quality detection method described in any of the above embodiments.
[0018] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the network quality detection method described in any of the above embodiments.
[0019] The fifth aspect of this application provides a computer program product, comprising a computer program that, when executed by a processor, implements the network quality detection method described in any of the above embodiments. In the embodiments provided in this application, different types of network performance data are collected from multiple data sources, which can effectively avoid the problem that a single indicator detection cannot fully reflect the complex network state; the network performance data is time-weighted within a time window, and the real-time performance and accuracy of network quality detection are improved by multi-source weighted scoring and threshold determination; by combining timed detection and event triggering, and introducing a judgment mechanism that combines continuous difference data in the data stream and multiple data source comprehensive triggering, the misjudgment and system overhead are effectively reduced while ensuring the real-time performance of detection. Attached Figure Description
[0020] Figure 1 A system architecture diagram of a network quality detection system provided in an embodiment of this application; Figure 2 A schematic flowchart illustrating a network quality detection method provided in an embodiment of this application; Figure 3 A schematic diagram of a data acquisition process provided in an embodiment of this application; Figure 4 A schematic diagram of a network quality detection device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application; The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0022] Those skilled in the art will understand that, unless explicitly stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in the specification of this application means the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when an element is “connected” or “coupled” to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein may include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any modules and all combinations of one or more associated listed items.
[0023] Those skilled in the art will understand that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0024] For ease of understanding, the following is a description of the specialized terms used in this application: RTT: Short for Round-Trip Time, it refers to the time it takes for a data packet to travel from the sender to the receiver and back. This application involves several types of RTT, including Transport RTT (Transport Layer RTT), which refers to the round-trip time of the transport layer in an HTTP request, that is, the RTT measured in transport layer protocols such as TCP; HTTP RTT, which refers to the round-trip time in the HTTP request-response process; persistent connection RTT, which refers to the round-trip time of a single protocol request and response in a persistent connection; and Ping RTT, which refers to the round-trip time measured using Ping (ICMP).
[0025] Packet loss rate: refers to the proportion of lost data packets to the total number of data packets sent during network transmission. The media packet loss rate mentioned in this application refers to the packet loss rate measured in the data transmission of media (audio, video, etc.).
[0026] Network type: refers to the type of network connection, mainly divided into mobile networks and Wi-Fi networks. Mobile networks can be further divided into 2G, 3G, 4G, 5G, etc.
[0027] Long-lived connections: These are network connections that are maintained for a long time in the background to improve communication efficiency. They can be TCP connections, etc.
[0028] Ping: A commonly used network testing method, mainly used to detect network reachability and measure RTT (Round Trip Time) and packet loss rate.
[0029] OKHTTP: A third-party developed HTTP client library, typically used for client-side HTTP requests.
[0030] Please see Figure 1 , Figure 1 This is a system architecture diagram of the network quality detection system provided in this application embodiment. The network quality detection system includes three parts: data acquisition, network quality assessment, and calculation triggering. Data acquisition includes collecting passive data (transport layer RTT, HTTP RTT, long connection RTT, media packet loss rate, etc.) and active probing data (Ping RTT, Ping success rate, etc.), supporting multiple data source types and being able to expand to more data sources. Network quality assessment uses a specific algorithm to comprehensively calculate a network quality score based on the currently collected data and provides a graded network quality (no network / weak network / normal network / high-quality network). Calculation triggering includes timed triggering, network change triggering, and active triggering, used to assess the changing trend of network quality in real time and at low cost, and to trigger network quality calculation.
[0031] The network quality detection method provided in this application embodiment will be described below from the perspective of a network quality detection device, referring to... Figure 2 , Figure 2 This is a flowchart illustrating a network quality detection method provided in an embodiment of this application. The method includes: S201. Collect the original network data corresponding to the target network.
[0032] In this embodiment, the network quality detection device can collect raw network data corresponding to the target network. This raw network data includes raw data corresponding to each data source in the data source set. The data source set includes two types of data sources: network performance data sources and network type data sources. The network quality detection device collects network performance data corresponding to the target network through the network performance data source and network type data corresponding to the target network through the network type data source. The network performance data includes, but is not limited to, transport layer RTT data, HTTP RTT data, long connection RTT data, media packet loss rate, and active ping probe data. The network type data includes whether there is a network and the network type. No network corresponds to a network-less state, and 2G network is defined as a weak network. The following is combined Figure 3 Please provide a detailed explanation. Figure 3This is a schematic diagram illustrating the data acquisition process provided in an embodiment of this application. In this application, different data is collected through different data interfaces. The server can determine the network quality threshold and access interface type (e.g., ...) for each of the N network performance data sources to be collected. Figure 3 The document describes three types of interfaces (RTT, packet loss rate, and success rate), and registers corresponding general interfaces for each data source based on network quality thresholds and access interface types. Finally, it collects network performance data corresponding to each network performance data source through the registered general interfaces. The details are as follows: Transport layer RTT: Data is collected through the callback interface provided by OKHTTP, and the result is calculated according to the following formula: TransportRTT = connectEnd - connectStart - (secureConnectionEnd -secureConnectionStart) connectEnd: Connection termination callback time connectStart: Connection start callback time secureConnectionEnd: HTTPS handshake end time secureConnectionStart: HTTPS handshake start time HTTPRTT: Data is collected via the callback interface provided by OKHTTP, and the result is calculated according to the following formula. HttpRTT = responseHeadersStart – requestHeadersStart responseHeadersStart: The time when a Header response was received. requestHeadersStart: The time when the header was sent. Long-lived connection RTT: The time is recorded when a single protocol is sent and when a reply is received, and the round-trip time is calculated.
[0033] Media packet loss rate: The rate of packet loss during media transmission.
[0034] Active Ping: Periodically send Ping protocol data to the backend server. The time from sending the Ping to receiving the response is calculated as Ping RTT. The success rate of Ping is calculated within a certain period of time.
[0035] It should be noted that the network performance data collected by each network performance data source is stored in an independent data queue. The network performance data in the data queue is sorted by time and limited to a certain time window. Expired network performance data is discarded in a timely manner to avoid consuming too much memory. In addition to using metrics such as transport layer RTT, HTTP RTT, long connection RTT, and media packet loss rate, these N network performance data sources can also use supplementary or alternative metrics such as DNS resolution time, TLS / QUIC handshake time, TCP retransmission count, signaling failure rate, and bandwidth estimation. In specific business scenarios, application layer statistics (such as video stuttering rate and audio jitter buffering rate) can also be used as a passive network performance data source for weak network detection.
[0036] Therefore, this approach not only utilizes system interface information (such as network connection status and network type) but also incorporates multiple active and passive data sources, including transport layer RTT, HTTP RTT, long-connection message round-trip latency, media packet loss rate, and active ping. Active ping is considered an active network performance data source, while the other data sources are passive. This comprehensive evaluation of multi-source information allows for a complete and accurate reflection of the true network quality, avoiding the bias associated with a single data source.
[0037] S202. Determine whether the target network meets the triggering conditions for network quality assessment. If so, proceed to step S203.
[0038] Network quality assessment involves calculations from multiple data sources, which consumes system resources. To address this issue, this application employs a combination of timed triggering, network change triggering, and proactive triggering. Through lightweight data stream monitoring, a reassessment is proactively triggered when there is a high probability of network quality changes. The following is a detailed explanation of these three triggering methods: 1. Timed trigger: Determine whether the time interval set in the timed event has been reached. If so, determine that the target network meets the triggering conditions for network quality assessment. The logic of timed triggering is to trigger a network quality assessment every set time interval and record the assessment results. For example, a specific time interval can be set through a timer to trigger a network quality assessment every set time interval.
[0039] 2. Triggered by network changes: Determine whether the network status of the target network has changed. If so, determine whether the target network meets the triggering conditions for network quality assessment. The network quality detection device triggers a re-evaluation of network quality after a certain delay following changes in the network.
[0040] 3. Active triggering: Determine whether the sum of the effective data volume corresponding to each of the N network performance data sources reaches the data volume threshold. If so, determine that the target network meets the triggering condition. or, Iterate through each of the N network performance data sources to determine the initial classification of the network data of the second data source at each of the multiple collection times. The second data source is any one of the N network performance data sources. If the initial grade of the second data source is the same in M consecutive acquisition times, and the same initial grade does not match the current network quality level of the target network, then the second data source is marked as the trigger data source, and the current network quality level of the target network is the network quality level obtained in the last quality assessment of the target network. If the number of triggering data sources among the N network performance data sources reaches the trigger threshold, then the target network is determined to meet the triggering conditions.
[0041] In other words, when the client first starts up, there is not enough data, so there is no need to perform a network quality assessment at this time, and there is no network quality assessment result. In order to quickly trigger the assessment when there is enough data, the effective data volume of each network performance data source will be recorded here (the effective data volume refers to the sum of data corresponding to the network performance data source that can truly, reliably, and interpretably reflect the current performance status of the target network). The dimensions for whether the assessment data is valid include, but are not limited to, data integrity, data quality, and data timeliness, which are explained below: Regarding data integrity, the collected data is complete and undamaged. If a data packet is lost or damaged in transmission, then the data packet is not valid data; Regarding data quality, for example, network latency data may be due to an occasional system lag rather than the network state itself, then the data is not valid data; Regarding data timeliness, the data used for assessment must have sufficient timeliness, that is, a time window will be set for the collected data, and only data within this time window will be used by the user to assess the current network quality). When the threshold of effective data volume is reached, the network quality assessment is actively triggered to obtain the current network quality level in a timely manner (that is, the active triggering here is the network quality level assessment performed when the client first starts up).
[0042] Simultaneously, the data streams of each network performance data source are monitored, and each data point in the data stream is simply graded (for example, multiple initial grade thresholds can be set, and after collecting the values of each data point, the collected values are compared with the set thresholds to determine the initial grade corresponding to a single data point). The number of consecutive identical initial grades for each network performance data source is recorded. If the number of consecutive identical initial grades for a certain network performance data source exceeds a threshold (such as M times as mentioned above, where the value of M can be set based on experience), it is determined whether the consecutive identical initial grades are the same as the current network quality level of the target network (the current network quality level of the target network is the network quality level obtained from the previous network quality test of the target network). If they are the same, it means that the grading result for this network performance data source is likely consistent with the current network quality level of the target network, so the triggering of another network quality test for the target network is canceled. If they are different, it means that the grading result for this network performance data source is likely inconsistent with the current network quality level of the target network, so this network performance data source is marked as a trigger data source. And so on, when the number of trigger data sources among N network performance data sources reaches the trigger threshold, a network quality test for the target network is triggered.
[0043] It should be noted that if the target network meets the triggering conditions, the network quality level obtained through subsequent network quality inspection will serve as a criterion for determining whether to trigger a network quality inspection of the target network in the next instance. Additionally, if the target network's current network quality level did not exist previously (meaning no network quality inspection was performed before the current time), this is also a state where no network quality level existed previously. The initial assessment will compare this state with the current state, and the evaluation result from the network performance data source will certainly differ from this state, thus triggering a network quality inspection of the target network.
[0044] S203. If the target network meets the triggering conditions, calculate the network quality score of each data source in the data source set based on the original network data.
[0045] In this embodiment, the network quality detection device, after determining that the target network meets the network quality assessment trigger event, can calculate the network quality score of each data source in the data source set based on the original network data. The details are as follows: The network quality testing device calculates a network quality score for each data source in the data source set based on the raw network data, including: Step 1: Determine the time weight of each target data in the first data source. The first data source is any one of the N network performance data sources. In this step, considering the time sensitivity of network quality, each data point is time-weighted during the calculation. Specifically, the time weight of each target data point from the N network performance data sources is determined using the following formula:
[0046] in, Time weights for each target data point, This is the difference between the current time and the timestamp corresponding to each target data point. The half-life is used; for example, with a half-life of 60 seconds, the weight decays by half approximately every 60 seconds. Each target data point refers to a single network performance data point collected from the first data source, that is, the raw performance value collected by the first data source at a specific timestamp. For example, for a transport layer RTT data source, a target data point is a TCP round-trip latency value (e.g., 50ms); for a media packet loss rate data source, a target data point is a packet loss rate percentage (e.g., 2%); for an active Ping data source, a target data point is a Ping success rate (e.g., 1 for success, 0 for failure).
[0047] Step 2: Determine the data type corresponding to the first data source. The data type includes value type and success rate type.
[0048] In this step, the data type of the first data source is determined. This data type includes value type and success rate type. The value type includes RTT (RTT includes traditional layer RTT data, HTTP RTT data, and long connection RTT data), and the success rate type includes packet loss rate and active ping probe data.
[0049] It should be noted that the network quality detection device can determine the time weight of each target data through step 1 and determine the data type corresponding to the first data source through step 2. However, there is no restriction on the order of execution between these two steps. Step 1 can be executed first, or Step 2 can be executed first, or they can be executed simultaneously. There is no specific limitation.
[0050] Step 3: Calculate the network quality score for each of the N network performance data sources based on the data type and the time weight of each target data.
[0051] In this step, the network quality detection device determines a time-weighted value based on the time weight and data type of each target data point. The time-weighted value includes either the time-weighted median or the time-weighted average. This time-weighted value is then compared with the configured threshold corresponding to the first data source to determine the initial network quality level of the first data source. Finally, based on the initial network quality level of the first data source, a network quality score is determined for each network performance data source. The details are explained below: 1) Value-based network performance data sources: The time-weighted median of all data from each network performance data source is calculated using the formula described above. Calculate the time weight of each data point and sum them up to get the total weight. Then, sort all data in the current data source in ascending order and sum the data weight values in ascending order. When the summed weight value reaches 50% of the total weight, this data is the time-weighted median value. 2) Success rate-based network performance data sources: For network performance data sources based on success rates (such as Ping success rate), the data essentially represents binary events (usually quantified as 1 and 0) that indicate the success or failure of network requests. The statistical goal is not to find a typical value that is resistant to disturbances, but rather to calculate the proportion or frequency of successful events occurring within a certain time window. An arithmetic mean can be used. Furthermore, to further improve real-time performance, time weighting is introduced, assigning each data point a weight that decreases over time, making the calculation results more focused on recent data. Therefore, using a time-weighted average can accurately capture the real-time trends in network quality. Specifically: Through the above formula Calculate the time weight of each data point, sum them up to get the total weight, then sum the weight values of all successful data points and divide by the total weight to get the time-weighted average. Next, the obtained time-weighted value is compared with the threshold configured when registering the data source to determine the initial network quality level of the data source. Then, based on this initial network quality level, a network quality score is determined for each data source. That is, a threshold is configured when registering the data source; this threshold is the initial network quality level. Here, the initial network quality level is defined as three levels: weak network, normal network, and high-quality network, and a score is defined for each initial network quality level (e.g., a score of 0 for weak network, 1 for normal network, and 2 for high-quality network). After determining the time-weighted value, it is compared with the threshold configured for the data source to determine the initial network quality level of the current network defined by the data source, and the network quality score of the data source is determined based on the score of the defined initial network quality level. It is understandable that a score threshold can also be directly configured when registering the data source; after determining the time-weighted value, the time-weighted value is directly compared with the configured score threshold to determine the network quality score of the data source.
[0052] It should be noted that the trigger period is defined as the period between the last evaluation of the target network's network quality level and the current trigger evaluation of the target network's network quality level. Correspondingly, the collected network performance data is also the network performance data collected within this trigger period. In addition to the time-weighted median and time-weighted average, other values can also be used, such as exponentially weighted moving average (EWMA), quantile statistics, and sliding window extreme value filtering, which can still suppress the influence of outliers and ensure real-time detection. Furthermore, other weight values, such as network signal strength weight, can be added to increase accuracy across different types of devices.
[0053] In addition to combining timed and event-triggered methods, triggering can also be dynamically based on terminal power consumption status (such as reducing the detection frequency when the battery is low), user behavior (such as increasing the detection frequency when entering a real-time audio or video call), or network interface signal strength fluctuations (such as triggering when Wi-Fi RSSI / cellular signal strength drops sharply).
[0054] Step 4: Determine the network quality score corresponding to the network type data source based on the original network data.
[0055] In this step, after collecting the raw network data corresponding to the network type data source, the network quality detection device can determine whether the target network exists based on the raw network data. If there is no network, the process ends directly without further calculation. If there is a network, it determines whether the network quality of the target network is better than that of the 2G network. If it is not better than the 2G network, the network quality score of that network type data source is defined as 0. If it is better than the 2G network, the network quality score of the network type data source is ignored. In other words, the network quality score of the network type data source will only be considered when the network quality of the target network is not better than that of the 2G network in subsequent steps when determining the overall network quality score based on the network quality scores of each data source. When the network quality of the target network is better than that of the 2G network, the network type data source has no network quality score, and the network type dimension will not be considered when calculating the overall network quality score. Only the network quality scores of N network performance data sources are used to determine the overall network quality score.
[0056] It should be noted that network quality testing devices can determine whether the network quality of a target network is superior to that of a 2G network using various methods. For example, they can compare the download speeds of the target and 2G networks, perform latency tests (using the Ping command to test the latency from the target and 2G networks to a common server), and conduct jitter tests. Other methods can also be used, such as opening the same content-rich webpage on both the target and 2G networks and simultaneously playing a short video in standard or high definition. Different weights can be assigned to these various test methods to comprehensively assess the network quality of the target and 2G networks. The specific methods are not limited, as long as they can determine the network quality of the target and 2G networks. Furthermore, to avoid network fluctuations, multiple tests at multiple points can be conducted to comprehensively assess the network quality of the target and 2G networks.
[0057] It should also be noted that the network quality detection device can calculate the network quality score of each of the N network performance data sources in step 3, and determine the network quality score corresponding to the network type data source in step 4. However, there is no restriction on the order of execution between these two steps. Step 3 can be executed first, or step 4 can be executed first, or they can be executed simultaneously. There is no specific limitation.
[0058] S204. Determine the overall network quality score of the target network based on the network quality score of each data source.
[0059] In this embodiment, after determining the network quality score of each data source in the data source set, the overall network quality score of the target network can be determined based on the network quality score of each data source in the data source set. Specifically, the overall network quality score of the target network can be determined using the following formula:
[0060] in, The overall network quality score, The weight value for each data source in the data source set. This represents the network quality score for each data source in the data source set.
[0061] For example, if all data sources are weak networks, the score is 0; if all data sources are high-quality networks, the score is 100. Depending on the scores of different data sources, the final score will be between 0 and 100. The higher the score, the better the network quality.
[0062] It should be noted that the weight value of each data source can be predefined based on historical experience, or it can be defined based on the importance of each data source in the data source set. The importance of each data source in this data source set can be adaptively adjusted for different projects and application scenarios. For example, the weight of long-connection RTT will be increased for instant messaging applications because it directly affects the message delivery speed; the weight of media packet loss rate and media RTT will be increased for audio and video applications because they have a decisive impact on user experience; and the weight of HTTP RTT will be increased for ordinary web browsing, as HTTP RTT is a key indicator. Of course, other methods can also be used to determine the weight value of each data source in the data source set, and there are no specific limitations.
[0063] S205. Determine the network quality level of the target network based on the comprehensive network quality score.
[0064] In this embodiment, after determining the overall network quality score, the overall network quality score can be compared with a set threshold to obtain the final network quality level. That is, the correspondence between score ranges and multiple network quality levels can be set in advance. For example, five network quality levels can be set, from one star to five stars. Different network quality levels correspond to different score ranges. For example, a score of 80 to 100 corresponds to a five-star network quality level. After determining the overall network quality score of the target network, the range in which the overall network quality score falls can be directly determined to determine the network quality level of the target network.
[0065] In summary, the embodiments provided in this application not only utilize system interface information (such as network connection status and network type) but also combine multiple active and passive data sources, including transport layer RTT, HTTP RTT, long connection message round-trip latency, media packet loss rate, and active Ping, to comprehensively and accurately reflect the true network quality through multi-source information evaluation, avoiding the bias caused by a single data source. Furthermore, by using a time-weighted median rather than a simple average within a certain time window, the detection results are more robust and real-time, enabling faster perception of network quality changes and reducing the impact of instantaneous jitter on the judgment. By weighting and scoring the results from each data source to form an overall network quality score, the network quality status can be determined based on a set score threshold, avoiding misjudgment by a single indicator and improving the accuracy and stability of network quality detection. The strategy of combining timed detection with event triggering ensures the continuity of detection through periodic calculations and immediately triggers detection in the event of network switching or changes in network quality, thereby improving the real-time performance of the judgment without significantly increasing resource consumption.
[0066] The embodiments of this application have been described above from the perspective of network quality detection methods. The embodiments of this application will now be described below from the perspective of network quality detection devices.
[0067] Please see Figure 4 , Figure 4 This is a virtual structural diagram of a network quality detection device 400 provided in this application. The network quality detection device 400 includes: The acquisition module 401 is used to acquire the original network data corresponding to the target network. The original network data includes the original data corresponding to each data source in the data source set. The data source set includes N network performance data sources and network type data sources. The original data corresponding to the network type data source includes whether there is a network and the network type. N is an integer greater than or equal to 1. The judgment module 402 is used to determine whether the target network meets the triggering conditions for network quality assessment. The triggering conditions include at least one of timed triggering, network change triggering, and active triggering. Calculation module 403 is used to calculate the network quality score of each data source in the data source set based on the original network data when the target network meets the triggering condition; The determination module 404 is used to determine the overall network quality score of the target network based on the network quality score of each data source. The detection module 405 is used to determine the network quality level of the target network based on the comprehensive network quality score.
[0068] Optionally, the determining module 404 is specifically used for: The overall network quality score of the target network is determined using the following formula:
[0069] in, The overall network quality score is as follows. For each of the data sources, the weight value is... A network quality score is assigned to each of the data sources.
[0070] Optionally, the calculation module 403 is specifically used for: Determine the time weight of each target data in the first data source, where the first data source is any one of the N network performance data sources; Determine the data type corresponding to the first data source, wherein the data type includes value type and success rate type; Calculate the network quality score for each of the N network performance data sources based on the data type and the time weight of each target data source. The network quality score corresponding to the network type data source is determined based on the original network data corresponding to the network type data source.
[0071] Optionally, the calculation module 403 determines the time weight of each target data in the first data source by including: The time weight of each target data point is determined using the following formula:
[0072] in, Assigning a time weight to each of the target data points. This is the difference between the current time and the timestamp corresponding to each of the target data. It is the half-life.
[0073] Optionally, the calculation module 403 calculates the network quality score of each of the N network performance data sources based on the data type and the time weight of each target data source, including: A time-weighted value is determined based on the time weight of each target data and the data type, wherein the time-weighted value includes a time-weighted median or a time-weighted average. The time-weighted value is compared with the configuration threshold corresponding to the first data source to determine the initial network quality level of the first data source; The network quality score of each of the N network performance data sources is determined based on the initial network quality level of the first data source.
[0074] Optionally, the acquisition module 401 is specifically used for: Determine the network quality threshold and access interface type for each of the N network performance data sources; Based on the network quality threshold and the access interface type, a corresponding general interface is registered for each of the N network performance data sources; The raw network data corresponding to each of the N network performance data sources is collected through the general interface.
[0075] Optionally, the determination module 402 is specifically used for: Determine whether the time interval set in the timed event has been reached; if so, determine that the target network meets the triggering condition. or, Determine whether the network state of the target network has changed; if so, determine that the target network meets the triggering condition. or, Determine whether the sum of the effective data volume corresponding to each of the N network performance data sources reaches the data volume threshold. If so, determine that the target network meets the triggering condition. or, Traverse each of the N network performance data sources to determine the initial classification of the network data of the second data source at each of the multiple collection times, wherein the second data source is any one of the N network performance data sources. If the initial grade of the second data source is the same in M consecutive acquisition times, and the same initial grade does not match the current network quality level of the target network, then the second data source is marked as a trigger data source, and the current network quality level of the target network is the network quality level obtained in the last quality assessment of the target network. If the number of triggering data sources among the N network performance data sources reaches the triggering threshold, then the target network is determined to meet the triggering condition.
[0076] Reference Figure 5 This application also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 5 As shown. The computer device includes a processor, memory, network interface, and database connected via a bus. The processor is designed to provide computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores operations, computer programs, and a database. The internal memory provides an environment for the operation of the operations and computer programs stored in the non-volatile storage medium. The database stores data such as network quality detection methods. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps of a network quality detection method, which includes: Collect the original network data corresponding to the target network. The original network data includes the original data corresponding to each data source in the data source set. The data source set includes N network performance data sources and network type data sources. The original data corresponding to the network type data source includes whether there is a network and the network type. N is an integer greater than or equal to 1. Determine whether the target network meets the triggering conditions for network quality assessment, wherein the triggering conditions include at least one of timed triggering, network change triggering, and active triggering; If the target network meets the triggering condition, then calculate the network quality score for each data source in the data source set based on the original network data; The overall network quality score of the target network is determined based on the network quality score of each data source. The network quality level of the target network is determined based on the comprehensive network quality score.
[0077] One embodiment of this application also provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a network quality detection method, which includes: Collect the original network data corresponding to the target network. The original network data includes the original data corresponding to each data source in the data source set. The data source set includes N network performance data sources and network type data sources. The original data corresponding to the network type data source includes whether there is a network and the network type. N is an integer greater than or equal to 1. Determine whether the target network meets the triggering conditions for network quality assessment, wherein the triggering conditions include at least one of timed triggering, network change triggering, and active triggering; If the target network meets the triggering condition, then calculate the network quality score for each data source in the data source set based on the original network data; The overall network quality score of the target network is determined based on the network quality score of each data source. The network quality level of the target network is determined based on the comprehensive network quality score.
[0078] In some possible implementations, various aspects of the methods provided in this application can also be implemented as a program product, which can be implemented using any combination of one or more readable media. The program product includes program code that, when run on a computer device, is configured to cause the computer device to perform the steps of the methods described above according to various exemplary embodiments of this application. The computer device can execute the network quality detection method described in the embodiments of this application, which includes: Collect the original network data corresponding to the target network. The original network data includes the original data corresponding to each data source in the data source set. The data source set includes N network performance data sources and network type data sources. The original data corresponding to the network type data source includes whether there is a network and the network type. N is an integer greater than or equal to 1. Determine whether the target network meets the triggering conditions for network quality assessment, wherein the triggering conditions include at least one of timed triggering, network change triggering, and active triggering; If the target network meets the triggering condition, then calculate the network quality score for each data source in the data source set based on the original network data; The overall network quality score of the target network is determined based on the network quality score of each data source. The network quality level of the target network is determined based on the comprehensive network quality score.
[0079] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media provided in this application and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0080] The above description is only a preferred embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural changes made based on the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A network quality detection method, characterized in that, include: Collect raw network data corresponding to the target network. The raw network data includes the raw data corresponding to each data source in the data source set. The data source set includes N network performance data sources and network type data sources. The raw data corresponding to the network type data source includes whether there is a network and the network type. N is an integer greater than or equal to 1. Determine whether the target network meets the triggering conditions for network quality assessment, wherein the triggering conditions include at least one of timed triggering, network change triggering, and active triggering; If the target network meets the triggering condition, then calculate the network quality score for each data source in the data source set based on the original network data; The overall network quality score of the target network is determined based on the network quality score of each data source. The network quality level of the target network is determined based on the comprehensive network quality score.
2. The method according to claim 1, characterized in that, The step of determining the overall network quality score of the target network based on the network quality score of each data source includes: The overall network quality score of the target network is determined using the following formula: in, The overall network quality score is as follows. For each of the data sources, the weight value is... A network quality score is assigned to each of the data sources.
3. The method according to claim 1, characterized in that, The calculation of the network quality score for each data source in the data source set based on the raw network data includes: Determine the time weight of each target data in the first data source, where the first data source is any one of the N network performance data sources; Determine the data type corresponding to the first data source, wherein the data type includes value type and success rate type; Calculate the network quality score for each of the N network performance data sources based on the data type and the time weight of each target data source. The network quality score corresponding to the network type data source is determined based on the original network data corresponding to the network type data source.
4. The method according to claim 3, characterized in that, The determination of the time weight for each target data in the first data source includes: The time weight of each target data point is determined using the following formula: in, Assigning a time weight to each of the target data points. This is the difference between the current time and the timestamp corresponding to each of the target data. It is the half-life.
5. The method according to claim 3, characterized in that, The calculation of the network quality score for each of the N network performance data sources based on the data type and the time weight of each target data source includes: A time-weighted value is determined based on the time weight of each target data and the data type, wherein the time-weighted value includes a time-weighted median or a time-weighted average. The time-weighted value is compared with the configuration threshold corresponding to the first data source to determine the initial network quality level of the first data source; The network quality score of each of the N network performance data sources is determined based on the initial network quality level of the first data source.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: Determine the network quality threshold and access interface type for each of the N network performance data sources; Based on the network quality threshold and the access interface type, a corresponding general interface is registered for each of the N network performance data sources; The collection of raw network data corresponding to the target network includes: The raw network data corresponding to each of the N network performance data sources is collected through the general interface.
7. The method according to any one of claims 1 to 5, characterized in that, The triggering conditions for determining whether the target network meets the network quality assessment include: Determine whether the time interval set in the timed event has been reached; if so, determine that the target network meets the triggering condition. or, Determine whether the network state of the target network has changed; if so, determine that the target network meets the triggering condition. or, Determine whether the sum of the effective data volume corresponding to each of the N network performance data sources reaches the data volume threshold. If so, determine that the target network meets the triggering condition. or, Traverse each of the N network performance data sources to determine the initial classification of the network data of the second data source at each of the multiple collection times, wherein the second data source is any one of the N network performance data sources. If the initial grade of the second data source is the same in M consecutive acquisition times, and the same initial grade does not match the current network quality level of the target network, then the second data source is marked as a trigger data source, and the current network quality level of the target network is the network quality level obtained in the last quality assessment of the target network. If the number of triggering data sources among the N network performance data sources reaches the triggering threshold, then the target network is determined to meet the triggering condition.
8. A network quality detection device, characterized in that, include: The acquisition module is used to acquire the original network data corresponding to the target network. The original network data includes the original data corresponding to each data source in the data source set. The data source set includes N network performance data sources and network type data sources. The original data corresponding to the network type data source includes whether there is a network and the network type. N is an integer greater than or equal to 1. The judgment module is used to determine whether the target network meets the triggering conditions for network quality assessment. The triggering conditions include at least one of timed triggering, network change triggering, and active triggering. The calculation module is used to calculate the network quality score of each data source in the data source set based on the original network data when the target network meets the triggering condition. The determination module is used to determine the overall network quality score of the target network based on the network quality score of each data source. The detection module is used to determine the network quality level of the target network based on the comprehensive network quality score.
9. A network quality testing device, characterized in that, include: processor; Memory, used to store computer programs; The processor executes the computer program to implement the network quality detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the network quality detection method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the network quality detection method according to any one of claims 1 to 7.