Network speed measurement method and equipment
By screening the optimal speed measurement site and optimizing the speed measurement process, the existing network speed measurement methods are solved, and more efficient and accurate speed measurement results are achieved, and users are supported to provide high-quality services.
Patent Information
- Application Number
- CN202411318360.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2024-12-03
AI Technical Summary
The existing network speed measurement methods are inefficient and inaccurate, so they cannot effectively support equipment operators and managers to provide high-quality services to users.
By filtering out the optimal speed measurement site, optimizing the speed measurement process, recording data using the AtomicReference atomic class, and setting the maximum speed measurement times and delay waiting strategy in case of failure, ensuring the accuracy and reliability of the speed measurement results.
It improves the efficiency and accuracy of the speed measurement process, provides more efficient speed measurement process and more accurate test results, and facilitates equipment operators and managers to provide users with better services.
Smart Images

Figure CN119071200A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a network speed measurement method and device. Background Art
[0002] With the rapid development and widespread application of Internet technology, more and more services need to rely on good network quality to operate well. Among them, network speed is an important indicator to measure network quality. Whether for users or service providers, fast and accurate network speed measurement is particularly important. In particular, for network equipment operators, managers or business service providers, knowing the network speed of their own operating and management equipment or business demand terminals has become a prerequisite for providing high-quality services to users. Summary of the invention
[0003] In order to solve the above technical problems, the present application proposes a network speed measurement method, which efficiently screens out the best speed measurement site for this round before sending a speed measurement request to the speed measurement service site for this round, and optimizes the speed measurement process during the speed measurement process to obtain an efficient speed measurement process, accurate result feedback and good retry support. This method can provide a more efficient speed measurement process and more accurate test results, making it easier for equipment operators and managers to provide users with better services.
[0004] To solve the above problem, an embodiment of the present application provides a network speed measurement method, which is executed by a terminal and includes:
[0005] S101: The terminal sends a request to the service server according to the trigger instruction, and obtains the target speed test site file on the service server;
[0006] S102: Read the target speed test site file and obtain the first speed test site list and the information of the default speed test site;
[0007] S103: According to the first screening strategy, remove the information of the default speed test sites that are unavailable and / or have timed out from the first speed test site list to obtain a second speed test site list;
[0008] S104: adding information of local speed test sites and information of third-party speed test sites, and summarizing them into the second site list to obtain a third speed test site list;
[0009] S105: selecting, according to the second screening strategy, a pre-selected speed test site with the lowest ping value in the third speed test site list as a speed test site for this round;
[0010] S201: Send a speed measurement request to the speed measurement site of this round, and collect the speed measurement information of this round;
[0011] S202: Determine whether the current round of speed measurement is successful based on the current round of speed measurement information; if so, generate json string data and report the speed measurement result to the display interface of the terminal or the business server; if not, execute the next step;
[0012] S203: Determine whether the current round of speed measurement exceeds the maximum number of speed measurement times; if so, stop the speed measurement and report the speed measurement failure to the display interface of the terminal or the service server; if not, execute the next step;
[0013] S204: Enter delayed waiting, and return to execute S201 after waiting for a predetermined period of time.
[0014] In a possible embodiment, in S102, the target speed test site file is read, and information of the first speed test site list and the default speed test site is obtained; including:
[0015] Record the reading time and compare it with the preset reading time. If the reading time exceeds the preset reading time, stop the current reading behavior and retain the information of the default speed test site that has been read. Generate a first speed test site speed test list and add the information of the default speed test site that has been read to it.
[0016] In a possible embodiment, the reading duration includes: the reading duration of a single default speed measurement site;
[0017] The preset reading time includes: the preset reading time of a single default speed test site;
[0018] When the reading time is compared with the preset reading time, the reading time of a single default speed test site is compared with the preset reading time of a single default speed test site.
[0019] In a possible embodiment, the reading duration includes: the reading duration of the entire target speed test site file;
[0020] The preset reading time includes: the preset reading time of the entire target speed test site file;
[0021] When the reading time is compared with the preset reading time, the reading time of the entire target speed test site file is compared with the preset reading time of the entire target speed test site file.
[0022] In a possible embodiment, in S103, the first screening strategy includes: based on the network environment where the terminal is located and the IP address and geographical location included in the information of the default speed test site, removing the default speed test site that is unavailable or has timed out of access.
[0023] In a possible embodiment, in S104, the local speed measurement site includes: a speed measurement site deployed in an output port of the operator network where the terminal is located and / or a speed measurement site located in the same geographical range where the terminal is located.
[0024] In a possible embodiment, in S104, the third-party speed measurement site includes: a speed measurement site that is not directly associated with an operating service provider of the operator network where the terminal is located.
[0025] In a possible embodiment, in S105, the pre-selected speed test site with the lowest ping value in the third speed test site list is selected according to the second screening strategy as the speed test site in this round; including:
[0026] Assign weights to the packet loss rate, bandwidth capacity, geographical proximity, and network jitter of the pre-selected speed test sites in the third speed test list, calculate the weighted score of each pre-selected speed test site, and select the pre-selected speed test site with the lowest ping value from the pre-selected speed test sites with weighted scores in the top 30% as the speed test site for this round.
[0027] In a possible embodiment, in S201, the speed measurement information of this round includes:
[0028] The IP address and ISP information of the speed test site in this round, ping delay information, jetty jitter information, upload speed, download speed, duration of this round of speed test, and shareUrl address.
[0029] In a possible embodiment, in S201, collecting the current round of speed measurement information includes:
[0030] The AtomicReference atomic class is used to record the IP address and ISP information of the speed test site collected in this round, ping delay information, jetty jitter information, upload speed, download speed, duration of this round of speed test, and shareUrl address.
[0031] In a possible embodiment, in S202, the json string data is generated by SpeedBean.
[0032] Secondly, the present application provides a storage medium on which a computer program is stored, and when the program is executed by a processor, any of the above methods is implemented.
[0033] Finally, the present application also provides a device, comprising:
[0034] The device includes a memory and a processor;
[0035] A computer program is stored in the memory;
[0036] A processor is used to execute any of the above methods when running a computer program.
[0037] Compared with the prior art, this application has the following advantages and beneficial effects:
[0038] Through a series of strategic steps, the efficiency and accuracy of the speed test process are optimized. First, the terminal obtains the target speed test site file according to the trigger instruction, filters out the available sites, and avoids invalid speed tests. Secondly, by adding local and third-party speed test site information, the comprehensiveness and accuracy of the speed test are improved. Then, the second screening strategy is used to select the optimal speed test site to ensure that the speed test results accurately match the actual needs. During the speed test process, the AtomicReference atomic class is used to record various data to ensure the integrity of the information. After the speed test is successful, the Json string data is generated through SpeedBean for unified summary and analysis. If the speed test fails, the maximum number of speed tests and the delay waiting strategy are set to avoid resource waste and reduced user experience. In addition, it also includes monitoring of the reading time and careful screening of speed test sites to ensure the reliability and effectiveness of the speed test data. Ultimately, this method can provide a more efficient speed test process and more accurate test results, making it easier for equipment operators and managers to provide users with better services. . BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A flowchart of the network speed measurement method provided by this application;
[0041] Figure 2 A flowchart for the pre-screening phase of speed testing sites;
[0042] Figure 3 This is the flow chart of the formal speed measurement phase. DETAILED DESCRIPTION
[0043] In the following, various embodiments of the present disclosure will be described more fully. The present disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of the present disclosure to the specific embodiments disclosed herein, but rather the present disclosure should be understood to cover all adjustments, equivalents and / or alternatives that fall within the spirit and scope of the various embodiments of the present disclosure.
[0044] Hereinafter, the terms "include" or "may include" used in various embodiments of the present disclosure indicate the presence of disclosed functions, operations, or elements, and do not limit the addition of one or more functions, operations, or elements. In addition, as used in various embodiments of the present disclosure, the terms "include", "have", and their cognates are intended only to indicate specific features, numbers, steps, operations, elements, components, or a combination of the foregoing, and should not be understood as first excluding the presence of one or more other features, numbers, steps, operations, elements, components, or a combination of the foregoing or the possibility of adding one or more features, numbers, steps, operations, elements, components, or a combination of the foregoing.
[0045] In various embodiments of the present disclosure, the expression "or" or "at least one of A or / and B" includes any combination or all combinations of the words listed at the same time. For example, the expression "A or B" or "at least one of A or / and B" may include A, may include B, or may include both A and B.
[0046] The expressions (such as "first", "second", etc.) used in the various embodiments of the present disclosure may modify the various constituent elements in the various embodiments, but may not limit the corresponding constituent elements. For example, the above expressions do not limit the order and / or importance of the elements. The above expressions are only used for the purpose of distinguishing one element from other elements. For example, the first user device and the second user device indicate different user devices, although both are user devices. For example, without departing from the scope of the various embodiments of the present disclosure, the first element may be referred to as the second element, and similarly, the second element may also be referred to as the first element.
[0047] It should be noted that if it is described that one component element is “connected” to another component element, the first component element may be directly connected to the second component element, and a third component element may be “connected” between the first component element and the second component element. Conversely, when one component element is “directly connected” to another component element, it can be understood that there is no third component element between the first component element and the second component element.
[0048] The term “user” used in various embodiments of the present disclosure may indicate a person using an electronic device or a device (eg, an artificial intelligence electronic device) using the electronic device.
[0049] The terms used in the various embodiments of the present disclosure are only used for the purpose of describing specific embodiments and are not intended to limit the various embodiments of the present disclosure. As used herein, the singular form is intended to also include the plural form, unless the context clearly indicates otherwise. Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as the meanings commonly understood by ordinary technicians in the field to which the various embodiments of the present disclosure belong. The terms (such as the terms defined in the generally used dictionary) will be interpreted as having the same meaning as the contextual meaning in the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning, unless clearly defined in the various embodiments of the present disclosure.
[0050] Example:
[0051] This embodiment provides a network speed measurement method, which is executed by a terminal. Figure 1 As shown, the network speed measurement method includes:
[0052] S101: The terminal sends a request to the service server according to the trigger instruction, and obtains the target speed test site file on the service server; the target speed test site file in the service server may be provided by a network equipment operator, manager or service provider, and provides real-time, available and accurate speed test site information based on its own purpose and service type;
[0053] S102: Read the target speed test site file and obtain the first speed test site list and the information of the default speed test site;
[0054] S103: According to the first screening strategy, information of the default speed test sites that are unavailable and / or have timed out in the first speed test site list is removed to obtain a second speed test site list; this avoids using unavailable or slow speed test sites for speed test in subsequent speed test processes, thereby saving speed test time and speed test accuracy;
[0055] S104: adding information of local speed test sites and information of third-party speed test sites, and summarizing them into the second site list to obtain a third speed test site list; adding information of local speed test sites and third-party speed test sites to meet more diverse speed test purposes and service scenarios improves comprehensiveness and accuracy;
[0056] S105: According to the second screening strategy, the pre-selected speed test site with the lowest ping value in the third speed test site list is selected as the site for this round of speed test; the second screening strategy includes: screening according to the needs and purposes of network equipment operators, managers, business service providers or specific services, and on this basis, the pre-selected speed test site with the lowest ping value is selected as the site for this round of speed test, so as to achieve accurate matching of network speed test and needs. Note: The ping value here refers to the time taken by the terminal to send a signal to the speed test site in this round and receive the return signal from the speed test site in this round. The higher the value, the slower the connection between the two is established, and the lower the value, the faster the connection between the two is established;
[0057] S201: Send a speed measurement request to the speed measurement site of this round, and collect the speed measurement information of this round;
[0058] S202: Determine whether this round of speed measurement is successful based on the speed measurement information of this round; if so, generate json string data and report the speed measurement result to the display interface of the terminal or the business server; if not, execute the next step; uniformly report various data through json string, so that network equipment operators, managers or business service providers can receive speed measurement results from various terminals from the business server and then perform uniform aggregation and analysis, so that the speed measurement results can serve to optimize the subsequent business service development and operation;
[0059] S203: Determine whether the current round of speed measurement exceeds the maximum number of speed measurement times; if so, stop the speed measurement and report the speed measurement failure to the terminal display interface or the service server; if not, execute the next step; avoid excessive speed measurement retries occupying resources or causing confusion and bringing negative experience to terminal users;
[0060] S204: Enter delayed waiting, and return to S201 after waiting for a predetermined time. If the predetermined waiting time is set to 10s, then if it is less than 10s after entering delayed waiting, continue to wait, and if it reaches 10s, start retrying, that is, return to S201. If the number of retries exceeds the maximum number of tests, the speed test failure can be reported. If there are many other abnormalities such as program, network fluctuations, speed test site failure, etc. during the delayed waiting, cancel the delayed waiting and wait for the predetermined time again, and then return to step S201 to start retesting the speed to avoid confusion caused by retesting the speed.
[0061] In a possible embodiment, in S102, the target speed test site file is read, and information of the first speed test site list and the default speed test site is obtained; including:
[0062] Record the reading time and compare it with the preset reading time. If the reading time exceeds the preset reading time, stop the current reading behavior and retain the information of the default speed test site that has been read. Generate a first speed test site speed test list and add the information of the default speed test site that has been read to it.
[0063] By recording the reading time and comparing it with the preset time, it can avoid being stuck or spending too much time in the information reading process of a single default speed test site or the entire target speed test site due to reasons such as too much data or data errors;
[0064] In actual use, the preset reading time includes the normal reading time obtained from experience or theoretical calculation plus the timeout time. The timeout time is generally set to 3S to avoid the program being stuck in the read step and affecting the entire speed measurement process.
[0065] In a possible embodiment, the reading duration includes: the reading duration of a single default speed measurement site;
[0066] The preset reading time includes: the preset reading time of a single default speed test site;
[0067] When comparing the reading time with the preset reading time, the reading time of a single default speed test site is compared with the preset reading time of a single default speed test site. This prevents the system from getting stuck or spending too much time reading information at a single default speed test site due to excessive data or data errors, which may cause program confusion or a decrease in user experience.
[0068] In a possible embodiment, the reading duration includes: the reading duration of the entire target speed test site file;
[0069] The preset reading time includes: the preset reading time of the entire target speed test site file;
[0070] When comparing the reading time with the preset reading time, the reading time of the entire target speed test site file is compared with the preset reading time of the entire target speed test site file. Avoid the entire target speed test site being stuck or taking too much time during the reading process due to reasons such as too large data or data errors.
[0071] In a possible embodiment, in S103, the first screening strategy includes: based on the IP address and geographic location contained in the information of the network environment where the terminal is located and the default speed test site, remove the default speed test site that is unavailable or has timed out. In some network environments where the terminal is located, it is impossible to connect to some default speed test sites, such as terminals in the domestic Internet environment and some overseas default speed test sites, terminals in a certain local area network and default speed test sites outside the local area network, or network operators of some terminals have blocked some default speed test sites. The complex situation needs to be configured as required according to the actual situation of the network environment detected by the terminal. This screening strategy can avoid invalid speed testing of unavailable or timed-out default speed test sites.
[0072] In a possible embodiment, in S104, the local speed test site includes: a speed test site deployed in the output port of the operator network where the terminal is located and / or a speed test site located in the same geographical range where the terminal is located. The local speed test site can exclude other interference items to the greatest extent and reflect the network speed of the network environment where the terminal is located, that is, the maximum possible network speed when the terminal is connected to other nodes; Note: Because the network speed will be affected by many factors such as distance, network congestion, and basic settings of the service provider, "the same geographical range" refers to the following: the same provincial, prefectural, county or township administrative region in the administrative divisions of the People's Republic of China.
[0073] In a possible embodiment, in S104, the third-party speed test site includes: a speed test site that is not directly associated with the operating service provider of the operator network where the terminal is located. First: some speed test sites may be useless for this speed test due to long-term lack of maintenance or failure. Adding a third-party speed test site can avoid this situation; second: for a small number of network operators intercepting speed test requests sent by users to specific speed test sites and returning false speed test information from the pseudo speed test sites deployed by them, adding a third-party speed test site can reduce the probability of network operators, business service providers, etc. deploying false speed test sites for terminals and returning unreal network speed test results; Note: "no direct association" here refers to speed test sites that are not directly operated by the operating service provider of the operator network where the terminal is located, including but not limited to: speed test sites operated by non-profit organizations or institutions such as Nanjing University Speed Test Site, China University of Science and Technology Speed Test Site, Northeastern University Speed Test Site, Nanjing University of Aeronautics and Astronautics Speed Test Site, etc.
[0074] In a possible embodiment, in S105, the pre-selected speed test site with the lowest ping value in the third speed test site list is selected according to the second screening strategy as the speed test site in this round; including:
[0075] Assign weights to the packet loss rate, bandwidth capacity, geographic proximity, and network jitter of the pre-selected speed test sites in the third speed test list, calculate the weighted scores of each pre-selected speed test site, and select the pre-selected speed test site with the lowest ping value from the pre-selected speed test sites with the top 30% weighted scores as the speed test site for this round. According to the needs and purposes of network equipment operators, managers, business service providers, or specific services, weights are assigned to the corresponding parameters, and on this basis, the pre-selected speed test site with the lowest ping value is selected as the speed test site for this round, so as to achieve an accurate match between network speed test and actual needs and purposes, and truly let the test and data serve the needs and business.
[0076] In a possible embodiment, in S201, the speed measurement information of this round includes:
[0077] The IP address and ISP information of the speed test site in this round, ping delay information, jetty jitter information, upload speed, download speed, duration of this round of speed test, and shareUrl address.
[0078] In a possible embodiment, in S201, collecting the current round of speed measurement information includes:
[0079] The AtomicReference atomic class is used to record the collected IP address and ISP information of the speed test site, ping delay information, jetty jitter information, upload speed, download speed, duration of this round of speed test, and shareUrl address. The AtomicReference atomic class is used to encapsulate multiple numerical information into an overall object, and the atomic concurrent class that controls, records, and updates multiple specific attributes is used to realize the collection of this round of speed test information.
[0080] In a possible embodiment, in S202, json string data is generated by SpeedBean. By reporting the json string data generated by SpeedBean, after receiving the network speed test results of multiple terminals, the business server can conveniently count and classify the various data in the results for subsequent analysis, so as to truly form a network test that is helpful for business design and optimization. SpeedBean generates json string data from the collected speed test information of this round for reporting to the business server, which is convenient for counting and analyzing the speed test results obtained in the scenario of multiple terminal speed tests.
[0081] In a relatively complete embodiment, steps S101 to S105 in the above method can be summarized as a speed measurement site pre-screening stage, which can be expressed as Figure 2 Flowchart style:
[0082] The terminal receives a trigger instruction of "requesting speed measurement" sent from a remote end or generated by a user operation;
[0083] Then, a request for obtaining the target speed test site file is sent to the business server, and the business server sends the corresponding target speed test site file to the terminal according to the request content;
[0084] The terminal receives the target speed test file and reads it. To avoid the long reading time affecting the user experience, the preset reading time of this step is set in advance. By comparing the actual reading time of the terminal with the preset reading time, when the reading of the entire target speed test file times out, only the default speed test site information that has been read is retained, and the reading of the remaining files is abandoned; when the reading of the information of a single default speed test site times out, the reading of the information of the default speed test site is skipped, and the information of the next default speed test site is read; all the default speed test site information obtained by reading is retained to generate the first speed test site list;
[0085] Through the first screening rule, the unavailable or slow-access default speed test sites in the first speed test site are cleaned and eliminated to obtain suitable effective sites; this first screening strategy removes the default speed test sites that are obviously unavailable and slow-access in certain network environments according to the network environment where the terminal is located and the IP address and geographical location contained in the information of each default speed test site; for example: the terminal is in a domestic network environment, and a default speed test site is an overseas site that is obviously blocked by a firewall, or a default speed test site is not blocked by a firewall, but its geographical location is too far from the terminal, and the access is slow and the packet loss rate is high due to the physical distance or many nodes passed through. Such sites are obviously not valuable for speed testing, so they are eliminated in advance to save resources and time for subsequent program operation;
[0086] In order to improve the comprehensiveness, accuracy and fairness of speed measurement, local speed measurement sites and third-party speed measurement sites are introduced to generate a second site list;
[0087] According to the above business requirements, the second site list and the information of the pre-selected speed test sites contained therein, configure SpeedtestConfig (speed test configuration) and TelemetryConfig (telemetry data collection and transmission configuration) to prepare for subsequent speed test and data collection and reporting;
[0088] The second screening strategy is used to select the pre-selected speed test site with the lowest ping value as the site for this round of speed test. This strategy allows weights to be assigned to the packet loss rate, bandwidth capacity, geographical proximity, and network jitter of the pre-selected speed test site according to the needs and purpose of the network speed test service. For example, if the high-definition video service has high requirements for data throughput, the weight allocation for bandwidth capacity will be reasonably increased; if the first-person shooter game has high requirements for data packet loss rate and network jitter, the weight allocation for data packet loss rate and network jitter will be reasonably increased; on this basis, the one with the lowest ping value is selected from the top 30% of the pre-selected speed test sites with the weighted scores as the site for this round of speed test;
[0089] Start speed test for this speed test site.
[0090] Steps S201 to S204 in the above method can be summarized as the formal speed measurement stage, expressed as Figure 3 Flowchart style:
[0091] When starting the speed test, the terminal sends a speed test request to the speed test site of this round, and uses the AtomicReference atomic class to abstractly encapsulate the speed test information and record various data separately, such as: the ip address of the speed test site of this round, that is, the Internet Protocol address, the isp information, that is, the Internet provider, the ping delay information, that is, the ping value, that is, the round-trip time of the test data between the terminal and the speed test site of this round, the jetty jitter information, that is, the fluctuation or inconsistency of network delay, the upload speed, that is, the speed at which the terminal sends test data to the speed test site of this round, the download speed, that is, the speed at which the speed test site of this round sends test data to the terminal, the duration of this round of speed test, and the shareUrl address, that is, the webpage address that records the above information so that users can share the speed test results;
[0092] The terminal determines whether the speed measurement is successful based on the completeness of the speed measurement information;
[0093] If successful, the speedbean tool will aggregate the above speed measurement information into a Json string data, which is used to report the information to the business server. Compared with web page sharing and other methods, the Json string data allows the information acquirer to directly conduct comprehensive statistics and analysis on the speed measurement information generated by multiple terminals and multiple speed measurement results;
[0094] If it fails, determine which round of speed measurement this is and compare it with the maximum speed measurement number. If it is greater than the maximum speed measurement number, report the speed measurement failure directly to the terminal display interface and business server; if it is less than the current round of speed measurement and does not reach the maximum speed measurement number, enter the delay waiting;
[0095] During the delay waiting period, no operation is performed, and the current round of speed measurement is executed again after waiting for the preset time.
[0096] In a possible embodiment, the present application provides a storage medium on which a computer program is stored, and when the program is executed by a processor, any of the above methods is implemented.
[0097] In a possible embodiment, the present application further provides a device, including:
[0098] The device includes a memory and a processor;
[0099] A computer program is stored in the memory;
[0100] A processor is used to execute any of the above methods when running a computer program.
[0101] Those skilled in the art will appreciate that the accompanying drawings are merely schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily required for implementing the present invention.
[0102] Those skilled in the art will appreciate that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more devices different from the implementation scenario. The modules in the above implementation scenario can be combined into one module, or can be further split into multiple sub-modules.
[0103] The above serial numbers of the present invention are only for description and do not represent the advantages or disadvantages of the implementation scenarios.
[0104] Disclosed above are only several specific implementation scenarios of the present invention, but the present invention is not limited thereto, and any changes that can be conceived by those skilled in the art should fall within the protection scope of the present invention.
Claims
1. A network speed measurement method, It is characterized in that The network speed measurement method is executed by a terminal, and the network speed measurement method includes: S101: The terminal sends a request to the service server according to a trigger instruction, and obtains a target speed test site file on the service server; S102: Read the target speed test site file, and obtain the first speed test site list and the information of the default speed test site; S103: According to the first screening strategy, remove the information of the default speed test sites that are unavailable and / or have timed out from the first speed test site list to obtain a second speed test site list; S104: adding information of local speed test sites and information of third-party speed test sites, and summarizing them into the second site list to obtain a third speed test site list; S105: selecting, according to the second screening strategy, a pre-selected speed test site with the lowest ping value in the third speed test site list as a speed test site for this round; S201: Sending a speed measurement request to the current round of speed measurement site, and collecting the current round of speed measurement information; S202: Determine whether the current round of speed measurement is successful according to the current round of speed measurement information; if so, generate json string data and report the speed measurement result to the display interface of the terminal or the business server; if not, execute the next step; S203: Determine whether the current round of speed measurement exceeds the maximum number of speed measurement times; if so, stop the speed measurement and report the speed measurement failure to the display interface of the terminal or the service server; if not, execute the next step; S204: Enter delayed waiting, and return to execute S201 after waiting for a predetermined period of time.
2. The network speed measurement method according to claim 1, It is characterized in that In S102, the target speed test site file is read, and information of a first speed test site list and a default speed test site is obtained; including: Record the reading time and compare it with the preset reading time. If the reading time exceeds the preset reading time, stop the current reading behavior and retain the information of the default speed test site that has been read, generate a first speed test site speed test list and add the information of the default speed test site that has been read to it.
3. The network speed measurement method according to claim 2, It is characterized in that The reading duration includes: the reading duration of a single default speed test site; The preset reading duration includes: the preset reading duration of a single default speed measurement site; When the reading time is compared with the preset reading time, the reading time of a single default speed measurement site is compared with the preset reading time of a single default speed measurement site.
4. The network speed measurement method according to claim 2 or 3, It is characterized in that The reading duration includes: the reading duration of the entire target speed test site file; The preset reading duration includes: the preset reading duration of the entire target speed test site file; When the reading duration is compared with the preset reading duration, the reading duration of the entire target speed test site file is compared with the preset reading duration of the entire target speed test site file.
5. The network speed measurement method according to claim 1, It is characterized in that In S103, the first screening strategy includes: based on the network environment where the terminal is located and the IP address and geographical location included in the information of the default speed test site, removing the default speed test site that is unavailable or has timed out.
6. The network speed measurement method according to claim 1, It is characterized in that In S104, the local speed measurement site includes: a speed measurement site deployed in an output port of the operator network where the terminal is located and / or a speed measurement site located in the same geographical range where the terminal is located; The third-party speed measurement site includes: a speed measurement site that is not directly associated with an operating service provider of the operator network where the terminal is located.
7. According to the network speed measurement method of claim 1, It is characterized in that In S105, the pre-selected speed test site with the lowest ping value in the third speed test site list is selected according to the second screening strategy as the speed test site for this round; including: Assign weights to the packet loss rate, bandwidth capacity, geographical proximity, and network jitter of the pre-selected speed test sites in the third speed test list, calculate the weighted score of each pre-selected speed test site, and select the pre-selected speed test site with the lowest ping value among the pre-selected speed test sites with weighted scores in the top 30% as the speed test site for this round.
8. The network speed measurement method according to claim 1, It is characterized in that In S201, collecting the current round of speed measurement information includes: The AtomicReference atomic class is used to collect and record the IP address and ISP information of the speed test site in this round, ping delay information, jetty jitter information, upload speed, download speed, duration of this round of speed test, and shareUrl address.
9. The network speed measurement method according to claim 8, Features: In S202, the json string data is generated by SpeedBean.
10. A device, It is characterized in that include: The device comprises a memory and a processor; The memory stores a computer program; The processor is configured to execute the method according to any one of claims 1 to 9 when running the computer program.
