[go: nahoru, domu]

CN107678945B - Method and device for judging webpage application blocking - Google Patents

Method and device for judging webpage application blocking Download PDF

Info

Publication number
CN107678945B
CN107678945B CN201710786484.0A CN201710786484A CN107678945B CN 107678945 B CN107678945 B CN 107678945B CN 201710786484 A CN201710786484 A CN 201710786484A CN 107678945 B CN107678945 B CN 107678945B
Authority
CN
China
Prior art keywords
time
blocking
tested
calculating
duration
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
CN201710786484.0A
Other languages
Chinese (zh)
Other versions
CN107678945A (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 CN201710786484.0A priority Critical patent/CN107678945B/en
Publication of CN107678945A publication Critical patent/CN107678945A/en
Application granted granted Critical
Publication of CN107678945B publication Critical patent/CN107678945B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention provides a method and a device for judging webpage application blocking. The method comprises the following steps: initializing a network to be testedPage application, obtaining initial time T0(ii) a From an initial time T0At the beginning, a preset masking time period TsInternally shielding the webpage application to be tested; from an initial time T0Starting, and ending the operation of the webpage application to be tested at a preset interval duration TmIf judging to know that the CPU is in a non-blocking state, acquiring the current time T of the ith timeiWherein T iss>2TmI is a positive integer greater than 0; according to the current time TiAnd an initial time T0Determining a blocking duration Ta(ii) a According to the blocking duration TaAnd judging whether the webpage application to be tested is blocked or not by a preset threshold value. According to the method and the device, the blocking time length is determined according to the current time and the initial time which are obtained periodically, whether the webpage application to be tested is blocked or not is judged according to the blocking time length, the judging mode of the blocking of the webpage application is quantized, and the accuracy of judging the blocking of the webpage application is improved.

Description

Method and device for judging webpage application blocking
Technical Field
The embodiment of the invention relates to the technical field of Internet, in particular to a method and a device for judging webpage application blocking.
Background
The web application is a technology that internet development cannot be separated, at present, a browser generally adopts a multi-process architecture, an independent process is allocated to each web application, the process bears a plurality of tasks, such as resource loading, DOM tree building and the like, wherein the process allocates an independent thread to JavaScript, particularly, the JavaScript is a single-thread and blocking type scripting language, asynchronous operation is blocked due to intensive CPU calculation, user interaction cannot be responded, and the whole page falls into a non-response state. The web application developer needs to screen out blocking operations and optimize the blocking operations to prevent the web application from generating no response.
The existing method for judging whether the webpage application is blocked generally judges whether the webpage application is blocked according to the fact that whether the time of a browser responding to user operation is too long or not by a tester subjectively, however, the judging method is not visual enough and depends on the subjective judgment of the tester, and troubles are caused for a developer to optimize the webpage application in the later period.
Disclosure of Invention
Aiming at the defects in the prior art, the embodiment of the invention provides a method and a device for judging webpage application blocking.
In a first aspect, an embodiment of the present invention provides a method for determining blocking of a web application, including:
initializing the webpage application to be tested and obtaining an initial time T0
From the initial time T0At the beginning, a preset masking time period TsInternally shielding the webpage application to be tested;
from the initial time T0Starting, and ending the operation of the webpage application to be tested at a preset interval duration TmIf the CPU is judged to be in the non-blocking state, the current time T of the ith time is acquirediWherein T iss>2TmI is a positive integer greater than 0;
according to the current time TiAnd said initial time T0Determining a blocking duration Ta
According to said blocking duration TaAnd judging whether the webpage application to be tested is blocked or not by a preset threshold value.
In a second aspect, an embodiment of the present invention provides an apparatus for determining blocking of a web application, including:
an initialization module for initializing the application of the web page to be tested and obtaining an initial time T0
A shielding module for shielding the signal from the initial time T0At the beginning, a preset masking time period TsInternally shielding the webpage application to be tested;
a trigger module for starting from the initial time T0Starting, and ending the operation of the webpage application to be tested at a preset interval duration TmIf the CPU is judged to be in the non-blocking state, the current time T of the ith time is acquirediWherein T iss>2TmI is a positive integer greater than 0;
a calculation module for calculating the current time TiAnd said initial time T0Determining a blocking duration Ta
A judging module for judging the blocking duration TaAnd judging whether the webpage application to be tested is blocked or not by a preset threshold value.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
the processor and the memory are communicated with each other through a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform a method comprising: initializing the webpage application to be tested and obtaining an initial time T0(ii) a From the initial time T0At the beginning, a preset masking time period TsInternally shielding the webpage application to be tested; from the initial time T0Starting, and ending the operation of the webpage application to be tested at a preset interval duration TmIf the CPU is judged to be in the non-blocking state, the current time T of the ith time is acquirediWherein T iss>2TmI is a positive integer greater than 0; according to the current time TiAnd said initial time T0Determining a blocking duration Ta(ii) a According to said blocking duration TaAnd judging whether the webpage application to be tested is blocked or not by a preset threshold value.
In a fourth aspect, an embodiment of the present invention provides a storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following method: initializing the webpage application to be tested and obtaining an initial time T0(ii) a From the initial time T0At the beginning, a preset masking time period TsInternally shielding the webpage application to be tested; from the initial time T0Starting, and ending the operation of the webpage application to be tested at a preset interval duration TmIf the CPU is judged to be in the non-blocking state, the current time T of the ith time is acquirediWherein T iss>2TmI is largeA positive integer at 0; according to the current time TiAnd said initial time T0Determining a blocking duration Ta(ii) a According to said blocking duration TaAnd judging whether the webpage application to be tested is blocked or not by a preset threshold value.
According to the method for judging the blocking of the webpage application, provided by the embodiment of the invention, the blocking time length is determined through the current time and the initial time which are periodically obtained, whether the webpage application to be tested is blocked is judged according to the blocking time length, and the judging mode of the blocking of the webpage application is quantized, so that the judging mode is more objective, the accuracy of judging the blocking of the webpage application is improved, and the method is compatible with the JavaScript language standard, is suitable for the webpage application of a mainstream browser, and has universality.
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 described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for determining blocking of a web application according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a device for determining blocking of a web application according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment 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.
Fig. 1 is a schematic flow chart of a method for determining blocking of a web application according to an embodiment of the present invention, as shown in fig. 1, the method includes:
step S11, initializing the webpage application to be tested, and obtaining the initial time T0
Generally, a browser opens a process for each webpage application, the process is used for webpage application operations such as loading webpage application resources and building a DOM tree, and when a large number of webpage applications need to be opened, the browser opens two or more webpage applications in the same process. In the embodiment of the invention, the browser opens the webpage application to be tested in a single process, completes the initialization of the webpage application and acquires the current time T0Is recorded as an initial time T0. Specifically, the browser may open a small number of web applications, such that each web application is opened in a single process, for example, the browser opens 5 web applications and then opens the web application to be tested, or the browser only opens the web application to be tested, completes the initialization operation of the web application to be tested, and then obtains the initial time T0
Step S12, starting from the initial time T0At the beginning, a preset masking time period TsInternally shielding the webpage application to be tested;
specifically, after the initialization of the webpage application is completed, the preset shielding duration T of the application to be tested is shieldedsI.e. from an initial time T0At the beginning, from time T0+TsAnd shielding the application to be tested. And after the shielding time is over, awakening the application to be tested. For example, after the web application is opened, the web application is shielded to receive the function of the user operation, and the shielding time reaches the preset shielding time TsAnd then, the awakening webpage application receives the function operated by the user.
Step S13, starting from the initial time T0Starting, and ending the operation of the webpage application to be tested at a preset interval duration TmIf the CPU is judged to be in the non-blocking state, the current time T of the ith time is acquirediWherein T iss>2TmI is a positive integer greater than 0;
specifically, after the web application initialization is completed, the initial time T is reached0Starting, after the webpage application to be tested is awakened, the running of the webpage application is ended, and the time length T of each preset interval ismObtaining the CPU state, if the CPU is in the non-blocking state, obtaining the current time T of the ith timeiWherein, Ts>2Tm
For example, the browser opens the application of the web page to be tested in a single process, and obtains the initial time T0Is 10: 00: 00, preset masking duration TsIs 17s, the preset interval duration Tm5s, the webpage application is woken up and runs for 10s, and then the operation time is changed from 10: 00: 00, shielding the webpage application to be tested, 10: 00: when the CPU is in a non-blocking state at 05, T110: 00: 05, 10: 00: 10 time CPU is in blocking state, does not obtain time, 10: 00: 15 time CPU is in non-blocking state, then T210: 00: 15, 10: 00: 20 time CPU is in blocking state, 10: 00: when the CPU is in a non-blocking state at 25 hours, T310: 00: 25, 10: 00: when the webpage application is finished in 30 hours, the current time is not acquired any more, so that 4 times, T, can be acquired0=10:00:00,T1=10:00:05,T210: 00: 15 and T310: 00: 25, wherein T0Is the initial time. In practical applications, the running time of the web application can be obtained from web application test data, or can be set by an empirical value.
Step S14, according to the current time TiAnd said initial time T0Determining a blocking duration Ta
Specifically, according to the obtained current time TiAnd an initial time T0Determining a blocking duration TaE.g. T0=10:00:00,T1=10:00:05,T210: 00: 15 and T310: 00: 25, T can be calculatedi-T0A plurality of difference values are obtained, and then the blocking duration T can be determined according to the difference valuesaFor example, the average or weighted average of the differences may be used as the blocking period TaTo this end, the embodiments of the present invention do notAnd (4) limiting.
Step S15, according to the blocking duration TaAnd judging whether the webpage application to be tested is blocked or not by a preset threshold value.
In particular, according to the blocking duration TaAnd a preset threshold value is used for judging whether the webpage application to be tested is blocked, for example, if the preset threshold value is 20s, the blocking time length T isaMore than 20s indicates that the webpage application to be tested is blocked and the blocking time length TaIf the time is not more than 20s, it indicates that the webpage application to be tested is not blocked, where the preset threshold may be set according to experience, which is not limited in the embodiment of the present invention.
In practical application, the judging method of the embodiment of the invention can be embedded into a browser as a test function, when the webpage application needs to be blocked and judged, the test function is triggered periodically to obtain the judgment result of the blocking of the webpage application, and the embodiment of the invention is suitable for judging whether the webpage application of a mainstream browser is blocked or not because the test function is compatible with the JavaScript language standard.
In practical application, only a certain function of the web application can be shielded, the function blocking time is calculated, and whether the function causes the blocking of the web application or not is judged.
According to the method for judging the blocking of the webpage application, provided by the embodiment of the invention, the blocking time length is determined through the current time and the initial time which are periodically obtained, whether the webpage application to be tested is blocked is judged according to the blocking time length, and the judging mode of the blocking of the webpage application is quantized, so that the judging mode is more objective, the accuracy of judging the blocking of the webpage application is improved, and the method is compatible with the JavaScript language standard, is suitable for the webpage application of a mainstream browser, and has universality.
On the basis of the above embodiment, further, the current time T is determined according toiAnd said initial time T0Determining a blocking duration TaThe method comprises the following steps:
according to the current time TiAnd said initial time T0Determining a first time length Ri
For the first time length RiDenoising to obtain a second time length Si
According to the second duration SiCalculating the blocking duration T of the webpage to be testeda
In particular, according to formula Ri=Ti-T0Calculating a first time duration RiE.g. T0=10:00:00,T1=10:00:05,T210: 00: 15 and T310: 00: 25, then R1=5s,R2=15s,R325s, due to the first time length RiThe method comprises the time acquired in the shielded time period of the webpage application, the time is irrelevant to the webpage application to be tested, and in order to improve the accuracy of the webpage application blocking judgment method, the first time length R is requirediDenoising to obtain a second time length SiTherefore, even if other webpage applications are operated during the period that the webpage application to be tested is shielded, the judgment on whether the webpage application to be tested is blocked or not is not influenced. For example R1Is S after denoising1,R2Is S after denoising2,R3Is S after denoising3Then according to a second duration SiCalculating the blocking duration T of the webpage to be testeda. For example, S1=4s,S2=14s,S3And 24s, calculating the blocking time T of the webpage to be tested according to 4s, 14s and 24sa
According to the method for judging the blocking of the webpage application, provided by the embodiment of the invention, the second time length is obtained by denoising the first time length, the blocking time of the webpage application to be tested is determined according to the second time length, the method is suitable for various webpage application scenes, and the accuracy of judging the blocking of the webpage application is improved.
In addition to the above embodiments, further, the pair of the first time periods RiDenoising to obtain a second time length SiThe method comprises the following steps:
printing the first time length R on the digit axis Li
On said number axis L, calculating Ri+1And RiIs 0. ltoreq.R, v1, wherei≤TsAnd R is not less than 0i+1≤Ts
According to the formula n-v 1-TmCalculating a noise value n;
the first time length R is measured on the axis LiTranslating n units to the direction of the origin to obtain a second time length Si
Specifically, the printing coordinates are of a first time length R on the digit axis LiI, the number axis L is the first time length RiThen on the number axis L, calculate Ri+1And RiOf (d), e.g. difference ai=Ri+1-RiThen calculate aiAverage value of v1, wherein Ri+1And RiAre all in the interval [0, Ts]Internal, i.e. 0. ltoreq.Ri≤TsAnd R is not less than 0i+1≤TsThen according to the formula n-v 1-TmCalculating the noise value n, i.e. in the interval 0, Ts]Applying a blocking time length n generated at the shielded moment to the intranet page, and finally applying a first time length R on a numerical axis LiTranslating the sample to the original point direction by n units, wherein the first time length R after translationiFor a second duration Si
For example, the preset interval duration TmIs 2s, the shielding time length T is presets9s, the actual running time of the webpage application is 12s, R1=2s,R2=6s,R3=8s,R4=10s,R5=12s,R6=18s,R7After 20s, then calculate R within 0-9si+1And RiA difference of1=4s,a22s, the average value v1 of the difference is 3s, after which the noise value n 3s-2s 1s is calculated, the noise value 1s, and then R is plotted on the axis LiTranslating n units to the direction of the origin to obtain S1=1s,S2=5s,S3=7s,S4=9s,S5=11s,S6=17s,S719S, and finally according to a second duration SiCalculating the blocking time T of the webpage to be testeda
According to the method for judging the blocking of the webpage application, provided by the embodiment of the invention, the second time length is obtained by denoising the first time length, and the blocking time of the webpage application to be tested is determined according to the second time length, so that the influence of noise on the webpage application to be tested is reduced, the method is suitable for various webpage application scenes, and the accuracy of judging the blocking of the webpage application is improved.
On the basis of the above embodiments, further, the time length S is determined according to the second time length SiCalculating the blocking duration T of the webpage to be testedaThe method comprises the following steps:
on said number axis L, calculate Si+1And SiIs determined by the average value v2 of the difference of (a), wherein Si>Ts
According to the formula Ta=v2-TmCalculating the blocking duration T of the webpage to be testeda
Specifically, on the numerical axis L, the calculation satisfies Si>TsS under the conditioni+1And SiDifference b ofiThen calculate biV2, then according to the formula Ta=v2-TmCalculating the blocking time T of the webpage to be testedaThen according to TaWhether the threshold value is larger than a preset threshold value Th or not is judged, wherein bi-TmThe maximum value of (d) is the longest delay of the web application blocking.
For example, S1=1s,S2=5s,S3=7s,S4=9s,S5=11s,S6=17s,S7=19s,Ts=9s,Tm2s, then b1=11s-9s=2s,b2=6s,b32s, average value v2 10/3s, blocking duration Ta10/3s-2s 4/3s, and then 4/3s is determined as a function of a predetermined threshold to determine if the web page to be tested is blocked, wherein b is2-Tm4s is the longest delay of the web page application blocking.
According to the method for judging the blocking of the webpage application, whether the webpage application to be tested is blocked or not is judged according to the blocking duration of the webpage application to be tested, the judging mode of the blocking of the webpage application is quantized, the method is suitable for various webpage application scenes, the accuracy of judging the blocking of the webpage application is improved, the longest delay of the blocking of the webpage application can be obtained, and the webpage application can be optimized by developers in the later period conveniently.
Fig. 2 is a schematic structural diagram of a device for determining blocking of a web application according to an embodiment of the present invention, and as shown in fig. 2, the device includes: an initialization module 21, a shielding module 22, a triggering module 23, a calculation module 24 and a judgment module 25, wherein:
the initialization module 21 is used for initializing the web application to be tested and obtaining an initial time T0(ii) a The shielding module 22 is used for the initial time T0At the beginning, a preset masking time period TsInternally shielding the webpage application to be tested; the trigger module 23 is configured to start from the initial time T0Starting, and ending the operation of the webpage application to be tested at a preset interval duration TmIf the CPU is judged to be in the non-blocking state, the current time T of the ith time is acquirediWherein T iss>2TmI is a positive integer greater than 0; the calculation module 24 is configured to calculate the current time TiAnd said initial time T0Determining a blocking duration Ta(ii) a The judging module 25 is configured to determine the blocking duration T according to the blocking duration TaAnd judging whether the webpage application to be tested is blocked or not by a preset threshold value.
Specifically, the initialization module 21 opens the web application to be tested in a single process, completes the initialization of the web application, and obtains the current time T0Is recorded as an initial time T0. The shielding module 22 shields the application to be tested for a preset shielding duration TsI.e. from an initial time T0At the beginning, from time T0+TsAnd shielding the application to be tested. After the masking period has elapsed, the masking module 22 wakes up the application to be tested. After the initialization of the webpage application is completed, the initial time T is reached0Starting, after the webpage application to be tested is awakened, the running of the webpage application is ended, and the trigger module 23 keeps a preset interval duration T at every intervalmObtaining the CPU state, if the CPU is in the non-blocking state, obtaining the current time T of the ith timeiWherein, Ts>2Tm. The calculation module 24 obtains the current time TiAnd an initial time T0Determining a blocking duration TaThe judging module 25 is used for judging the blocking duration TaAnd a preset threshold value is used for judging whether the webpage application to be tested is blocked, for example, if the preset threshold value is 20s, the blocking time length T isaMore than 20s indicates that the webpage application to be tested is blocked and the blocking time length TaIf the time is not more than 20s, it indicates that the webpage application to be tested is not blocked, where the preset threshold may be set according to experience, which is not limited in the embodiment of the present invention. The functions of the apparatus provided in the embodiment of the present invention refer to the above method embodiments specifically, and are not described herein again.
The device for judging the blocking of the webpage application determines the blocking time length through the current time and the initial time which are obtained periodically, judges whether the webpage application to be tested is blocked or not according to the blocking time length, quantifies the judging mode of the blocking of the webpage application, enables the judging process to be more objective, is compatible with the JavaScript language standard, is suitable for the webpage application of a mainstream browser, and has universality.
On the basis of the foregoing embodiment, further, the calculation module includes:
a first calculating unit for calculating the current time TiAnd said initial time T0Determining a first time length Ri
A de-noising unit for de-noising the first time length RiDenoising to obtain a second time length Si
A second calculation unit for calculating the second duration SiCalculating the blocking duration T of the webpage to be testeda
In particular, the first calculation unit is according to formula Ri=Ti-T0Calculating a first time duration RiE.g. T0=10:00:00,T1=10:00:05,T210: 00: 15 and T310: 00: 25, then R1=5s,R2=15s,R325s, the denoising unit pairs the first time length RiDenoising to obtain a second time length SiTherefore, even if other webpage applications are operated during the period that the webpage application to be tested is shielded, the judgment on whether the webpage application to be tested is blocked or not is not influenced. For example R1Is S after denoising1,R2Is S after denoising2,R3Is S after denoising3Then the second calculating unit calculates the second time length SiCalculating the blocking duration T of the webpage to be testeda. For example, S1=4s,S2=14s,S3The second calculation unit calculates the blocking time T of the web page to be tested according to 4s, 14s and 24s when the time T is 24sa. The functions of the apparatus provided in the embodiment of the present invention refer to the above method embodiments specifically, and are not described herein again.
According to the device for judging the blocking of the webpage application, provided by the embodiment of the invention, the second time length is obtained by denoising the first time length, the blocking time of the webpage application to be tested is determined according to the second time length, the device is suitable for various webpage application scenes, and the accuracy of judging the blocking of the webpage application is improved.
On the basis of the foregoing embodiments, further, the denoising unit includes:
a printing subunit for printing the first time length R on a number axis Li
A first average value calculating subunit for calculating R on the number axis Li+1And RiIs 0. ltoreq.R, v1, wherei≤TsAnd R is not less than 0i+1≤Ts
A noise calculation subunit for calculating a noise according to the formula n-v 1-TmCalculating a noise value n;
a translation subunit for translating the first time length R on the number axis LiTranslating n units to the direction of the origin to obtain a second time length Si
Specifically, the printing subunit prints the first time length R on the number axis L at the coordinatesiI, the number axis L is the first time length RiThen the first average value calculating subunit calculates R on the number axis Li+1And RiOf (d), e.g. difference ai=Ri+1-RiThen calculate aiAverage value of v1, wherein Ri+1And RiAre all in the interval [0, Ts]Internal, i.e. 0. ltoreq.Ri≤TsAnd R is not less than 0i+1≤TsThe noise calculation subunit then calculates the noise according to the formula n-v 1-TmCalculating the noise value n, i.e. in the interval 0, Ts]Applying the blocking time n generated by the shielded time to the intranet page, and finally translating the subunit to obtain the first time length R on the number axis LiTranslating the sample to the original point direction by n units, wherein the first time length R after translationiFor a second duration Si. The functions of the apparatus provided in the embodiment of the present invention refer to the above method embodiments specifically, and are not described herein again.
According to the device for judging the blocking of the webpage application, provided by the embodiment of the invention, the second time length is obtained by denoising the first time length, and the blocking time of the webpage application to be tested is determined according to the second time length, so that the influence of noise on the webpage application to be tested is reduced, the device is suitable for various webpage application scenes, and the accuracy of judging the blocking of the webpage application is improved.
On the basis of the foregoing embodiments, further, the second calculation unit includes:
a second average value calculating subunit for calculating S on the number axis Li+1And SiIs determined by the average value v2 of the difference of (a), wherein Si>Ts
A blocking duration calculating subunit for calculating the blocking duration according to the formula Ta=v2-TmCalculating the blocking duration T of the webpage to be testeda
Specifically, the second average value calculating subunit calculates the second average value on the number axis L, and the calculation satisfies Si>TsS under the conditioni+1And SiDifference b ofiThen calculate biV2, after which the blocking duration calculation subunit calculates the blocking duration according to the formula Ta=v2-TmCalculating the blocking time T of the webpage to be testedaThen according to TaWhether the threshold value is larger than a preset threshold value Th or not is judged, wherein bi-TmThe maximum value of (d) is the longest delay of the web application blocking. The functions of the apparatus provided in the embodiment of the present invention refer to the above method embodiments specifically, and are not described herein again.
The device for judging the blocking of the webpage application provided by the embodiment of the invention judges whether the webpage application to be tested is blocked or not according to the blocking time of the webpage application to be tested, quantifies the judging mode of the blocking of the webpage application, is suitable for various webpage application scenes, improves the accuracy of judging the blocking of the webpage application, can obtain the longest time delay of the blocking of the webpage application, and is convenient for developers to optimize the webpage application in the later period.
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 3, the electronic device includes: a processor (processor)301, a memory (memory)302, and a bus 303;
the processor 301 and the memory 302 complete communication with each other through the bus 303;
processor 301 is configured to call program instructions in memory 302 to perform the methods provided by the various method embodiments described above, including, for example: initializing the webpage application to be tested and obtaining an initial time T0(ii) a From the initial time T0At the beginning, a preset masking time period TsInternally shielding the webpage application to be tested; from the initial time T0Starting, and ending the operation of the webpage application to be tested at a preset interval duration TmIf the CPU is judged to be in the non-blocking state, the current time T of the ith time is acquirediWherein T iss>2TmI is a positive integer greater than 0; according to the current time TiAnd said initial time T0Determining a blocking duration Ta(ii) a According to said blocking duration TaAnd judging whether the webpage application to be tested is blocked or not by a preset threshold value.
An embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer can execute the methods provided by the above method embodiments, for example, the method includes: initializing the webpage application to be tested and obtaining an initial time T0(ii) a From the initial time T0At the beginning, a preset masking time period TsInternally shielding the webpage application to be tested; from the initial time T0To get atThe running of the webpage application to be tested is finished, and the time length T of each preset interval ismIf the CPU is judged to be in the non-blocking state, the current time T of the ith time is acquirediWherein T iss>2TmI is a positive integer greater than 0; according to the current time TiAnd said initial time T0Determining a blocking duration Ta(ii) a According to said blocking duration TaAnd judging whether the webpage application to be tested is blocked or not by a preset threshold value.
Embodiments of the present invention provide a non-transitory computer-readable storage medium, which stores computer instructions, where the computer instructions cause the computer to perform the methods provided by the above method embodiments, for example, the methods include: initializing the webpage application to be tested and obtaining an initial time T0(ii) a From the initial time T0At the beginning, a preset masking time period TsInternally shielding the webpage application to be tested; from the initial time T0Starting, and ending the operation of the webpage application to be tested at a preset interval duration TmIf the CPU is judged to be in the non-blocking state, the current time T of the ith time is acquirediWherein T iss>2TmI is a positive integer greater than 0; according to the current time TiAnd said initial time T0Determining a blocking duration Ta(ii) a According to said blocking duration TaAnd judging whether the webpage application to be tested is blocked or not by a preset threshold value.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above-described embodiments of the apparatuses and the like are merely illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present invention, and are not limited thereto; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for judging webpage application blocking is characterized by comprising the following steps:
initializing the webpage application to be tested and obtaining an initial time T0
From the initial time T0At the beginning, a preset masking time period TsInternally shielding the webpage application to be tested;
from the initial time T0To the network to be testedEnding the running of the page application, and presetting interval duration T at intervalsmIf judging to know that the CPU is in a non-blocking state, acquiring the current time T of the ith timeiWherein T iss>2TmI is a positive integer greater than 0;
according to the current time TiAnd said initial time T0Determining a blocking duration Ta
According to said blocking duration TaAnd judging whether the webpage application to be tested is blocked or not by a preset threshold value.
2. Method according to claim 1, characterised in that said reference is made according to said current moment TiAnd said initial time T0Determining a blocking duration TaThe method comprises the following steps:
according to the current time TiAnd said initial time T0Determining a first time length Ri
For the first time length RiDenoising to obtain a second time length Si
According to the second duration SiCalculating the blocking duration T of the webpage to be testeda
3. The method of claim 2, wherein the pair of the first time periods RiDenoising to obtain a second time length SiThe method comprises the following steps:
printing the first time length R on the digit axis Li
On said number axis L, calculating Ri+1And RiIs 0. ltoreq.R, v1, wherei≤TsAnd R is not less than 0i+1≤Ts
According to the formula n-v 1-TmCalculating a noise value n;
the first time length R is measured on the axis LiTranslating n units to the direction of the origin to obtain a second time length Si
4. A method according to claim 3, characterized in thatAccording to the second duration SiCalculating the blocking duration T of the webpage to be testedaThe method comprises the following steps:
on said number axis L, calculate Si+1And SiIs determined by the average value v2 of the difference of (a), wherein Si>Ts
According to the formula Ta=v2-TmCalculating the blocking duration T of the webpage to be testeda
5. An apparatus for determining blocking of a web application, comprising:
an initialization module for initializing the application of the web page to be tested and obtaining an initial time T0
A shielding module for shielding the signal from the initial time T0At the beginning, a preset masking time period TsInternally shielding the webpage application to be tested;
a trigger module for starting from the initial time T0Starting, and ending the operation of the webpage application to be tested at a preset interval duration TmIf judging to know that the CPU is in a non-blocking state, acquiring the current time T of the ith timeiWherein T iss>2TmI is a positive integer greater than 0;
a calculation module for calculating the current time TiAnd said initial time T0Determining a blocking duration Ta
A judging module for judging the blocking duration TaAnd judging whether the webpage application to be tested is blocked or not by a preset threshold value.
6. The apparatus of claim 5, wherein the computing module comprises:
a first calculating unit for calculating the current time TiAnd said initial time T0Determining a first time length Ri
A de-noising unit for de-noising the first time length RiDenoising to obtain a second time length Si
A second calculation unit for rootAccording to the second duration SiCalculating the blocking duration T of the webpage to be testeda
7. The apparatus of claim 6, wherein the denoising unit comprises:
a printing subunit for printing the first time length R on a number axis Li
A first average value calculating subunit for calculating R on the number axis Li+1And RiIs 0. ltoreq.R, v1, wherei≤TsAnd R is not less than 0i+1≤Ts
A noise calculation subunit for calculating a noise according to the formula n-v 1-TmCalculating a noise value n;
a translation subunit for translating the first time length R on the number axis LiTranslating n units to the direction of the origin to obtain a second time length Si
8. The apparatus of claim 7, wherein the second computing unit comprises:
a second average value calculating subunit for calculating S on the number axis Li+1And SiIs determined by the average value v2 of the difference of (a), wherein Si>Ts
A blocking duration calculating subunit for calculating the blocking duration according to the formula Ta=v2-TmCalculating the blocking duration T of the webpage to be testeda
9. An electronic device, comprising:
the processor and the memory are communicated with each other through a bus; the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1 to 4.
CN201710786484.0A 2017-09-04 2017-09-04 Method and device for judging webpage application blocking Active CN107678945B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710786484.0A CN107678945B (en) 2017-09-04 2017-09-04 Method and device for judging webpage application blocking

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710786484.0A CN107678945B (en) 2017-09-04 2017-09-04 Method and device for judging webpage application blocking

Publications (2)

Publication Number Publication Date
CN107678945A CN107678945A (en) 2018-02-09
CN107678945B true CN107678945B (en) 2020-04-21

Family

ID=61134898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710786484.0A Active CN107678945B (en) 2017-09-04 2017-09-04 Method and device for judging webpage application blocking

Country Status (1)

Country Link
CN (1) CN107678945B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110300034B (en) * 2019-05-07 2021-01-29 清华大学 Web-based network speed measuring method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20030008543A (en) * 2001-07-18 2003-01-29 임대호 Method for intercepting intrusion on other domains between web server users on the network and computer readable record medium on which a program therefor is recorded
CN103246552A (en) * 2012-02-14 2013-08-14 腾讯科技(深圳)有限公司 Method and device for preventing thread from blocking
CN104142858A (en) * 2013-11-29 2014-11-12 腾讯科技(深圳)有限公司 Blocked task scheduling method and device
CN104503912A (en) * 2014-12-24 2015-04-08 中科创达软件股份有限公司 Monitoring method and device for service responding process
CN105389258A (en) * 2015-12-10 2016-03-09 腾讯科技(深圳)有限公司 Program detection method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7921425B2 (en) * 2005-03-14 2011-04-05 Cisco Technology, Inc. Techniques for allocating computing resources to applications in an embedded system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20030008543A (en) * 2001-07-18 2003-01-29 임대호 Method for intercepting intrusion on other domains between web server users on the network and computer readable record medium on which a program therefor is recorded
CN103246552A (en) * 2012-02-14 2013-08-14 腾讯科技(深圳)有限公司 Method and device for preventing thread from blocking
CN104142858A (en) * 2013-11-29 2014-11-12 腾讯科技(深圳)有限公司 Blocked task scheduling method and device
CN104503912A (en) * 2014-12-24 2015-04-08 中科创达软件股份有限公司 Monitoring method and device for service responding process
CN105389258A (en) * 2015-12-10 2016-03-09 腾讯科技(深圳)有限公司 Program detection method and apparatus

Also Published As

Publication number Publication date
CN107678945A (en) 2018-02-09

Similar Documents

Publication Publication Date Title
US10321342B2 (en) Methods and systems for performance monitoring for mobile applications
CN106681811B (en) Multithreading scheduling method and device based on thread pool
CN105740326B (en) Thread state monitoring method and device for browser
US9536091B2 (en) System and method for detecting time-bomb malware
RU2628127C2 (en) Method and device for identification of user behavior
WO2017063516A1 (en) Method of determining noise signal, and method and device for audio noise removal
CN109634822B (en) Function time consumption statistical method and device, storage medium and terminal equipment
CN109446066B (en) Static detection method and system for inaccessible codes in C/C + + program
CN107678945B (en) Method and device for judging webpage application blocking
CN110717122B (en) Page performance acquisition method and device and electronic equipment
US10984163B1 (en) Systems and methods for parallel transient analysis and simulation
CN110401580B (en) Webpage state monitoring method based on heartbeat mechanism and related equipment
CN109688109B (en) Verification method and device of verification code based on client information identification
CN110851297A (en) Method, device, system and medium for processing interface jitter state
CN113849758A (en) Webpage index generation method and device, electronic equipment and storage medium
CN108241707B (en) Webpage loading prompting method and device
CN111078382A (en) Command timeout processing method and device
CN111552578B (en) Third party interface calling method and device
CN106484741B (en) A kind of method and device of single page application access data collection and transmission
US9317262B2 (en) Identification of code synchronization points
CN114138433B (en) Task timing strategy method, device and medium
CN113626340A (en) Test requirement identification method and device, electronic equipment and storage medium
CN107728769B (en) Background application management method and device and computer readable storage medium
CN107544968B (en) Method and device for determining website availability
CN106528383B (en) Method for capturing user asynchronous request callback execution time

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