CN107707423B - Method, system, equipment and storage medium for acquiring network downloading speed - Google Patents

Method, system, equipment and storage medium for acquiring network downloading speed Download PDF

Info

Publication number
CN107707423B
CN107707423B CN201710761485.XA CN201710761485A CN107707423B CN 107707423 B CN107707423 B CN 107707423B CN 201710761485 A CN201710761485 A CN 201710761485A CN 107707423 B CN107707423 B CN 107707423B
Authority
CN
China
Prior art keywords
data
time period
download
thread
speed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710761485.XA
Other languages
Chinese (zh)
Other versions
CN107707423A (en
Inventor
杨弘哲
李振华
万猛
刘爽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Original Assignee
Tsinghua University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tsinghua University filed Critical Tsinghua University
Priority to CN201710761485.XA priority Critical patent/CN107707423B/en
Publication of CN107707423A publication Critical patent/CN107707423A/en
Application granted granted Critical
Publication of CN107707423B publication Critical patent/CN107707423B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • H04L43/0894Packet rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a method, a system, equipment and a storage medium for acquiring network downloading speed, wherein the acquisition method comprises the following steps: downloading two data files simultaneously and respectively in a target network by double threads; periodically acquiring the download data volume of each thread in each time period during which each thread downloads the data file, wherein the time length of each time period is the same; summing the download data volume of each thread in each time period to obtain the total download data volume of the double threads in each time period; and acquiring the standard downloading speed of the target network according to the total amount of the downloaded data of the double threads in each time period. The invention can reliably and quickly measure the speed of the network, effectively solve the problem of inaccurate speed measurement result caused by network fluctuation and ensure the accuracy of the speed measurement result.

Description

Method, system, equipment and storage medium for acquiring network downloading speed
Technical Field
The invention relates to the technical field of network speed measurement, in particular to a method, a system, equipment and a storage medium for acquiring network downloading speed.
Background
With the popularity of networks, more and more network users are concerned about the quality of the networks they use, particularly in industries that are sensitive to network speed.
At present, the existing network speed measuring web page or tool only uses a single thread to directly download files, and intercepts the average downloading speed as the network speed.
Due to reasons such as unstable transmission lines, the network often has network fluctuation phenomenon of on-time break or instantaneous break, and the existing network speed measurement or tool does not consider the influence caused by the network fluctuation; in addition, when a file is downloaded through a network, the speed is usually increased very fast at the beginning, and is slowly reduced at the later stage; or the speed measurement is slow to start, and then the speed measurement is slowly promoted at the later stage, so that the characteristics are still ignored by the speed measurement websites or tools, and the problem of inaccurate speed measurement exists.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a method, a system, equipment and a storage medium for acquiring the network downloading speed, which can reliably and quickly carry out speed measurement on a network, can effectively solve the problem of inaccurate speed measurement result caused by network fluctuation, and ensure the accuracy of the speed measurement result.
In order to solve the technical problems, the invention provides the following technical scheme:
in a first aspect, the present invention provides a method for acquiring a network download speed, where the method includes:
downloading two data files simultaneously and respectively in a target network by double threads;
periodically acquiring the download data volume of each thread in each time period during which each thread downloads the data file, wherein the time length of each time period is the same;
summing the download data volume of each thread in each time period to obtain the total download data volume of the double threads in each time period;
and acquiring the standard downloading speed of the target network according to the total amount of the downloaded data of the double threads in each time period.
Further, before the obtaining the standard download speed of the target network according to the total amount of the download data of the dual threads in each time period, the obtaining method further includes:
generating a download data speed statistical table according to the total download data amount of the double threads in each time period, wherein the download data speed statistical table comprises a one-to-one mapping relation between each time period and the total download data amount of the double threads in each time period;
and screening out the total downloaded data amount in the time period smaller than a first threshold value and the total downloaded data amount in the time period larger than a second threshold value in the downloaded data speed statistical table to obtain an updated downloaded data speed statistical table, wherein the first threshold value is smaller than the second threshold value.
Further, before the obtaining the standard download speed of the target network according to the total amount of the download data of the dual threads in each time period, the obtaining method further includes:
generating a download data speed statistical table according to the total download data amount of the double threads in each time period, wherein the download data speed statistical table comprises a one-to-one mapping relation between each time period and the total download data amount of the double threads in each time period;
sorting the total downloaded data in each time period in the downloaded data speed statistical table according to the data quantity from less to more to obtain a data quantity sorting table;
deleting the data quantity which is equal to the first proportional value in the data quantity sorting table in the sequence from small to large of the data quantity, and deleting the data quantity which is equal to the second proportional value in the data quantity sorting table in the sequence from large to small of the data quantity to obtain an updated data quantity sorting table;
and arranging the updated data quantity sorting table according to the sequence of each time period to obtain an updated download data speed statistical table.
Further, the obtaining the standard download speed of the target network according to the total amount of the download data of the dual threads in each time period includes:
and calculating the average value of the total downloaded data in all time periods in the updated downloaded data speed statistical table, and determining the average value as the standard downloading speed of the target network.
Further, the downloading two data files simultaneously and respectively in the target network with double threads includes:
in a target network, controlling a first terminal to establish a double-thread connection with a second terminal, wherein two data files are stored in the second terminal;
and simultaneously and respectively downloading the two data files in the target network by using the double threads, and respectively and simultaneously starting timing when each thread starts downloading.
Further, the periodically acquiring the download data amount of each thread in each time period during which each thread downloads the data file, where the time length of each time period is the same, includes:
periodically recording the download data amount of each thread in each time period at the same time interval during the downloading of the data files of each thread until the two data files are respectively downloaded, wherein the duration of each time period is equal to the time interval;
and stopping the timing of each thread when the respective thread completes the data download.
Further, the summing the download data amount of each thread in each time period to obtain the total download data amount of the dual threads in each time period includes:
and summing the download data volume of each thread in each time period according to the timing result corresponding to the double threads to obtain the total download data volume of the double threads in each time period.
In a second aspect, the present invention provides a system for acquiring a network download speed, where the speed measurement system includes:
the dual-thread downloading unit is used for simultaneously and respectively downloading two data files in the target network by dual threads;
the download data volume recording unit is used for periodically acquiring the download data volume of each thread in each time period during the respective download data file period, wherein the time length of each time period is the same;
the download data total amount determining unit is used for summing the download data amounts of all threads in each time period to obtain the download data total amount of the double threads in each time period;
and the standard downloading speed determining unit is used for acquiring the standard downloading speed of the target network according to the total amount of the downloaded data of the double threads in each time period.
In a third aspect, the present invention provides an apparatus for acquiring network download speed, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the acquiring method when executing the program.
In a fourth aspect, the invention provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the acquisition method.
According to the technical scheme, the method, the system, the equipment and the storage medium for acquiring the network downloading speed provided by the invention comprise the following steps: downloading two data files simultaneously and respectively in a target network by double threads; periodically acquiring the download data volume of each thread in each time period during which each thread downloads the data file, wherein the time length of each time period is the same; summing the download data volume of each thread in each time period to obtain the total download data volume of the double threads in each time period; and acquiring the standard downloading speed of the target network according to the total amount of the downloaded data of the double threads in each time period. The invention can reliably and quickly measure the speed of the network, can effectively solve the problem of inaccurate speed measurement result caused by network fluctuation, ensures the accuracy of the speed measurement result and further provides reliable guarantee for the stable operation of the network.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a first embodiment of a method for acquiring a network download speed according to the present invention;
FIG. 2 is a flowchart illustrating a second embodiment of a method for acquiring a network download speed according to the present invention;
FIG. 3 is a flowchart illustrating a third embodiment of a method for acquiring a network download speed according to the present invention;
FIG. 4 is a schematic diagram of an application example of the method for acquiring the network download speed according to the present invention;
FIG. 5 is a schematic diagram of a system for acquiring network download speed according to the present invention;
fig. 6 is a schematic structural diagram of a network download speed acquisition device of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An embodiment of the present invention provides a first specific implementation manner of a method for acquiring a network download speed, and referring to fig. 1, the method specifically includes the following steps:
step 100: two data files are simultaneously and respectively downloaded in a target network by double threads.
In step 100, in order to effectively reduce the problem of inaccurate speed measurement result caused by network fluctuation, the network downloading speed obtaining device simultaneously controls the first terminal to download two data files in the second terminal in the target network by using a dual thread (LWP), so that the accuracy of the speed measurement result can be effectively improved because the probability that the two data files have the same network fluctuation at the same time point is very low, that is, the thread TH1 in the first terminal is used for downloading the data file F1, the thread TH2 is used for downloading the data file F2, and the thread TH1 and the thread TH2 start downloading at the same time. It will be appreciated that the first and second terminals may each be a computer or server and that data file F1 and data file F2 are both stored in the second terminal; the data files F1 and F2 may be audio, video, text, etc. and the types of the data files F1 and F2 may be the same or different in this embodiment. And the protocol used by thread TH1 and thread TH2 is downloaded via the uniform Resource locator URL (Uniform Resource locator) of the Hypertext Transfer protocol HTTP (HyperText Transfer protocol).
Step 200: and periodically acquiring the download data amount of each thread in each time period during the respective download data file period, wherein the time length of each time period is the same.
In step 200, the obtaining device of the network download speed periodically obtains the download data amount of each thread in each time period during the respective download data file at the same time interval, and specifically, a timer1 and a timer2 may be respectively set in the thread TH1 and the thread TH 2; such that timer1 and timer2 are used simultaneously and respectively to record the times at which the start of data download and the end of data download by thread TH1 and thread TH2 occur. The duration of the time periods for recording data of the thread TH1 and the thread TH2 is the same, and is equal to the time interval between every two recording actions, so as to ensure that the downloaded data volume of the thread TH1 and the thread TH2 of each time period can be merged subsequently in the time periods with the same duration and time nodes.
For example, if the time interval is set to 0.1 second according to a specific network environment, when data downloading is started at the same time of thread TH1 and thread TH2, timer1 and timer2 are controlled to start timing respectively, and the amount of data downloaded between 0.1 second before the current time and the current time by thread TH1 and thread TH2 is recorded every 0.1 second.
It can be understood that, the thread TH1 and the thread TH2 start data downloading at the same time, and when the thread TH1 and the thread TH2 start data downloading at the same time, the timer1 and the timer2 start timing respectively and simultaneously, but due to the influence of line transmission fluctuation and the difference of data sizes in the data file F1 and the data file F2, the thread TH1 and the thread TH2 may not finish data downloading to the data file F1 and the data file F2 respectively at the same time point, so that the timer1 stops timing when the thread TH1 finishes downloading to the data file F1; when the thread TH2 finishes downloading the data file F2, the timer2 stops counting.
Step 300: and summing the download data volume of each thread in each time period to obtain the total download data volume of the double threads in each time period.
In step 300, the obtaining device of the network download speed sums the download data amount of each thread in each time period to obtain the total download data amount of the dual threads in each time period.
For example, the timer1 and the timer2 start to count at 9:00, wherein the timer1 stops counting when the thread TH1 finishes downloading the data file F1 at 9:10, the timer2 stops counting when the thread TH2 finishes downloading the data file F2 at 9:15, and the time interval and the time period are both 1 minute; selecting the data volume downloaded by the thread TH1 and the thread TH2 recorded between 9:00 and 9:10 for processing, and since the time interval and the time period are all 1 minute, 10 time periods are included between 9:00 and 9:10, adding the data volume downloaded by the thread TH1 and the thread TH2 in each of the 10 time periods to obtain total download data volumes e1, e2, … e10 of the thread TH1 and the thread TH2 in each of the 10 time periods, wherein the total download data volumes of the thread TH1 and the thread TH2 in each of the first time period to the tenth time period in turn are e1, e2, … e 10.
Step 400: and acquiring the standard downloading speed of the target network according to the total amount of the downloaded data of the double threads in each time period.
In step 400, the network download speed obtaining device obtains the standard download speed of the target network according to the total amount of the downloaded data of the dual threads in each time period. Specifically, the total download data amount of the dual threads in each time period may be summed and then averaged, and the obtained average is used as the standard download speed of the target network.
As can be seen from the above description, the method for acquiring network download speed provided in the embodiment of the present invention downloads two files through two threads, and determines the standard download speed of the target network according to the data recording result in the downloading process of the two threads, so as to effectively solve the problem of inaccurate speed measurement result caused by network fluctuation, ensure the accuracy of the speed measurement result, and ensure a reliable and fast speed measurement process.
A second embodiment of the present invention provides a second specific implementation manner of the method for acquiring a network download speed, and referring to fig. 2, the method for acquiring a network download speed further includes the following steps:
between the above steps 300 and 400, the following steps a01 and a02 are performed;
step A01: and generating a download data speed statistical table according to the total download data amount of the double threads in each time period, wherein the download data speed statistical table comprises a one-to-one mapping relation between each time period and the total download data amount of the double threads in each time period.
In step a01, the obtaining device of the network download speed generates a download data speed statistical table according to the total amount of download data of the dual threads in each time period. For example, the download data speed statistical table stores 10 time periods, and further stores total download data amounts e1, e2, … e10 of the thread TH1 and the thread TH2 in each of the 10 time periods, where the e1, e2, … e10 are total download data amounts of the thread TH1 and the thread TH2 in the first time period to the tenth time period in sequence, as shown in table 1:
TABLE 1
First time period e1
A second time period e2
The tenth time period e10
Step A02: and screening out the total downloaded data amount in the time period smaller than a first threshold value and the total downloaded data amount in the time period larger than a second threshold value in the downloaded data speed statistical table to obtain an updated downloaded data speed statistical table, wherein the first threshold value is smaller than the second threshold value.
In step a02, because the data will have unavoidable network fluctuation during network transmission, some values of the downloaded data amount that are significantly smaller or larger than the normal transmission rate range will occur, and therefore, in order to avoid the influence of these abnormal values on the accuracy of network downloading speed acquisition, the network downloading speed acquisition device sifts out the total downloaded data amount in the time period smaller than the first threshold and the total downloaded data amount in the time period larger than the second threshold in the downloaded data speed statistical table, and obtains an updated downloaded data speed statistical table, where the first threshold is smaller than the second threshold. It is understood that the first threshold and the second threshold are both positive integers, and both the first threshold and the second threshold may be preset according to the actual transmission rate of the target network, so as to screen out the total amount of downloaded data that obviously belongs to too small values or too large values in the network fluctuation.
Correspondingly, the specific execution process of step 400 is step 401: and calculating the average value of the total downloaded data in all time periods in the updated downloaded data speed statistical table, and determining the average value as the standard downloading speed of the target network.
As can be seen from the above description, the method for acquiring network download speed provided in the embodiment of the present invention can effectively solve the problem of inaccurate speed measurement result caused by network fluctuation by screening out the total amount of downloaded data in the time period smaller than the first threshold and the total amount of downloaded data in the time period larger than the second threshold in the downloaded data speed statistical table.
A third embodiment of the present invention provides a third specific implementation manner of the method for acquiring a network download speed, and referring to fig. 3, the method for acquiring a network download speed further includes the following steps:
between the above steps 300 and 400, the following steps a01, a03 to a05 are performed;
step A01: and generating a download data speed statistical table according to the total download data amount of the double threads in each time period, wherein the download data speed statistical table comprises a one-to-one mapping relation between each time period and the total download data amount of the double threads in each time period.
Step A03: and sorting the total downloaded data in each time period in the downloaded data speed statistical table according to the data quantity from less to more to obtain a data quantity sorting table.
Step A04: and deleting the data quantity which is equal to the first proportional value in the data quantity sorting table in the sequence from small to large, and deleting the data quantity which is equal to the second proportional value in the data quantity sorting table in the sequence from large to small to obtain the updated data quantity sorting table.
Step A05: and arranging the updated data quantity sorting table according to the sequence of each time period to obtain an updated download data speed statistical table.
Correspondingly, the specific execution process of step 400 is step 401: and calculating the average value of the total downloaded data in all time periods in the updated downloaded data speed statistical table, and determining the average value as the standard downloading speed of the target network.
As can be seen from the foregoing description, in the method for acquiring a network download speed according to the embodiment of the present invention, the data amount equal to the first ratio in the data amount sorting table is deleted in the order from small to large, and the data amount equal to the second ratio in the data amount sorting table is deleted in the order from large to small, so that the problem of inaccurate speed measurement result caused by network fluctuation can be further solved.
In a specific embodiment, the step 100 in the method for acquiring a network download speed specifically includes the following steps:
(1) and in the target network, controlling the first terminal to establish double-thread connection with the second terminal, wherein the second terminal stores two data files.
(2) Two data files are downloaded simultaneously and respectively in a target network by double threads, and timing is started respectively and simultaneously when each thread starts downloading.
Correspondingly, the step 200 in the method for acquiring the network download speed specifically includes the following steps:
(1) and periodically recording the download data amount of each thread in each time period at the same time interval during the downloading of the data files of each thread until the two data files are respectively downloaded, wherein the duration of each time period is equal to the time interval.
(2) And stopping the timing of each thread when the respective thread finishes downloading the data.
Correspondingly, the step 300 in the method for acquiring the network download speed specifically includes the following steps:
and summing the download data volume of each thread in each time period according to the timing result corresponding to the double threads to obtain the total download data volume of the double threads in each time period.
As can be seen from the above description, in the method for acquiring a network download speed in the embodiment of the present invention, the accuracy of subsequently acquiring the total amount of downloaded data in each time period can be ensured by starting timing when each thread starts to download data and finishing timing after finishing downloading data respectively.
To further explain the present solution, the present invention further provides an application example of a method for acquiring a network download speed, which is shown in fig. 4 and specifically includes the following contents:
the application example comprises a client terminal 10 as a first terminal and a server terminal 11 as a second terminal, and the working principle of the method is as follows:
step 201: and when the connection between the client and the server for testing is finished, recording the current time stamp t1 before starting the network downloading speed test.
Step 202: the timestamp t1 begins, and the client uses the double threads th1 and th2 to simultaneously and remotely download two files at the server endf2, the used protocol is downloading through the URL of HTTP, and putting in the container c1 created by ExecutionService starts downloading synchronously.
Step 203: the timer1 and the timer2 are used for recording the accumulated download data amount of the threads th1 and th2 respectively, and the accumulated download data amount of different time periods is recorded in the form of arraylist lists a1 and a 2.
Step 204: the accumulated download data added by the lists a1 and a2 calculates the total download data amount a 3;
step 205: the a3 gets the fastest 10% and the slowest 25% by deleting, and optimizes to get a new result list a4, and then takes the average value as the final result.
From the above description, it can be known that the method for acquiring the network download speed in the application example of the present invention can solve the influence caused by the network fluctuation and the fluctuation of file download transmission, and improve the accuracy of the network speed measurement result.
A fourth embodiment of the present invention provides a specific implementation manner of a system for acquiring a network download speed, which is capable of implementing all steps of the method for acquiring a network download speed, and referring to fig. 5, the system for acquiring a network download speed specifically includes the following contents:
a dual thread download unit 10 for downloading two data files simultaneously and separately in a target network in dual threads.
In the dual thread download unit 10, the dual thread download unit 10 simultaneously controls the first terminal to download two data files in the second terminal in the target network respectively in a dual thread (LWP), i.e., the thread TH1 in the first terminal is used to download the data file F1, the thread TH2 is used to download the data file F2, and the thread TH1 and the thread TH2 start downloading at the same time. It will be appreciated that the first and second terminals may each be a computer or server and that data file F1 and data file F2 are both stored in the second terminal; the data files F1 and F2 may be audio, video, text, etc. and the types of the data files F1 and F2 may be the same or different in this embodiment. And the protocol used by thread TH1 and thread TH2 is downloaded via the uniform Resource locator URL (uniform Resource locator) of the HyperText transfer protocol HTTP (HyperText transfer protocol).
And the download data amount recording unit 20 is configured to periodically obtain download data amounts of the respective threads in respective time periods during respective downloading of the data files, where the time lengths of the respective time periods are the same.
In the download data amount recording unit 20, the download data amount recording unit 20 periodically obtains the download data amount of each thread in each time period during the respective download data file at the same time interval, and specifically, a timer1 and a timer2 may be respectively set in the thread TH1 and the thread TH 2; such that timer1 and timer2 are used simultaneously and respectively to record the times at which the start of data download and the end of data download by thread TH1 and thread TH2 occur. The duration of the time periods for recording data of the thread TH1 and the thread TH2 is the same, and is equal to the time interval between every two recording actions, so as to ensure that the downloaded data volume of the thread TH1 and the thread TH2 of each time period can be merged subsequently in the time periods with the same duration and time nodes.
And a download data total amount determining unit 30, configured to sum the download data amounts of the threads in each time period to obtain the download data total amount of the dual threads in each time period.
And the standard downloading speed determining unit 40 is configured to obtain the standard downloading speed of the target network according to the total amount of the downloaded data of the dual threads in each time period.
The embodiment of the system for acquiring a network download speed provided by the present invention may be specifically configured to execute the processing procedure of the embodiment of the method for acquiring a network download speed, and the functions of the system are not described herein again, and refer to the detailed description of the embodiment of the method.
As can be seen from the above description, the system for acquiring network download speed provided in the embodiment of the present invention downloads two files through two threads, and determines the standard download speed of the target network according to the data recording result in the downloading process of the two threads, so as to effectively solve the problem of inaccurate speed measurement result caused by network fluctuation, ensure the accuracy of the speed measurement result, and ensure a reliable and fast speed measurement process.
An embodiment of the present invention provides a specific implementation manner of a device for acquiring a network download speed, which is capable of implementing all steps of the method for acquiring a network download speed, and referring to fig. 6, the device for acquiring a network download speed specifically includes the following contents:
a processor (processor)601, a memory (memory)602, a communication Interface (Communications Interface)603, and a bus 604;
the processor 601, the memory 602 and the communication interface 603 complete mutual communication through the bus 604; the communication interface 603 is configured to implement information transmission between a first terminal and a second terminal and other related devices;
the processor 601 is configured to call the computer program in the memory 602, and the processor implements all the steps in the first embodiment when executing the computer program, for example, the processor implements the following steps when executing the computer program:
step 100: two data files are simultaneously and respectively downloaded in a target network by double threads.
Step 200: and periodically acquiring the download data amount of each thread in each time period during the respective download data file period, wherein the time length of each time period is the same.
Step 300: and summing the download data volume of each thread in each time period to obtain the total download data volume of the double threads in each time period.
Step 400: and acquiring the standard downloading speed of the target network according to the total amount of the downloaded data of the double threads in each time period.
As can be seen from the above description, the network download speed acquiring device provided in the embodiment of the present invention downloads two files through two threads, and determines the standard download speed of the target network according to the data recording result in the downloading process of the two threads, so as to effectively solve the problem of inaccurate speed measurement result caused by network fluctuation, ensure the accuracy of the speed measurement result, and ensure a reliable and fast speed measurement process.
An embodiment sixth of the present invention provides a specific implementation manner of a computer-readable storage medium capable of implementing all the steps of the above method for acquiring a network download speed, where the computer-readable storage medium stores a computer program, and the computer program implements all the steps of the above first embodiment when executed by a processor, for example, the processor implements the following steps when executing the computer program:
step 100: two data files are simultaneously and respectively downloaded in a target network by double threads.
Step 200: and periodically acquiring the download data amount of each thread in each time period during the respective download data file period, wherein the time length of each time period is the same.
Step 300: and summing the download data volume of each thread in each time period to obtain the total download data volume of the double threads in each time period.
Step 400: and acquiring the standard downloading speed of the target network according to the total amount of the downloaded data of the double threads in each time period.
As can be seen from the above description, the computer-readable storage medium provided in the embodiment of the present invention downloads two files through two threads, and determines the standard downloading speed of the target network according to the data recording result in the downloading process of the two threads, so as to effectively solve the problem of inaccurate speed measurement result caused by network fluctuation, ensure the accuracy of the speed measurement result, and ensure a reliable and fast speed measurement process.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above examples are only for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. A method for acquiring network download speed is characterized in that the method comprises the following steps:
downloading two data files simultaneously and respectively in a target network by double threads;
periodically acquiring the download data volume of each thread in each time period during which each thread downloads the data file, wherein the time length of each time period is the same;
summing the download data volume of each thread in each time period to obtain the total download data volume of the double threads in each time period;
acquiring the standard downloading speed of the target network according to the total amount of the downloaded data of the double threads in each time period;
before the obtaining the standard download speed of the target network according to the total amount of the download data of the dual threads in each time period, the obtaining method further includes:
generating a download data speed statistical table according to the total download data amount of the double threads in each time period, wherein the download data speed statistical table comprises a one-to-one mapping relation between each time period and the total download data amount of the double threads in each time period;
and screening out the total downloaded data amount in the time period smaller than a first threshold value and the total downloaded data amount in the time period larger than a second threshold value in the downloaded data speed statistical table to obtain an updated downloaded data speed statistical table, wherein the first threshold value is smaller than the second threshold value.
2. The method according to claim 1, wherein before the obtaining the standard download speed of the target network according to the total amount of data downloaded by the dual-thread in each time period, the method further comprises:
generating a download data speed statistical table according to the total download data amount of the double threads in each time period, wherein the download data speed statistical table comprises a one-to-one mapping relation between each time period and the total download data amount of the double threads in each time period;
sorting the total downloaded data in each time period in the downloaded data speed statistical table according to the data quantity from less to more to obtain a data quantity sorting table;
deleting the data quantity which is equal to the first proportional value in the data quantity sorting table in the sequence from small to large of the data quantity, and deleting the data quantity which is equal to the second proportional value in the data quantity sorting table in the sequence from large to small of the data quantity to obtain an updated data quantity sorting table;
and arranging the updated data quantity sorting table according to the sequence of each time period to obtain an updated download data speed statistical table.
3. The method according to claim 1 or 2, wherein the obtaining the standard download speed of the target network according to the total amount of the downloaded data of the dual-thread in each time period comprises:
and calculating the average value of the total downloaded data in all time periods in the updated downloaded data speed statistical table, and determining the average value as the standard downloading speed of the target network.
4. The method according to claim 1, wherein the downloading two data files simultaneously and separately in a target network with two threads comprises:
in a target network, controlling a first terminal to establish a double-thread connection with a second terminal, wherein two data files are stored in the second terminal;
and simultaneously and respectively downloading the two data files in the target network by using the double threads, and respectively and simultaneously starting timing when each thread starts downloading.
5. The method according to claim 4, wherein the periodically obtaining the download data amount of each thread in each time period during which each thread downloads the data file, wherein the time duration of each time period is the same, comprises:
periodically recording the download data amount of each thread in each time period at the same time interval during the downloading of the data files of each thread until the two data files are respectively downloaded, wherein the duration of each time period is equal to the time interval;
and stopping the timing of each thread when the respective thread completes the data download.
6. The obtaining method according to claim 5, wherein the summing the download data amount of each thread in each time period to obtain the total download data amount of the dual threads in each time period includes:
and summing the download data volume of each thread in each time period according to the timing result corresponding to the double threads to obtain the total download data volume of the double threads in each time period.
7. A system for acquiring network download speed, the system comprising:
the dual-thread downloading unit is used for simultaneously and respectively downloading two data files in the target network by dual threads;
the download data volume recording unit is used for periodically acquiring the download data volume of each thread in each time period during the respective download data file period, wherein the time length of each time period is the same;
the download data total amount determining unit is used for summing the download data amounts of all threads in each time period to obtain the download data total amount of the double threads in each time period;
the standard downloading speed determining unit is used for acquiring the standard downloading speed of the target network according to the total amount of the downloaded data of the double threads in each time period;
wherein the standard download speed determination unit is further configured to:
generating a download data speed statistical table according to the total download data amount of the double threads in each time period, wherein the download data speed statistical table comprises a one-to-one mapping relation between each time period and the total download data amount of the double threads in each time period;
and screening out the total downloaded data amount in the time period smaller than a first threshold value and the total downloaded data amount in the time period larger than a second threshold value in the downloaded data speed statistical table to obtain an updated downloaded data speed statistical table, wherein the first threshold value is smaller than the second threshold value.
8. An apparatus for acquiring network download speed, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the acquisition method according to any one of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the acquisition method according to any one of claims 1 to 6.
CN201710761485.XA 2017-08-30 2017-08-30 Method, system, equipment and storage medium for acquiring network downloading speed Active CN107707423B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710761485.XA CN107707423B (en) 2017-08-30 2017-08-30 Method, system, equipment and storage medium for acquiring network downloading speed

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710761485.XA CN107707423B (en) 2017-08-30 2017-08-30 Method, system, equipment and storage medium for acquiring network downloading speed

Publications (2)

Publication Number Publication Date
CN107707423A CN107707423A (en) 2018-02-16
CN107707423B true CN107707423B (en) 2019-12-24

Family

ID=61171329

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710761485.XA Active CN107707423B (en) 2017-08-30 2017-08-30 Method, system, equipment and storage medium for acquiring network downloading speed

Country Status (1)

Country Link
CN (1) CN107707423B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105828372A (en) * 2015-01-06 2016-08-03 中国移动通信集团上海有限公司 Method and device for testing wireless network rate and rate testing platform
US9426077B1 (en) * 2015-02-22 2016-08-23 Erik J. Knight Method to improve quality of service for real time internet applications
CN105898790A (en) * 2016-03-24 2016-08-24 中国联合网络通信集团有限公司 Internet speed measuring method and equipment
CN105959159A (en) * 2016-06-30 2016-09-21 天脉聚源(北京)传媒科技有限公司 Network downloading method and device
CN106528245A (en) * 2016-11-25 2017-03-22 广州优视网络科技有限公司 Multi-thread downloading method and device, and computing equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105828372A (en) * 2015-01-06 2016-08-03 中国移动通信集团上海有限公司 Method and device for testing wireless network rate and rate testing platform
US9426077B1 (en) * 2015-02-22 2016-08-23 Erik J. Knight Method to improve quality of service for real time internet applications
CN105898790A (en) * 2016-03-24 2016-08-24 中国联合网络通信集团有限公司 Internet speed measuring method and equipment
CN105959159A (en) * 2016-06-30 2016-09-21 天脉聚源(北京)传媒科技有限公司 Network downloading method and device
CN106528245A (en) * 2016-11-25 2017-03-22 广州优视网络科技有限公司 Multi-thread downloading method and device, and computing equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
NewLife365."网络性能测试工具iperf详细使用图文教程【转载】".《博客园https://www.cnblogs.com/yingsong/p/5682080.html》.2016,正文第1页第5-6页. *

Also Published As

Publication number Publication date
CN107707423A (en) 2018-02-16

Similar Documents

Publication Publication Date Title
US9218199B2 (en) Identifying thread progress information by monitoring transitions between interesting states
CN106506249B (en) Collecting method and device
CN106713456B (en) Network bandwidth statistical method and device
CN109348260B (en) Live broadcast room recommendation method, device, equipment and medium
CN114281648A (en) Data acquisition method and device, electronic equipment and storage medium
CN105653550A (en) Web page filtering method and device
CN110119334B (en) Page script monitoring method and device
US20190089795A1 (en) Communication analysis device, communication analysis method, and program recording medium
CN107707423B (en) Method, system, equipment and storage medium for acquiring network downloading speed
CN106549827A (en) The detection method and device of network state
CN103916463B (en) Network access statistical analysis method and system
JP2015012361A (en) Qoe estimating device, qoe estimating method, and program
CN110543509B (en) Monitoring system, method and device for user access data and electronic equipment
CN110955460B (en) Service process starting method and device, electronic equipment and storage medium
CN113590017A (en) Method, electronic device and computer program product for processing data
CN110391861B (en) Method, device, equipment and storage medium for correcting timer
CN108965386B (en) Identification method and device for shared access terminal
CN110677683A (en) Video storage and video access method and distributed storage and video access system
CN112235402B (en) Network source returning method, network source returning system and related device
CN110572299B (en) Equipment testing method, system, device, network node, terminal and storage medium
CN115103024A (en) Serial number generation method and device, electronic equipment and storage medium
CN115086194A (en) Data transmission method for cloud application, computing equipment and computer storage medium
CN114281504A (en) Task scheduling method and device, electronic equipment and computer readable medium
CN108804195B (en) Page display method and device, server and client
CN113709582A (en) Bandwidth measuring method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant