CN113014443B - Method and system for testing whether CDN (content delivery network) resources hit cache - Google Patents

Method and system for testing whether CDN (content delivery network) resources hit cache Download PDF

Info

Publication number
CN113014443B
CN113014443B CN201911317862.6A CN201911317862A CN113014443B CN 113014443 B CN113014443 B CN 113014443B CN 201911317862 A CN201911317862 A CN 201911317862A CN 113014443 B CN113014443 B CN 113014443B
Authority
CN
China
Prior art keywords
cdn
download
downloading
resource
random file
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
CN201911317862.6A
Other languages
Chinese (zh)
Other versions
CN113014443A (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.)
Fujian Tianquan Educational Technology Ltd
Original Assignee
Fujian Tianquan Educational Technology Ltd
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 Fujian Tianquan Educational Technology Ltd filed Critical Fujian Tianquan Educational Technology Ltd
Priority to CN201911317862.6A priority Critical patent/CN113014443B/en
Publication of CN113014443A publication Critical patent/CN113014443A/en
Application granted granted Critical
Publication of CN113014443B publication Critical patent/CN113014443B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring
    • 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

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 for testing whether CDN resources hit a cache, which comprises the following steps: step S1, creating a random file A with a set size for testing, and uploading the random file A, wherein the random file A is a file for first uploading test; step S2, acquiring a source station resource url for generating the random file A, starting downloading the source station resource url, and acquiring the average downloading speed of the source station resource url; step S3, obtaining a CDN resource url for generating the random file A, starting downloading the CDN resource url, and obtaining the downloading speed of each CDN resource; step S4, comparing the average download speed of the source station resource url with the download speed of each CDN resource, and if the download speed of the CDN resource is greater than the average download speed of the source station resource url and a portion of the download speed of the CDN resource is greater than a threshold M, then the next time of CDN resource download hits in the cache, otherwise, the cache is not hit. The invention can realize automatic test and reduce the cost of artificial verification.

Description

Method and system for testing whether CDN (content delivery network) resources hit cache
Technical Field
The invention relates to the technical field of computer communication, in particular to a method and a system for testing whether CDN resources hit a cache.
Background
The CDN technology is called Content Delivery Network, and the Content Delivery Network distributes Content by means of edge servers deployed in various places, so that a user can obtain required Content nearby, Network congestion is reduced, and the access response speed of the user is improved. The source station is a core in the CDN network, that is, an upper server and a CDN data source, and each machine room node acquires a static file from the source station and accesses the static file for delivery to a user.
The purpose of the CDN hit cache test is mainly to verify that the used CDN capability is normal and effective, and after hitting CDN cache, there is better response efficiency and faster resource download speed than the source station, thereby ensuring high availability of the service party using the CDN capability. In order to ensure that the service is normal, multiple CDN providers are usually accessed to perform failover (switch to the next domain for retry after the request fails), so CDN resource addresses of different CDN providers need to be tested. (pay money to purchase the service of the CDN, do not test and do not know whether the service is effective or not, if the CDN capability does not achieve the expected effect, not only cost money, but also influence the user experience, and the CDN capability accords with the expectation through test acceptance and is worthy of investment.) and test coverage on some scenes with high user experience are carried out for online monitoring, and the problem is perceived in time.
The prior art has the following disadvantages: 1. the CDN test needs to strictly distinguish between the first access and the non-first access, and response times of the two accesses are greatly different, so that it is necessary to ensure that the first download and the non-first download of the CDN resource can be strictly distinguished during the test. 2. Different CDN providers determine whether to hit the cache differently, and after the service accesses multiple CDNs, the service needs to distinguish different CDN providers to make different determinations when testing the CDNs. 3. If the CDN service capability is not normal, if the CDN service capability is verified to be normal in a butt joint test, the CDN effect is found to be not in line with the expectation after one day, and then the CDN service capability is recovered to be normal; such a fluctuating situation is not perceived in time.
Disclosure of Invention
In order to overcome the above problems, the present invention aims to provide a method for testing whether CDN resources hit a cache, which can implement automated testing and reduce the cost of human validation.
The invention is realized by adopting the following scheme: a testing method for whether CDN resources hit a cache or not comprises the following steps:
step S1, creating a random file A with a set size for testing, and uploading the random file A, wherein the random file A is a file for uploading test for the first time;
step S2, acquiring a source station resource url for generating a random file A, starting to download the random file A corresponding to the source station resource url, and acquiring the average download speed of the source station resource url;
step S3, obtaining a CDN resource url for generating a random file A, starting to download the random file A corresponding to the CDN resource url, and obtaining the downloading speed of each CDN resource;
step S4, comparing the average download speed of the source station resource url with the download speed of each CDN resource, and if the download speed of the CDN resource is greater than the average download speed of the source station resource url and a portion of the download speed of the CDN resource is greater than a threshold M, then the next time of CDN resource download hits in the cache, otherwise, the cache is not hit.
Further, the threshold value M is 1000% -1200%.
Further, when the random file a corresponding to the CDN resource url is downloaded for the first time in step S3, the CDN determines whether the random file a exists in the cache, and if the random file a does not exist, the CDN goes to the source station resource url to obtain the random file a and then provides the random file a for the user to download, and if the random file a exists, the random file a corresponding to the CDN resource url is not downloaded for the first time, and the file a is directly returned to the user, where the characteristic of the CDN is a nearby acceleration principle, and the downloading speed can be accelerated.
Further, the step S2 is further specifically: step S21, setting two variables: the total download times B and the initial download times n;
step S22, acquiring a source station resource url for generating the random file A;
step S23, starting to download the random file A corresponding to the source station resource url, judging according to the set values of B and n, if n is less than B, then performing downloading operation, after the downloading is completed, adding 1 to the value of n, and recording the downloading speed C of the downloading operationn(ii) a Until n is equal to or greater than B, the process proceeds to step S24;
step S24, calculating an average download speed D of the resource url of the source station B times, that is, the average download speed D is equal to (C)1+C2+C3+C4+...+Cn) And/n, resetting the value of n to 0.
Further, the step S3 is further specifically: step S31, obtaining a CDN resource url for generating the random file A;
step S32, starting to download the random file A corresponding to the CDN resource url, judging according to the set values of B and n, if n is smaller than B, performing one-time downloading operation, after the downloading is completed, adding 1 to the value of n, and recording the downloading speed E of the downloading requestn(ii) a The download speed of each CDN resource is obtained, and the process proceeds to step S4.
Further, the step S4 is further specifically: step S41, according to the average downloading speed D of the source station resource url and the downloading speed E of the CDN resource each timenMaking a judgment if EnIf the value is larger than D and the value is larger than part of the threshold value M, the download is considered to hit the CDN cache; if E isnIf the download is less than D, the download is not hit in the CDN cache; until n is equal to or greater than B, the process proceeds to step S42;
and step S42, summarizing test data and outputting a test report.
In addition, the invention also provides a test system for whether the CDN resources hit the cache, wherein the test system comprises a test file uploading module, an average downloading speed module for acquiring the url of the source station resources, a downloading speed module for acquiring the CDN resources and a comparison module;
the uploading test file module is used for creating a random file A with a set size for testing and uploading the random file A, wherein the random file A is a file for uploading test for the first time;
the average downloading speed module for acquiring the source station resource url is used for acquiring the source station resource url for generating the random file A, starting to download the random file A corresponding to the source station resource url and acquiring the average downloading speed of the source station resource url;
the download speed module for acquiring the CDN resources is used for acquiring a CDN resource url for generating a random file A, starting to download the random file A corresponding to the CDN resource url, and acquiring the download speed of each CDN resource;
and the comparison module is used for comparing the average downloading speed of the resource url of the source station with the downloading speed of each CDN resource, if the downloading speed of the CDN resources is greater than the average downloading speed of the resource url of the source station and is greater than a part of the average downloading speed of the resource url of the source station and exceeds a threshold value M, the CDN resource downloading of the time is hit in the cache, otherwise, the CDN resources are not hit in the cache.
Further, the threshold value M is 1000% -1200%.
Further, when the random file a corresponding to the CDN resource url is downloaded for the first time in the download speed module for obtaining the CDN resource, the CDN determines whether the random file a exists in the cache, and if the random file a does not exist, the CDN goes to the source station resource url to obtain the random file a and then provides the random file a for the user to download, and if the random file a exists, the random file a corresponding to the CDN resource url is not downloaded for the first time, and the file a is directly returned to the user, where a characteristic of the CDN is a nearby acceleration principle, and the download speed can be accelerated.
Further, the module for obtaining the average download speed of the source station resource url is further specifically: two variables are set: the total downloading times B and the initial downloading times n; acquiring a source station resource url for generating a random file A; starting to download the random file A corresponding to the source station resource url, judging according to the set values of B and n, if n is less than B, performing downloading operation, after the downloading is completed, adding 1 to the value of n, and recording the downloading speed C of the downloading operationn(ii) a Until n is greater than or equal to B; calculating the average downloading speed D of the resource url of the source station B times, namely, the average downloading speed D is equal to (C)1+C2+C3+C4+...+Cn) And/n, resetting the value of n to 0.
Further, the module for acquiring the download speed of the CDN resource is further specifically: obtaining a CDN resource url for generating a random file A;
starting to download a random file A corresponding to a CDN resource url, judging according to the set values of B and n, if n is smaller than B, performing one-time downloading operation, after downloading is completed, adding 1 to the value of n, and recording the downloading speed E of the downloading requestn(ii) a And obtaining the downloading speed of each CDN resource and entering a comparison module.
Further, the comparing module further specifically comprises: according to the average downloading speed D of the source station resource url and the CDN resource downloading speed E of each timenMaking a judgment if EnIf the value is larger than D and the value is larger than part of the threshold value M, the download is considered to hit the CDN cache; if E isnIf the download is smaller than D, the download is not hit in the CDN cache; and summarizing the test data until n is larger than or equal to B, and outputting a test report.
The invention has the beneficial effects that: 1. automatic test reduces the cost of artificial verification. 2. The method can be used for resource downloading tests of all CDN suppliers. 3. And carrying out automatic testing and timing task monitoring, and timely sensing online abnormality.
Drawings
FIG. 1 is a schematic flow diagram of the process of the present invention.
Fig. 2 is a schematic block diagram of the system of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
Referring to fig. 1, a method for testing whether CDN resources hit in a cache according to the present invention includes the following steps:
step S1, creating a random file A with a set size for testing, and uploading the random file A, wherein the random file A is a file for first uploading test; each time a new file is requested to perform testing, the resource used for testing is prevented from being used (if the test file is used by cdn, the resource is downloaded for a non-first time, and the downloading test of cdn has strict differences between the first access and the non-first access, so that certain requirements are made on the test file). Such as creating a txt file of 500M size for upload.
Step S2, obtaining a source station resource url for generating the random file A, (the source station is a service party of CDN service, for example, if the Baidu network disk uses CDN service of network host, the Baidu network disk server is called as the source station), starting to download the random file A corresponding to the source station resource url, and obtaining the average download speed of the source station resource url;
step S3, obtaining a CDN resource url for generating the random file A, starting to download the random file A corresponding to the CDN resource url, and obtaining the downloading speed of each CDN resource; when the random file a corresponding to the CDN resource url is downloaded for the first time in step S3, the CDN makes a determination whether the random file a exists in the cache, and if not, the CDN goes to the source station resource url to obtain the random file a and then provides the random file a for the user to download, and if so, indicates that the random file a corresponding to the CDN resource url is not downloaded for the first time, and directly returns the file a to the user, where the characteristic of the CDN is a principle of near acceleration, and can accelerate the downloading speed.
Step S4, comparing the average downloading speed of the resource url of the source station with the downloading speeds of the CDN resources at each time, and if the downloading speed of the CDN resource is greater than the average downloading speed of the resource url of the source station and partially exceeds a threshold M, where the threshold M is 1000% to 1200%. The next CDN resource download hits the cache, otherwise, the cache is missed.
Further, the step S2 is further specifically: step S21, two variables are set: the total download times B and the initial download times n; total download times B: indicating that the resource is to be downloaded several times; initial download number n: the number of times of downloading is shown, and the method is used for carrying out cyclic judgment, such as: the 1 st download finish n is 1, and the 2 nd download finish n is 2. If B is 5 and n is 1, the same download task will be downloaded 5 times, and 1 download has been completed.
Step S22, acquiring a source station resource url for generating the random file A;
step S23, starting to download the random file A corresponding to the source station resource url, judging according to the set values of B and n, if n is less than B, then performing downloading operation, after the downloading is completed, adding 1 to the value of n, and recording the next timeDownload speed of load operation Cn;(CnWhere the index n indicates the number of downloads, i.e. n in step 21. If B is 5 and n is 1, the first downloading speed is marked as C1(ii) a When n is 2, the second downloading speed is marked as C2(ii) a If n is 5, the speed of 5 th download is marked as C5). Until n is equal to or greater than B, the process proceeds to step S24;
step S24, calculating an average download speed D of the resource url of the source station B times, and if B is equal to 5, the average download speed D is equal to (C)1+C2+C3+C4+C5)/5. I.e. average download speed D ═ C1+C2+C3+C4+...+Cn) And/n, resetting the value of n to 0.
The step S3 further includes: step S31, obtaining a CDN resource url for generating the random file A;
step S32, starting to download the random file A corresponding to the CDN resource url, judging according to the set values of B and n, if n is smaller than B, performing one-time downloading operation, after the downloading is completed, adding 1 to the value of n, and recording the downloading speed E of the downloading requestn(EnWhere the index n indicates the number of downloads. If B is 5 and n is 1, the first downloading speed is recorded as E1(ii) a When n is 2, the second downloading speed is recorded as E2(ii) a If n is 5, the speed of the 5 th download is recorded as E5) (ii) a The download speed of each CDN resource is obtained, and the process proceeds to step S4.
The step S4 further includes: step S41, according to the average downloading speed D of the source station resource url and the downloading speed E of the CDN resource each timenJudging; if EnIf the value is larger than D and the value is larger than the threshold value M, the download is considered to hit the CDN cache (the output result is that the nth download hits the CDN cache); if E isnIf the download is smaller than D, the download is not hit in the CDN cache (the output result is that the nth download is not hit in the CDN cache); until n is equal to or greater than B, the process proceeds to step S42;
and step S42, summarizing test data and outputting a test report.
As shown in fig. 2, the present invention further provides a test system for testing whether the CDN resource hits in the cache, where the test system includes a test file uploading module, an average downloading speed module for obtaining a resource url of the source station, a downloading speed module for obtaining the CDN resource, and a comparison module;
the uploading test file module is used for creating a random file A with a set size for testing and uploading the random file A, wherein the random file A is a file for uploading test for the first time; each time a new file is requested to perform testing, the resource used for testing is prevented from being used (if the test file is used by cdn, the resource is downloaded for a non-first time, and the downloading test of cdn has strict differences between the first access and the non-first access, so that certain requirements are made on the test file). Such as creating a txt file of 500M size for upload.
The average downloading speed module for acquiring the source station resource url is used for acquiring the source station resource url for generating the random file A, starting to download the random file A corresponding to the source station resource url and acquiring the average downloading speed of the source station resource url;
the download speed module for acquiring the CDN resources is used for acquiring a CDN resource url for generating a random file A, starting to download the random file A corresponding to the CDN resource url, and acquiring the download speed of each CDN resource; when the random file A corresponding to the CDN resource url is downloaded for the first time in the download speed module for obtaining the CDN resources, the CDN judges whether the random file A exists in the cache or not, if the random file A does not exist, the CDN goes to the source station resource url to obtain the random file A and then provides the random file A for the user to download, if the random file A exists, the random file A corresponding to the CDN resource url is not downloaded for the first time, the file A is directly returned to the user, and the download speed can be accelerated due to the characteristic of the CDN that the random file A corresponds to the CDN resources url.
And the comparison module is used for comparing the average downloading speed of the resource url of the source station with the downloading speed of each CDN resource, if the downloading speed of the CDN resources is greater than the average downloading speed of the resource url of the source station and is greater than a part of the average downloading speed of the resource url of the source station and exceeds a threshold value M, the CDN resource downloading of the time is hit in the cache, otherwise, the CDN resources are not hit in the cache. Wherein the threshold M is 1000% -1200%.
The module for obtaining the average download speed of the source station resource url is further specifically: two variables are set: the total download times B and the initial download times n; total download times B: indicating that the resource is to be downloaded several times; initial download number n: and indicating the number of times of downloading, and performing cyclic judgment for use, wherein the 1 st downloading completion n is equal to 1, and the 2 nd downloading completion n is equal to 2. If B is 5 and n is 1, the same download task will be downloaded 5 times, and 1 download has been completed.
Acquiring a source station resource url for generating a random file A; starting to download the random file A corresponding to the source station resource url, judging according to the set values of B and n, if n is less than B, performing downloading operation, after the downloading is completed, adding 1 to the value of n, and recording the downloading speed C of the downloading operationn(ii) a Until n is greater than or equal to B; calculating the average downloading speed D of the resource url of the source station B times, namely, the average downloading speed D is equal to (C)1+C2+C3+C4+...+Cn) And/n, resetting the value of n to 0.
Further, the module for acquiring the download speed of the CDN resource is further specifically: obtaining a CDN resource url for generating a random file A;
starting to download a random file A corresponding to a CDN resource url, judging according to the set values of B and n, if n is smaller than B, performing one-time downloading operation, after downloading is completed, adding 1 to the value of n, and recording the downloading speed E of the downloading requestn(ii) a And obtaining the downloading speed of each CDN resource and entering a comparison module.
The comparison module is further specifically: according to the average downloading speed D of the source station resource url and the CDN resource downloading speed E of each timenMake a judgment if EnIf the value is larger than D and the value is larger than part of the threshold value M, the download is considered to hit the CDN cache; if E isnIf the download is smaller than D, the download is not hit in the CDN cache; and summarizing the test data until n is larger than or equal to B, and outputting a test report. Some reports of yields are given in table 1 below:
TABLE 1
Figure BDA0002326330780000081
Figure BDA0002326330780000091
Figure BDA0002326330780000101
In summary, the present invention employs automation instead of human testing. 1. And uploading random temporary files for testing, so that the problems of CDN resources of the first time and non-first time are solved. 2. Calculating the average downloading speed of the resource url of the source station, acquiring the downloading speed of the CDN resource, by calculating the average download speed of the source station resource and the download speed of the cdn resource, if the download speed of cdn resource is greater than the average download speed of the source station, and more than 1000% (why it is 1000%, because of the limitation of the source station and the company network, the download speed is 1M/s at the fastest speed, if the download speed of CDN exceeds 1000% than the speed of the source station, the download speed of CDN inevitably breaks through the limitation of the download speed of the source station, and if 1000% is the average value of multiple CDN service providers), then it is considered that the CDN resource download hits the cache (if the average download speed of 500M resource source station is 1M/s, the speed of the CDN nth download is 20M/s, and the percentage of the excess part is 1900%, more than 1000%, it is considered that CDN nth download hits the cache). The method can be applied to the test of whether the CDN resources of all CDN suppliers hit the cache; the above is automatically verified, and if passed it may be determined cdn that the resource url is available, and cdn that the acceleration effect is valid.
The above description is only a preferred embodiment of the present invention, and all equivalent changes and modifications made in accordance with the claims of the present invention should be covered by the present invention.

Claims (10)

1. A method for testing whether CDN resources hit a cache is characterized in that: the test method comprises the following steps:
step S1, creating a random file A with a set size for testing, and uploading the random file A, wherein the random file A is a file for first uploading test;
step S2, acquiring a source station resource url for generating a random file A, starting to download the random file A corresponding to the source station resource url, and acquiring the average download speed of the source station resource url;
step S3, obtaining a CDN resource url for generating a random file A, starting to download the random file A corresponding to the CDN resource url, and obtaining the downloading speed of each CDN resource; when the random file a corresponding to the CDN resource url is downloaded for the first time in step S3, the CDN determines whether the random file a exists in the cache, and if the random file a does not exist, the CDN goes to the source station resource url to obtain the random file a and then provides the random file a for the user to download, and if the random file a exists, the random file a corresponding to the CDN resource url is not downloaded for the first time, and the file a is directly returned to the user, where the characteristic of the CDN is a nearby acceleration principle, and the downloading speed can be accelerated;
step S4, comparing the average downloading speed of the resource url of the source station with the downloading speed of each CDN resource, if the downloading speed of the CDN resource is greater than the average downloading speed of the resource url of the source station and is greater than a threshold M, then the next time of downloading the CDN resource hits the cache, otherwise, the next time of downloading the CDN resource misses the cache.
2. The method of claim 1 for testing whether CDN resources hit in cache, comprising: the threshold value M is 1000% -1200%.
3. The method of claim 1 for testing whether CDN resources hit in cache, comprising: the step S2 further includes: step S21, setting two variables: the total download times B and the initial download times n;
step S22, acquiring a source station resource url for generating the random file A;
step S23, starting to download the random file A corresponding to the source station resource url, judging according to the set values of B and n, if n is less than B, then performing downloading operation, after the downloading is completed, adding 1 to the value of n, and recording the downloading speed C of the downloading operationn(ii) a Until n is equal to or greater than B, the process proceeds to step S24;
step S24,Calculating the average downloading speed D of the resource url of the source station B times, namely, the average downloading speed D is equal to (C)1+C2+C3+C4+...+Cn) And/n, resetting the value of n to 0.
4. The method of claim 3 for testing whether CDN resources hit in cache, comprising: the step S3 further includes: step S31, obtaining a CDN resource url for generating the random file A;
step S32, starting to download the random file A corresponding to the CDN resource url, judging according to the set values of B and n, if n is smaller than B, performing one-time downloading operation, after the downloading is completed, adding 1 to the value of n, and recording the downloading speed E of the downloading requestn(ii) a The download speed of each CDN resource is obtained, and the process proceeds to step S4.
5. The method of claim 4 for testing whether CDN resources hit in a cache, comprising: the step S4 further includes: step S41, according to the average downloading speed D of the source station resource url and the downloading speed E of the CDN resource each timenMaking a judgment if EnIf the value is larger than D and the value is larger than part of the threshold value M, the download is considered to hit the CDN cache; if E isnIf the download is smaller than D, the download is not hit in the CDN cache; if n is equal to or greater than B, the process proceeds to step S42;
and step S42, summarizing test data and outputting a test report.
6. A test system for whether CDN resources hit a cache is characterized in that: the testing system comprises a test file uploading module, an average downloading speed module for acquiring a resource url of a source station, a downloading speed module for acquiring CDN resources and a comparison module;
the uploading test file module is used for creating a random file A with a set size for testing and uploading the random file A, wherein the random file A is a file for uploading test for the first time;
the average downloading speed module for acquiring the source station resource url is used for acquiring the source station resource url for generating the random file A, starting to download the random file A corresponding to the source station resource url and acquiring the average downloading speed of the source station resource url; the download speed module for acquiring the CDN resources is used for acquiring a CDN resource url for generating a random file A, starting to download the random file A corresponding to the CDN resource url, and acquiring the download speed of each CDN resource; when the random file A corresponding to the CDN resource url is downloaded for the first time in the download speed module for obtaining the CDN resources, the CDN judges whether the random file A exists in a cache or not, if the random file A does not exist, the CDN goes to the source station resource url to obtain the random file A and then provides the random file A for a user to download, if the random file A exists, the random file A corresponding to the CDN resource url is not downloaded for the first time, the file A is directly returned to the user, wherein the characteristic of the CDN is a near acceleration principle and can accelerate the download speed;
and the comparison module is used for comparing the average downloading speed of the resource url of the source station with the downloading speed of each CDN resource, if the downloading speed of the CDN resources is greater than the average downloading speed of the resource url of the source station and is greater than a part of the average downloading speed of the resource url of the source station and exceeds a threshold value M, the CDN resource downloading of the time is hit in the cache, otherwise, the CDN resources are not hit in the cache.
7. The system of claim 6, wherein the testing system for whether the CDN resource hits in the cache comprises: the threshold value M is 1000% -1200%.
8. The system of claim 6, wherein the testing system for whether the CDN resource hits in the cache comprises: the module for obtaining the average download speed of the source station resource url is further specifically: two variables are set: the total download times B and the initial download times n; acquiring a source station resource url for generating a random file A; starting to download the random file A corresponding to the source station resource url, judging according to the set values of B and n, if n is less than B, performing downloading operation, after the downloading is completed, adding 1 to the value of n, and recording the downloading speed C of the downloading operationn(ii) a Until n is greater than or equal to B; calculating the average downloading speed D of the resource url of the source station B times, namely, the average downloading speed D is equal to (C)1+C2+C3+C4+...+Cn) N, mixing nReset to 0.
9. The system of claim 8, wherein the testing system for whether CDN resources hit in the cache comprises: the module for acquiring the download speed of the CDN resource is further specifically: obtaining a CDN resource url for generating a random file A; starting to download a random file A corresponding to a CDN resource url, judging according to the set values of B and n, if n is smaller than B, performing one-time downloading operation, after downloading is completed, adding 1 to the value of n, and recording the downloading speed E of the downloading requestn(ii) a And acquiring the downloading speed of each CDN resource and entering a comparison module.
10. The system of claim 9, wherein the testing system for whether CDN resources hit in the cache comprises: the comparison module is further specifically: according to the average downloading speed D of the resource url of the source station and the downloading speed E of the CDN resource each timenMaking a judgment if EnIf the value is larger than D and the value is larger than part of the threshold value M, the download is considered to hit the CDN cache; if E isnIf the download is less than D, the download is not hit in the CDN cache; and summarizing the test data until n is larger than or equal to B, and outputting a test report.
CN201911317862.6A 2019-12-19 2019-12-19 Method and system for testing whether CDN (content delivery network) resources hit cache Active CN113014443B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911317862.6A CN113014443B (en) 2019-12-19 2019-12-19 Method and system for testing whether CDN (content delivery network) resources hit cache

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911317862.6A CN113014443B (en) 2019-12-19 2019-12-19 Method and system for testing whether CDN (content delivery network) resources hit cache

Publications (2)

Publication Number Publication Date
CN113014443A CN113014443A (en) 2021-06-22
CN113014443B true CN113014443B (en) 2022-07-05

Family

ID=76381494

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911317862.6A Active CN113014443B (en) 2019-12-19 2019-12-19 Method and system for testing whether CDN (content delivery network) resources hit cache

Country Status (1)

Country Link
CN (1) CN113014443B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485921B (en) * 2021-06-30 2023-08-08 网易(杭州)网络有限公司 File system testing method, device, equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102938716B (en) * 2012-12-06 2016-06-01 网宿科技股份有限公司 Content distribution network acceleration test method and device
CN107025234B (en) * 2016-02-01 2020-11-06 中国移动通信集团公司 Information pushing method and cache server
CN108076117B (en) * 2016-11-14 2020-08-25 腾讯科技(深圳)有限公司 Data downloading method and user terminal
CN108200132B (en) * 2017-12-21 2021-06-04 中国平安人寿保险股份有限公司 Resource acquisition method, device, equipment and computer readable storage medium
CN109167820A (en) * 2018-08-13 2019-01-08 彩讯科技股份有限公司 A kind of method for down loading of application program, device, storage medium and terminal

Also Published As

Publication number Publication date
CN113014443A (en) 2021-06-22

Similar Documents

Publication Publication Date Title
CN108829581B (en) Application program testing method and device, computer equipment and storage medium
CN104618226B (en) A kind of information processing method, client and server
CN105279087B (en) Apply method of testing and test system in test software
CN111615716B (en) Allocating shaders among client machines for pre-caching
US9329961B2 (en) Testing development using real-time traffic
CN110781083B (en) H5 client code setting multi-environment testing method and system
CN109166040B (en) Transaction auditing method, device, equipment and storage medium based on block chain
CN111159000B (en) Server performance test method, device, equipment and storage medium
CN107682361A (en) Website vulnerability scan method, device, computer equipment and storage medium
CN111711544A (en) Link dial testing method and device, electronic equipment and storage medium
CN113014443B (en) Method and system for testing whether CDN (content delivery network) resources hit cache
CN108924159A (en) The verification method and device in a kind of message characteristic identification library
CN108512682B (en) Method and device for determining false terminal identification
CN105117340A (en) URL (Uniform Resource Locator) detection method and device used for quality evaluation of iOS browser application
CN109522202B (en) Software testing method and device
CN104348815A (en) Method and device for verifying verification code
CN105184559A (en) System and method for payment
CN112422604B (en) File uploading method, device and system and computer equipment
CN115694699A (en) Time delay parameter acquisition method and device, electronic equipment and storage medium
CN108574610B (en) Pressure testing method and device, electronic equipment and medium
CN110134558A (en) A kind of detection method and device of server
CN110716730A (en) Gray scale distribution method, device, equipment and computer readable storage medium
CN111078527B (en) Auxiliary system and method for pressure testing of server
CN106790322B (en) Cache strategy forming method and device
CN110061864B (en) Method and system for automatically verifying domain name configuration

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