Network speed prediction method and device, equipment and storage medium
By using a hybrid architecture of physical formulas, public network speed prediction models, and local network speed prediction models, the problem of low accuracy in network speed prediction during the cold start phase is solved, achieving full lifecycle network speed prediction coverage and high-precision prediction.
Patent Information
- Application Number
- CN202511113224.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-08
- Publication Date
- 2025-11-21
AI Technical Summary
In existing technologies, network speed prediction has low accuracy in the cold start phase due to the lack of historical data, and single supervised models fail to predict when the data distribution is uniform or when the network environment changes abruptly.
It adopts a three-layer switching architecture of physical formula, public network speed prediction model and local network speed prediction model. The physical formula solves the prediction gap in the cold start stage, the public network speed prediction model ensures basic prediction accuracy during the data accumulation period, and high-precision prediction is achieved when there is enough local training sample data.
It achieves continuous network speed prediction from cold start to the entire lifecycle, improves prediction accuracy during the cold start phase, and enhances adaptability when the network environment changes drastically.
Smart Images

Figure CN121000643A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and storage medium for predicting network speed. Background Technology
[0002] As mobile internet expands into multiple fields, the load and dynamism of network environments are growing exponentially. Network speed prediction is not only the core basis for achieving intelligent scheduling and load balancing of network resources, but also a key support for early warning of congestion faults and optimization of operation and maintenance efficiency.
[0003] In existing technologies, internet speed testing is conducted using supervised models. However, sufficient training data needs to be collected before the supervised model can be started for real-time speed testing, resulting in low prediction accuracy during the cold start phase. Summary of the Invention
[0004] This application provides a network speed prediction method, apparatus, device, and storage medium to improve the prediction accuracy during the cold start phase.
[0005] In a first aspect, embodiments of this application provide a network speed prediction method applied to a client device, comprising: acquiring the current network characteristic parameters and the amount of local training sample data of the device under test, wherein the amount of local training sample data is the number of locally cached network speed sample data; determining whether the amount of local training sample data is greater than a preset threshold; if the amount of local training sample data is greater than the preset threshold, then inputting the current network characteristic parameters into a pre-trained local network speed prediction model to output the network speed prediction result of the device under test; if the amount of local training sample data is less than or equal to the preset threshold, then further determining whether the device under test has loaded the public network speed prediction model of the server device; if the device under test has loaded the public network speed prediction model, then inputting the current network characteristic parameters into the public network speed prediction model to output the network speed prediction result of the device under test; if the device under test has not loaded the public network speed prediction model, then calculating the network speed prediction result of the device under test based on the current network characteristic parameters.
[0006] In one possible implementation, the training process of the local network speed prediction model includes: real-time collection of locally cached network speed sample data, and determination of whether the network speed sample data meets preset quality conditions; if the network speed sample data meets the preset quality conditions, the network speed sample data is saved; when the number of saved network speed sample data reaches a preset training quantity threshold, the saved network speed sample data is used as the training dataset to iteratively train the current local network speed prediction model to obtain an updated local network speed prediction model.
[0007] In one possible implementation, after obtaining the updated local network speed prediction model, the method further includes: acquiring model parameters of the local network speed prediction model according to a preset period; adding noise to the model parameters to generate encrypted model parameters; sending the encrypted model parameters and the number of saved network speed sample data to the server device, so that the server device aggregates the encrypted model parameters sent by each client device based on the federated averaging algorithm and the number of saved network speed sample data to generate global model parameters; receiving the global model parameters sent by the server device, and updating the public network speed prediction model according to the global model parameters.
[0008] In one possible implementation, the current network characteristic parameters include: the round-trip time and packet loss rate of the current network; accordingly, based on the current network characteristic parameters, the formula for calculating the network speed prediction result of the device under test is:
[0009]
[0010] In the formula, rtt represents the round-trip time of the current network, and loss represents the packet loss rate.
[0011] Secondly, embodiments of this application provide a network speed prediction method applied to a server-side device, comprising: acquiring multi-source data, wherein the multi-source data includes network datasets, speed test platform data, and operator network monitoring data; performing standardized preprocessing on the multi-source data to obtain a standardized dataset; extracting network feature parameters from the standardized dataset; and training a general benchmark model based on the network feature parameters to obtain a public network speed prediction model, wherein the general benchmark model refers to a machine learning or deep learning basic model framework capable of processing network feature parameters.
[0012] In one possible implementation, after obtaining the public network speed prediction model, the method further includes: encapsulating the public network speed prediction model into a model file; and sending the model file to each client device so that each client device receives the model file and loads the public network speed prediction model.
[0013] Thirdly, embodiments of this application provide a network speed prediction device applied to a client device, comprising: a data acquisition module for acquiring the current network characteristic parameters and the amount of local training sample data of the device under test, wherein the amount of local training sample data is the number of locally cached network speed sample data; a data volume judgment module for judging whether the amount of local training sample data is greater than a preset threshold; a local model prediction module for inputting the current network characteristic parameters into a pre-trained local network speed prediction model if the amount of local training sample data is greater than the preset threshold, so as to output the network speed prediction result of the device under test; a public model loading judgment module for judging whether the device under test has loaded the public network speed prediction model of the server device if the amount of local training sample data is less than or equal to the preset threshold; a public model prediction module for inputting the current network characteristic parameters into the public network speed prediction model if the device under test has loaded the public network speed prediction model, so as to output the network speed prediction result of the device under test; and a zero model prediction module for calculating the network speed prediction result of the device under test based on the current network characteristic parameters if the device under test has not loaded the public network speed prediction model.
[0014] Fourthly, this application provides a network speed prediction device applied to a server-side device, comprising: a multi-source data acquisition module for acquiring multi-source data, wherein the multi-source data includes network datasets, speed test platform data, and operator network monitoring data; a standardization processing module for performing standardization preprocessing on the multi-source data to obtain a standardized dataset; and a model training module for extracting network feature parameters from the standardized dataset and training a general benchmark model based on the network feature parameters to obtain a public network speed prediction model.
[0015] Fifthly, embodiments of this application provide a client device, including: a memory and a processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.
[0016] Sixthly, embodiments of this application provide a server device, including: a memory and a processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the processor to perform the second aspect and / or various possible implementations of the second aspect as described above.
[0017] In a seventh aspect, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect, as well as the second aspect and / or various possible implementations of the second aspect.
[0018] Eighthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect, as well as the second aspect and / or various possible implementations of the second aspect.
[0019] The network speed prediction method, apparatus, device, and storage medium provided in this application embodiment achieve prediction coverage from cold start to the entire life cycle through a three-layer switching architecture of physical formula, public network speed prediction model, and local network speed prediction model. In the zero data stage, the physical formula is used to solve the prediction gap. During the data accumulation period, the public network prediction model is used to ensure basic prediction accuracy. After sufficient local training sample data, the local network speed prediction model is used to achieve high-precision prediction, which solves the problem of low network speed prediction accuracy of a single model in the cold start stage. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0021] Figure 1 A schematic diagram illustrating a scenario for the network speed prediction method provided in this application embodiment;
[0022] Figure 2 A flowchart illustrating the network speed prediction method provided in this application embodiment;
[0023] Figure 3 Schematic diagram of the network speed prediction device provided in the embodiments of this application Figure 1 ;
[0024] Figure 4 Schematic diagram of the network speed prediction device provided in the embodiments of this application Figure 2 ;
[0025] Figure 5 This is a schematic diagram of the structure of the client device provided in the embodiments of this application;
[0026] Figure 6 This is a schematic diagram of the structure of the server device provided in an embodiment of this application.
[0027] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation
[0028] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0029] To clearly understand the technical solution of this application, we will first provide a detailed introduction to the solutions of existing technologies. With the deep extension of the mobile internet into multiple fields such as the industrial internet and the internet of vehicles, the complexity and dynamic fluctuations of network load are growing exponentially. Against this backdrop, the accuracy and real-time performance of network speed prediction are not only the core basis for achieving intelligent scheduling and load balancing of network resources, but also a key support for early warning of congestion faults and optimizing operational efficiency. Existing internet speed testing schemes relying on a single supervised model have significant limitations. On the one hand, training a supervised model requires sufficient labeled data. However, during the cold start phase, due to the lack of historical data accumulation, the model cannot converge effectively, leading to a sharp drop in prediction accuracy. On the other hand, even in the data accumulation phase, relying solely on local sample training is prone to overfitting due to the singular data distribution, resulting in prediction failure when the network environment changes abruptly, and failing to adapt to dynamically loaded network environments.
[0030] To address the aforementioned technical issues, the inventors devised a hybrid architecture integrating physical formulas, local network speed prediction models, and public network speed prediction models. When the amount of local training sample data does not meet a preset threshold and the public network speed prediction model is not loaded, the physical formula addresses the cold start gap. If the public network speed prediction model is loaded, the current network feature parameters are input into it to obtain the network speed prediction result. When the amount of local training sample data exceeds the preset threshold, the local network speed prediction model is used to predict the network speed based on the current network feature parameters. Starting from zero data, continuous network speed prediction is achieved throughout the entire lifecycle. The physical formula addresses the prediction gap during the cold start phase, improving cold start prediction accuracy. Simultaneously, the hybrid architecture integrating multiple prediction models enhances the adaptability to sudden changes in the network environment.
[0031] Figure 1 This is a schematic diagram of a scenario for the network speed prediction method provided in the embodiments of this application, such as... Figure 1 As shown, the specific application scenarios of this application include: client device 101 and server device 102.
[0032] The client device 101 is a user-side smart terminal, such as a mobile phone, tablet, or IoT device. It is responsible for collecting current network characteristic parameters in real time, storing local training sample data, and dynamically selecting a prediction model based on the amount of local training sample data. The prediction model includes a formula, a public network speed prediction model, and a local network speed prediction model. Finally, it outputs the network speed prediction result.
[0033] Among them, server device 102 is a cloud server, which undertakes the task of building and distributing the public network speed prediction model. By integrating multi-source data, it trains a lightweight general model and pushes it to the client device. At the same time, it receives the model parameters of the local network speed prediction model uploaded by the client device, aggregates them using the federated averaging algorithm to generate global model parameters, and sends them back to the client to complete the iterative update of the public network speed prediction model.
[0034] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0035] Figure 2 This is a flowchart illustrating the network speed prediction method provided in the embodiments of this application, as shown below. Figure 2 As shown, the execution subject of this method is Figure 1 The client device shown can also be other devices with similar functions. This application embodiment does not limit the scope of the device. The method is described in detail below:
[0036] S201: Obtain the current network characteristic parameters and local training sample data volume of the device under test, where the local training sample data volume is the number of network speed sample data cached locally.
[0037] Specifically, the client device uses a built-in network monitoring module to collect characteristic parameters strongly correlated with network speed in real time, including but not limited to round-trip time, packet loss rate, and signal strength. At the same time, the client queries the total amount of historical network speed sample data stored in the local database, where each historical network speed sample data includes the corresponding network characteristic parameters and the measured network speed value.
[0038] Among them, round-trip time reflects the latency of data transmission, packet loss rate reflects the integrity of data transmission, and signal strength reflects the stability of network connection.
[0039] For example, the mobile client obtains the current 4G network round-trip time as 60ms and packet loss rate as 5% through the system interface, and counts the historical sample data cached locally for 28 days.
[0040] S202: Determine whether the amount of local training sample data exceeds the preset threshold.
[0041] Specifically, the amount of local training sample data is compared with a preset threshold to determine whether the conditions for calling the local network speed prediction model are met. If the amount of local training sample data is greater than the preset threshold, it means that enough network feature samples have been accumulated locally, and a more targeted local network speed prediction model can be launched. If the amount of local training sample data is less than or equal to the preset threshold, it means that the local data is insufficient to support the training of the local network speed prediction model, and it is necessary to rely on a public network speed prediction model or physical formula.
[0042] For example, if the local training sample data is 28, which is less than the preset threshold of 50, it is determined that the conditions for calling the local network speed prediction model are not met, and the judgment process of the public network speed prediction model or physical formula is entered.
[0043] S203: If the amount of local training sample data is greater than the preset threshold, the current network feature parameters are input into the pre-trained local network speed prediction model to output the network speed prediction result of the device under test.
[0044] Specifically, when there is sufficient training sample data, the client device calls the personalized model that has been trained with local samples, namely the local network speed prediction model. The enhanced features such as round-trip time, packet loss rate, device type, and time period are input into the local network speed prediction model for inference. Since the training data comes from the network environment of the client device, the local network speed prediction model can capture the network patterns in that environment and output the network speed prediction result.
[0045] The local network speed prediction model needs to be iteratively updated based on locally cached network speed sample data. Specifically, the training process of the local network speed prediction model includes:
[0046] Sa: Collects locally cached network speed sample data in real time and determines whether the network speed sample data meets the preset quality conditions.
[0047] Specifically, during network usage, the client device records current network characteristic parameters in real time, such as round-trip time, packet loss rate, jitter, and corresponding measured network speed values, forming locally cached network speed sample data and triggering quality condition checks. The criteria for judging network speed sample data that meets preset quality conditions are: retaining samples from the 5%-95th percentile using quantile pruning, and removing extreme abnormal data outside this range, such as invalid data with a packet loss rate greater than 50% or a round-trip time greater than 1000ms, ensuring that the network speed sample data is within a reasonable network fluctuation range. The focus is on selecting network speed sample data with practical significance, including both stable scenarios such as network speeds of 10-300Mbps, packet loss rates less than 15%, and jitter less than 50ms, and extreme scenarios such as boundary samples. Boundary samples include samples that meet any of the following conditions.
[0048] 1) Samples with actual network speed less than 10Mbps and poor network quality.
[0049] 2) Samples with actual network speeds greater than 300Mbps, high-quality networks, or special scenarios.
[0050] 3) Samples with a packet loss rate greater than 15% and unstable network.
[0051] 4) Samples with jitter greater than 50ms and obvious network fluctuations.
[0052] Sb: If the network speed sample data meets the preset quality conditions, then save the network speed sample data.
[0053] Specifically, once the real-time collected network speed sample data passes the preset quality condition verification, the client device will store it in a unified format, such as a JSON structure containing timestamps, network characteristic parameters, measured network speed values, and device status labels, in the local database.
[0054] Sc: When the number of saved network speed sample data reaches the preset training quantity threshold, the saved network speed sample data is used as the training dataset to iteratively train the current local network speed prediction model and obtain an updated local network speed prediction model.
[0055] Specifically, when a sliding window mechanism is used to retain a preset training threshold, such as 100 data points, the client device triggers an iterative training process for the local network speed prediction model. The 100 saved network speed samples serve as the training set. Input features include network characteristic parameters such as round-trip time, packet loss rate, and jitter. The labels are the measured network speed values for the corresponding scenarios. The current local network speed prediction model, such as a 2-layer, 8-neuron micro-neural network, is loaded. Multiple rounds of iterative training are performed using the Adam optimizer. In each round, the model weights are updated by calculating the mean squared error between the predicted and measured values. The training process typically occurs during off-peak hours at night when the client device is charging and connected to the network. After training, an updated local network speed prediction model is generated, replacing the old model.
[0056] S204: If the amount of local training sample data is less than or equal to the preset threshold, then continue to determine whether the device under test has loaded the public network speed prediction model of the server device.
[0057] Specifically, when the amount of local training sample data is insufficient, after determining that the local samples are insufficient to support the local network speed prediction model, the client device checks whether a public network speed prediction model pre-trained by the server device, such as the lightweight GBDT model, is stored and loaded locally. The public network speed prediction model is trained based on multi-source general data, has strong generalization ability, covers most common network scenarios, and prioritizes determining whether the public network speed prediction model is available.
[0058] For example, when the local training sample data volume is 28, the client device checks and finds that the V2.1 version of the public network speed prediction model issued by the server device has been loaded, and determines that it can enter the public network speed prediction model prediction process.
[0059] S205: If the device under test has loaded the public network speed prediction model, then input the current network characteristic parameters into the public network speed prediction model to output the network speed prediction result of the device under test.
[0060] Specifically, in scenarios where the amount of local training sample data is insufficient but a public network speed prediction model has been loaded, the client device preprocesses the current network feature parameters according to the format required by the public network speed prediction model and inputs them into the public network speed prediction model, using the patterns learned by the public network speed prediction model on large-scale general data for prediction.
[0061] S206: If the device under test has not loaded the public network speed prediction model, the network speed prediction result of the device under test is calculated based on the current network characteristic parameters.
[0062] Specifically, if the local training sample size is insufficient and the public network speed prediction model is not loaded, such as in extreme cases like the client device being used for the first time or the public network speed prediction model being unloaded or corrupted, the client device will directly calculate the network speed based on the current network feature parameters and input the preset physical formula.
[0063] The physical formula is as follows:
[0064]
[0065] In the formula, rtt represents the round-trip time of the current network, and loss represents the packet loss rate. 950 is a calibrated empirical coefficient, implicitly in Mbps·ms (megabits per second·millisecond). 0.95 is a dimensionless constant used to fine-tune the overall prediction value.
[0066] In summary, by employing a three-layer switching architecture of physical formulas, public network speed prediction models, and local network speed prediction models, prediction coverage from cold start to the entire lifecycle is achieved. During the zero-data phase, physical formulas are used to fill prediction gaps. During the data accumulation phase, public network prediction models are used to ensure basic prediction accuracy. Once sufficient local training sample data is available, local network speed prediction models are used to achieve high-precision predictions, thus solving the problem of low network speed prediction accuracy of a single model during the cold start phase.
[0067] In another embodiment of this application, after the client device completes the update of its local network speed prediction model, it uploads the model parameters of the local network speed prediction model at a preset cycle, such as once a week, so that the server device can aggregate and generate global parameters through a federated averaging algorithm and send them back to the client device to update the public model. This process includes:
[0068] S301: Obtain the model parameters of the local network speed prediction model according to the preset cycle.
[0069] Specifically, the client device uploads the model parameters of the local network speed prediction model at a fixed time every week. At this time, the client device calls the local network speed prediction model management module through the interface to extract the model parameters of the current local network speed prediction model, including the two-layer weight matrix of the neural network, the bias term, and the activation function parameters.
[0070] S302: Add noise to the model parameters to generate encrypted model parameters.
[0071] Specifically, the client device calls the differential privacy processing module to add Gaussian noise to the extracted model parameters and multiplies each element in the weight matrix by a noise factor of (0.95 + random number × 0.1), where the random number ranges from 0 to 1.
[0072] For example, a weight value is processed from 0.321 to 0.321 × 0.98 ≈ 0.315, and a bias term is processed from 0.05 to 0.05 × 1.02 ≈ 0.051.
[0073] S303: Send the encrypted model parameters and the number of saved network speed sample data to the server device, so that the server device can aggregate the encrypted model parameters sent by each client device based on the federated averaging algorithm and the number of saved network speed sample data to generate global model parameters.
[0074] Specifically, the client device packages the encrypted model parameters and the number of locally stored network speed sample data via the mobile network, encrypts them using an encryption algorithm, and sends them to the server. The sent data includes a hashed device identifier, timestamp, encrypted model parameters, and sample quantity fields. The server device initiates a federated aggregation task within a preset time period, receiving the encrypted model parameters and the number of network speed sample data sent by multiple client devices. The aggregation process is as follows: based on the number of network speed sample data sent by each client device, the parameter weight coefficient for that client device is determined; the encrypted model parameters of all client devices are weighted and summed according to the parameter weight coefficients of each client device; after multiple rounds of iterative smoothing, the global model parameters are obtained.
[0075] S304: Receive global model parameters sent by the server device and update the public network speed prediction model based on the global model parameters.
[0076] Specifically, after detecting the global model parameters pushed by the server device, the client device decrypts them using a preset algorithm, compares the version of the public network speed prediction model, and determines whether to update. The global model parameters are then used to replace all parameters of the public network speed prediction model.
[0077] In summary, by periodically uploading encrypted model parameters, generating global parameters through server-side device federation, and updating the public model, the personalized network characteristics of a massive number of clients are precipitated into global knowledge, reducing the prediction error of the public network speed prediction model during the cold start phase.
[0078] In another embodiment of this application, the server device generates a public network speed prediction model adapted to multiple client devices through multi-source data fusion, standardized preprocessing, feature engineering, and lightweight model training. The method includes:
[0079] S401: Acquire multi-source data, which includes network datasets, speed test platform data, and operator network monitoring data.
[0080] Specifically, the server equipment integrates Kaggle's Speedtest dataset, which includes features such as round-trip time, packet loss rate, and historical network speed under different network conditions; Ookla's public speed test data, which covers network types and performance indicators from around the world; and operator network monitoring data, such as base station coverage, signal strength, and frequency band interference. The total sample size reaches more than 200,000. These data cover differences in user density, network type, and operator characteristics, thereby avoiding the inferiority of a single data source or differences in equipment.
[0081] S402: Perform standardization preprocessing on multi-source data to obtain a standardized dataset.
[0082] Specifically, feature names from different data sources are aligned to ensure consistency of input features. Quantile pruning is used to retain samples in the 5%-95% range, while extreme outliers, such as invalid data with round-trip times greater than 1000ms or packet loss rates greater than 50%, are removed. Finally, a standardized dataset containing features such as round-trip time, packet loss rate, jitter, and network speed is generated.
[0083] S403: Extract network feature parameters from a standardized dataset, and train a general benchmark model based on the network feature parameters to obtain a public network speed prediction model. The general benchmark model refers to a machine learning or deep learning basic model framework that can process network feature parameters.
[0084] Among them, the general benchmark model refers to a basic machine learning or deep learning model framework capable of processing multi-dimensional network feature parameters. It predefines feature processing logic, network structure, and parameter optimization methods, and can ultimately output the network speed prediction value for the corresponding network scenario based on the input network feature parameters by learning the mapping relationship between network feature parameters and actual network speed. Specific model types that can be used include, but are not limited to: gradient boosting tree models, feedforward neural networks, deep learning models that fuse spatiotemporal features, or random forests.
[0085] Specifically, feature engineering enhancements are first performed, applying nonlinear transformations to network features, such as logarithmic transformation of round-trip time to mitigate the impact of long-tail distribution on the model, and square root processing of packet loss rate to quantify the nonlinear attenuation effect of packet loss rate on network speed. Simultaneously, composite features are constructed, combining basic features such as round-trip time, packet loss rate, and jitter for calculation. Combined with the time dimension, time periods are divided by hours to generate temporal features representing the diurnal network fluctuation pattern. Clustering is performed based on base station identifiers to extract spatial features reflecting the network characteristics of different regions. Next, a lightweight gradient boosting decision tree is selected as the general benchmark model and optimized during training. In terms of model architecture, the tree depth is controlled at 5 layers, with appropriate leaf node numbers and feature sampling rates set to ensure the model's ability to capture complex features while avoiding overfitting. The training process employs a phased strategy: the first phase freezes the parameters of the basic layers, training only the output layers related to newly constructed features to quickly adapt to the added feature information; the second phase performs full parameter fine-tuning to improve the model's ability to fuse multi-source data. The learning rate is initially set to 0.1 and decreases by 10% every 10 iterations to ensure stable convergence of the model. An early stopping mechanism is also introduced, using the mean absolute error on the validation set as the monitoring metric. Training is stopped when there is no improvement for 5 consecutive iterations, and the number of training iterations is controlled to be around 100.
[0086] Specifically, after obtaining the public network speed prediction model, the public network speed prediction model is packaged into a model file; the model file is sent to each client device so that each client device can receive the model file and load the public network speed prediction model.
[0087] Specifically, the server-side device standardizes and encapsulates the trained public network speed prediction model into a model file that can be parsed by client devices. The server-side device then sends the model file to each client device through a distributed network distribution system. During distribution, intelligent scheduling is performed based on the client device type, network environment, and location: priority is given to pushing the complete model file to client devices with better network conditions, such as those in wireless network environments with faster speeds; for client devices with unstable networks or sensitive traffic, a breakpoint resumption mechanism is used to ensure that the file is received gradually and completely; for client devices in remote areas, edge nodes of the content delivery network are used to shorten the file transmission distance and improve download speed. After receiving the model file, the client device first verifies the integrity and legality of the file using a checksum. Once confirmed, it calls its local model parsing module to load the public network speed prediction model according to the metadata in the model file and deploy the model parameters into the prediction engine.
[0088] In summary, multi-source data covers more than 200,000 samples, avoiding the bias of a single data source and improving the scenario coverage of the public network speed prediction model.
[0089] Figure 3Schematic diagram of the network speed prediction device provided in the embodiments of this application Figure 1 The device is applied to client equipment and includes: a data acquisition module 301, a data volume judgment module 302, a local model prediction module 303, a public model loading judgment module 304, a public model prediction module 305, and a zero model prediction module 306.
[0090] The data acquisition module 301 is used to acquire the current network characteristic parameters and the amount of local training sample data of the device under test, wherein the amount of local training sample data is the number of network speed sample data cached locally.
[0091] The data volume judgment module 302 is used to determine whether the local training sample data volume is greater than a preset threshold.
[0092] The local model prediction module 303 is used to input the current network feature parameters into the pre-trained local network speed prediction model if the amount of local training sample data is greater than a preset threshold, so as to output the network speed prediction result of the device under test.
[0093] The public model loading judgment module 304 is used to determine whether the device under test has loaded the public network speed prediction model of the server device if the amount of local training sample data is less than or equal to a preset threshold.
[0094] The public model prediction module 305 is used to input the current network characteristic parameters into the public network speed prediction model if the device under test has already loaded the public network speed prediction model, so as to output the network speed prediction result of the device under test.
[0095] The zero-model prediction module 306 is used to calculate the network speed prediction result of the device under test based on the current network characteristic parameters if the device under test has not loaded a public network speed prediction model.
[0096] In one possible implementation, the device further includes a local model training module, which is used to collect locally cached network speed sample data in real time and determine whether the network speed sample data meets preset quality conditions. If the network speed sample data meets the preset quality conditions, the network speed sample data is saved. When the number of saved network speed sample data reaches a preset training quantity threshold, the saved network speed sample data is used as the training dataset to iteratively train the current local network speed prediction model to obtain an updated local network speed prediction model.
[0097] In one possible implementation, the device further includes a public model update module, which is used to obtain model parameters of the local network speed prediction model according to a preset period; add noise to the model parameters to generate encrypted model parameters; send the encrypted model parameters and the number of saved network speed sample data to the server device, so that the server device aggregates the encrypted model parameters sent by each client device based on the federated averaging algorithm and the number of saved network speed sample data to generate global model parameters; receive the global model parameters sent by the server device, and update the public network speed prediction model according to the global model parameters.
[0098] In one possible implementation, the zero-model prediction module 306 calculates the network speed prediction result of the device under test using the following formula:
[0099]
[0100] In the formula, rtt represents the round-trip time of the current network, and loss represents the packet loss rate.
[0101] The network speed prediction device provided in this embodiment can execute the network speed prediction method for client devices provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0102] Figure 4 Schematic diagram of the network speed prediction device provided in the embodiments of this application Figure 2 The device is applied to server equipment and includes: a multi-source data acquisition module 401, a standardization processing module 402, and a model training module 403.
[0103] The multi-source data acquisition module 401 is used to acquire multi-source data, including network datasets, speed test platform data, and operator network monitoring data.
[0104] The standardization processing module 402 is used to perform standardization preprocessing on multi-source data to obtain a standardized dataset.
[0105] The model training module 403 is used to extract network feature parameters from the standardized dataset, and train a general benchmark model based on the network feature parameters to obtain a public network speed prediction model. The general benchmark model refers to a machine learning or deep learning basic model framework that can process network feature parameters.
[0106] In one possible implementation, the device further includes a public model distribution module, which encapsulates the public network speed prediction model into a model file and sends the model file to each client device so that each client device receives the model file and loads the public network speed prediction model.
[0107] The network speed prediction device provided in this embodiment can execute the network speed prediction method for server devices provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0108] Figure 5 This is a schematic diagram of the structure of a client device provided in an embodiment of this application. Figure 5 As shown, the client device provided in this embodiment includes at least one processor 501 and a memory 502. Optionally, the client device further includes a communication component 503. The processor 501, memory 502, and communication component 503 are connected via a bus 504. In specific implementation, at least one processor 501 executes computer execution instructions stored in the memory 502, causing at least one processor 501 to perform the above-described method. The specific implementation process of the processor 501 can be found in the above-described method embodiment, and its implementation principle and technical effects are similar; therefore, it will not be repeated here.
[0109] Figure 6 This is a schematic diagram of the structure of the server-side device provided in an embodiment of this application. Figure 6 As shown, the server device provided in this embodiment includes at least one processor 601 and a memory 602. Optionally, the server device further includes a communication component 603. The processor 601, memory 602, and communication component 603 are connected via a bus 604. In specific implementation, at least one processor 601 executes computer execution instructions stored in the memory 602, causing at least one processor 601 to perform the above-described method. The specific implementation process of the processor 601 can be found in the above-described method embodiment, and its implementation principle and technical effects are similar; therefore, it will not be repeated here.
[0110] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0111] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0112] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0113] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0114] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.
[0115] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0116] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0117] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0118] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0119] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0120] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0121] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0122] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
Claims
1. A method for predicting network speed, characterized in that, Applied to client devices, including: Obtain the current network characteristic parameters and the amount of local training sample data of the device under test, wherein the amount of local training sample data is the number of network speed sample data cached locally; Determine whether the amount of local training sample data exceeds a preset threshold; If the amount of local training sample data is greater than a preset threshold, the current network feature parameters are input into the pre-trained local network speed prediction model to output the network speed prediction result of the device under test. If the amount of local training sample data is less than or equal to a preset threshold, then it is further determined whether the device under test has loaded the public network speed prediction model of the server device. If the device under test has already loaded the public network speed prediction model, then the current network characteristic parameters are input into the public network speed prediction model to output the network speed prediction result of the device under test; If the device under test has not loaded the public network speed prediction model, the network speed prediction result of the device under test is calculated based on the current network characteristic parameters.
2. The method according to claim 1, characterized in that, The training process of the local network speed prediction model includes: Real-time collection of locally cached network speed sample data, and determination of whether the network speed sample data meets preset quality conditions; If the network speed sample data meets the preset quality conditions, then the network speed sample data will be saved. When the number of saved network speed sample data reaches the preset training quantity threshold, the saved network speed sample data is used as the training dataset to iteratively train the current local network speed prediction model and obtain an updated local network speed prediction model.
3. The method according to claim 2, characterized in that, After obtaining the updated local network speed prediction model, the following is also included: According to a preset period, obtain the model parameters of the local network speed prediction model; Noise is added to the model parameters to generate encrypted model parameters; The encrypted model parameters and the number of saved network speed sample data are sent to the server device, so that the server device can aggregate the encrypted model parameters sent by each client device based on the federated averaging algorithm and the number of saved network speed sample data to generate global model parameters. The system receives global model parameters sent by the server device and updates the public network speed prediction model based on the global model parameters.
4. The method according to claim 1, characterized in that, The current network characteristic parameters include: the current network round-trip time and packet loss rate; Accordingly, the formula for calculating the network speed prediction result of the device under test based on the current network characteristic parameters is as follows: In the formula, rtt represents the round-trip time of the current network, and loss represents the packet loss rate.
5. A method for predicting network speed, characterized in that, Applied to server-side devices, including: Acquire multi-source data, including network datasets, speed test platform data, and operator network monitoring data; The multi-source data is preprocessed to obtain a standardized dataset; Network feature parameters are extracted from the standardized dataset, and a general benchmark model is trained based on the network feature parameters to obtain a public network speed prediction model. The general benchmark model refers to a machine learning or deep learning basic model framework that can process network feature parameters.
6. The method according to claim 5, characterized in that, After obtaining the public network speed prediction model, the following is also included: The public network speed prediction model is encapsulated into a model file; The model file is sent to each client device so that each client device receives the model file and loads the public network speed prediction model.
7. A network speed prediction device, characterized in that, Applied to client devices, including: The data acquisition module is used to acquire the current network characteristic parameters and the amount of local training sample data of the device under test, wherein the amount of local training sample data is the number of network speed sample data cached locally; The data volume judgment module is used to determine whether the local training sample data volume is greater than a preset threshold. The local model prediction module is used to input the current network feature parameters into the pre-trained local network speed prediction model if the amount of local training sample data is greater than a preset threshold, so as to output the network speed prediction result of the device under test. The public model loading judgment module is used to determine whether the device under test has loaded the public network speed prediction model of the server device if the amount of local training sample data is less than or equal to a preset threshold. The public model prediction module is used to input the current network characteristic parameters into the public network speed prediction model if the device under test has already loaded the public network speed prediction model, so as to output the network speed prediction result of the device under test. The zero-model prediction module is used to calculate the network speed prediction result of the device under test based on the current network characteristic parameters if the device under test has not loaded the public network speed prediction model.
8. A client device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1 to 4.
9. A server-side device, characterized in that, include: Memory, processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 5 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 4, and the method as described in any one of claims 5 to 6.