CN112241502A - Page loading detection method and device - Google Patents

Page loading detection method and device Download PDF

Info

Publication number
CN112241502A
CN112241502A CN202011108816.8A CN202011108816A CN112241502A CN 112241502 A CN112241502 A CN 112241502A CN 202011108816 A CN202011108816 A CN 202011108816A CN 112241502 A CN112241502 A CN 112241502A
Authority
CN
China
Prior art keywords
hash value
picture
screen capture
determining
target page
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.)
Pending
Application number
CN202011108816.8A
Other languages
Chinese (zh)
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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202011108816.8A priority Critical patent/CN112241502A/en
Publication of CN112241502A publication Critical patent/CN112241502A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Abstract

The method comprises the steps of after a target page is loaded, carrying out screen capture on the target page being loaded according to a preset time interval, calculating a difference value between a first hash value corresponding to a previously obtained screen capture picture and a second hash value corresponding to a previously obtained screen capture picture, wherein the difference value between the first hash value and the second hash value can represent the difference degree between the currently obtained screen capture picture and the previously obtained screen capture picture of the target page, and if the difference degree between the two screen capture pictures is smaller, the displayed content of the target page is basically stable, the page loading completion can be determined.

Description

Page loading detection method and device
Technical Field
The disclosure relates to the technical field of computers, in particular to a page loading detection method and device.
Background
When a client loads a page, data of the page to be loaded needs to be acquired from a server, then a blank page is displayed on a screen according to the acquired data, then content rendering is carried out on the page, and after the content rendering of the page is finished, the page loading is finished.
In the client monitoring technology, detecting the page loading completion time is an important ability, and can help a developer to know the time consumed for jumping from a page to the first screen rendering, the waiting time of a user, the rendering problem caused by server interface data and the like. How to accurately determine the time for completing page loading is a key for improving the time-consuming detection accuracy of page loading.
Disclosure of Invention
The embodiment of the disclosure at least provides a page loading detection method and device.
In a first aspect, an embodiment of the present disclosure provides a page loading detection method, including:
after the target page starts to be loaded, screen capturing is carried out according to a preset time interval, and a screen capturing picture is obtained;
respectively calculating the difference value between a first hash value corresponding to the currently obtained screen capture picture and a second hash value corresponding to the previous screen capture picture from the captured second screen capture picture;
and determining that the target page is loaded completely after the difference value between the first hash value and the second hash value is smaller than a set threshold value.
In an optional embodiment, the determining that the target page is loaded completely after the difference between the first hash value and the second hash value is smaller than a set threshold includes:
after determining that the difference value between a first hash value corresponding to the currently obtained screen capture picture and a second hash value corresponding to the previous screen capture picture is smaller than a set threshold value for N times, determining that the target page is completely loaded; n is a positive integer greater than 1.
In an optional implementation manner, after determining that the target page loading is completed, the method further includes:
and determining the loading time of the target page based on the moment when the target page starts to be loaded and the moment corresponding to the currently obtained screenshot picture.
In an optional embodiment, the hash value of the screenshot picture is determined according to the following steps:
converting the screen capture picture into a gray scale image to obtain the gray scale value of each pixel point in the gray scale image;
and determining the hash value of the screen capture picture based on the gray value of each pixel point in the gray map.
In an optional embodiment, the determining the hash value of the screenshot picture based on the gray scale value of each pixel point in the gray scale map includes:
determining the difference value of the gray value between the next pixel point and the previous pixel point in each row of pixel points of the gray map;
and determining the hash value of the screen capture picture based on the difference value of the gray values.
In an optional embodiment, the converting the screenshot picture into a grayscale map includes:
compressing the screen shot picture to a preset size;
and converting the screen capture picture compressed to the preset size into a gray scale image.
In a second aspect, an embodiment of the present disclosure further provides a page loading detection apparatus, including:
the acquisition module is used for carrying out screen capture according to a preset time interval after the target page starts to be loaded, and acquiring a screen capture picture;
the calculation module is used for respectively calculating the difference value between a first hash value corresponding to the currently obtained screen capture picture and a second hash value corresponding to the previous screen capture picture from the intercepted second screen capture picture;
and the first determining module is used for determining that the target page is loaded completely after the difference value between the first hash value and the second hash value is smaller than a set threshold value.
In an alternative embodiment, the apparatus further comprises:
and the second determining module is used for determining the time consumed by loading the target page based on the moment when the target page starts to be loaded and the moment corresponding to the currently obtained screenshot picture after the target page is determined to be loaded.
In an optional implementation manner, the first determining module is specifically configured to:
after determining that the difference value between a first hash value corresponding to the currently obtained screen capture picture and a second hash value corresponding to the previous screen capture picture is smaller than a set threshold value for N times, determining that the target page is completely loaded; n is a positive integer greater than 1.
In an optional embodiment, the apparatus further comprises a third determining module configured to:
converting the screen capture picture into a gray scale image to obtain the gray scale value of each pixel point in the gray scale image;
and determining the hash value of the screen capture picture based on the gray value of each pixel point in the gray map.
In an optional implementation manner, when determining the hash value of the screenshot picture based on the gray value of each pixel point in the gray map, the third determining module is specifically configured to:
determining the difference value of the gray value between the next pixel point and the previous pixel point in each row of pixel points of the gray map;
and determining the hash value of the screen capture picture based on the difference value of the gray values.
In an optional implementation manner, when the third determining module converts the screen capture picture into a grayscale map, the third determining module is specifically configured to:
compressing the screen shot picture to a preset size;
and converting the screen capture picture compressed to the preset size into a gray scale image.
In a third aspect, an embodiment of the present disclosure further provides a computer device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the computer device is running, the machine-readable instructions when executed by the processor performing the steps of the first aspect described above, or any possible implementation of the first aspect.
In a fourth aspect, this disclosed embodiment also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps in the first aspect or any one of the possible implementation manners of the first aspect.
For the description of the effects of the page loading detection apparatus, the computer device, and the computer-readable storage medium, reference is made to the description of the page loading detection method, which is not repeated herein.
According to the page loading detection method and device provided by the embodiment of the disclosure, after a target page is loaded, a screen of the target page being loaded is captured according to a preset time interval, a difference value between a first hash value corresponding to a currently obtained screen capture picture and a second hash value corresponding to a previous screen capture picture is calculated, the difference value between the first hash value and the second hash value can represent a difference degree between the currently obtained screen capture picture and the previous screen capture picture of the target page, and if the difference degree between the two screen capture pictures is smaller, it is indicated that display content of the target page is basically stable, page loading completion can be determined, so that the page can be rapidly and accurately detected to be in a loading completion state, and further, relevant page performances such as time consumption for loading and the like can be evaluated.
In order to make the aforementioned objects, features and advantages of the present disclosure more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly described below, and the drawings herein incorporated in and forming a part of the specification illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the technical solutions of the present disclosure. It is appreciated that the following drawings depict only certain embodiments of the disclosure and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
Fig. 1 shows a flowchart of a page loading detection method provided by an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating another page load detection method provided by the embodiment of the present disclosure;
fig. 3 is a schematic diagram illustrating a page loading detection apparatus provided in an embodiment of the present disclosure;
fig. 4 shows a schematic diagram of a computer device provided by an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, not all of the embodiments. The components of the embodiments of the present disclosure, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present disclosure, presented in the figures, is not intended to limit the scope of the claimed disclosure, but is merely representative of selected embodiments of the disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the disclosure without making creative efforts, shall fall within the protection scope of the disclosure.
Research shows that when time consumption detection is carried out on page loading, point burying can be carried out on a page display callback port provided by a system, and the time of the page display on a screen is counted.
Based on the research, the disclosure provides a page loading detection method, which can quickly and accurately detect that a page is in a loading completion state, thereby improving the page loading time-consuming detection accuracy.
The above-mentioned drawbacks are the results of the inventor after practical and careful study, and therefore, the discovery process of the above-mentioned problems and the solutions proposed by the present disclosure to the above-mentioned problems should be the contribution of the inventor in the process of the present disclosure.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
To facilitate understanding of the present embodiment, first, a page loading test method disclosed in the embodiments of the present disclosure is described in detail, where an execution subject of the page loading test method provided in the embodiments of the present disclosure is generally a computer device with certain computing capability, and the computer device includes, for example: a terminal device, which may be a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle mounted device, a wearable device, or a server or other processing device. In some possible implementations, the page load test method may be implemented by a processor calling computer readable instructions stored in a memory.
The following describes a page loading test method provided by the embodiment of the present disclosure by taking an execution subject as a terminal device.
Referring to fig. 1, a flowchart of a page loading test method provided in the embodiment of the present disclosure is shown, where the method includes steps S101 to S103, where:
s101: and after the target page starts to be loaded, screen capture is carried out according to a preset time interval, and a screen capture picture is obtained.
In this step, after the terminal device starts to load the target page, the terminal device may capture a screen of the target page according to a preset time interval, so as to obtain a screen capture picture of the target page.
The operation system of the terminal device may be an IOS system.
Here, since the time consumption of page loading is usually short, usually within several seconds, the preset time interval may be determined according to the expected time consumption of page loading, for example, if the expected time consumption of page loading is within several seconds, the preset time interval may be set to millisecond level.
Further, the length of the preset time interval affects the accuracy of the time-consuming test for page loading and the occupied computing resources, and the shorter the preset time interval is, the more accurate the loading completion time of the detected target page is, and the more computing resources are occupied.
S102: and respectively calculating the difference value between the first hash value corresponding to the currently obtained screen capture picture and the second hash value corresponding to the previous screen capture picture from the captured second screen capture picture.
In this step, each time a screenshot picture is captured, the hash value of the screenshot picture may be calculated, and a difference between a first hash value corresponding to the currently obtained screenshot picture and a second hash value corresponding to the previous screenshot picture is calculated from a captured second screenshot picture.
The algorithm for calculating the hash value can be a perceptual hash algorithm, the perceptual hash algorithm is an algorithm for calculating the hash value of the picture, the fingerprint hash value associated with the content of the picture can be calculated, the similarity comparison between the pictures can be used, the higher the similarity is, the smaller the fingerprint hash difference is, the lower the similarity is, and the larger the fingerprint hash difference is.
Illustratively, the hash value of the screenshot picture may be determined by:
converting the screen capture picture into a gray scale image to obtain the gray scale value of each pixel point in the gray scale image;
and determining the hash value of the screen capture picture based on the gray value of each pixel point in the gray map.
In this step, the screenshot picture can be compressed to a preset size, and then the screenshot picture compressed to the preset size is converted into a gray scale image, so as to obtain the gray scale value of each pixel point in the gray scale image; then, the difference value of the gray value between the next pixel point and the previous pixel point in each row of pixel points of the gray map can be determined; and determining the hash value of the screen capture picture based on the difference value of the gray values.
Specifically, the screenshot picture may be compressed first, and the preset size may be 8 × 8, which is 64 pixels. Therefore, high frequency and details in the screenshot picture can be removed, only the structural brightness and darkness are kept, and after the screenshot picture is compressed, the screenshot picture can be converted into a gray scale image to obtain the gray scale value of each pixel point. Then, in each row of pixel points of a gray scale image of the screenshot picture, subtracting the gray scale value of the previous pixel point from the gray scale value of the next pixel point to obtain a difference value of the gray scale value between the next pixel point and the previous pixel point, and then configuring a corresponding hash value for each difference value according to the numerical value of each difference value, illustratively, if the difference value of the gray scale value between the next pixel point and the migration pixel point is greater than or equal to 0, a hash value of "1" may be assigned to the difference value, and if the difference value of the gray scale value between the next pixel point and the migration pixel point is less than 0, a hash value of "0" may be assigned to the difference value, so that a 7 × 8 matrix may be finally obtained, where elements in the matrix are the hash values corresponding to each difference value, and the matrix is the hash value of the screenshot picture.
S103: and determining that the target page is loaded completely after the difference value between the first hash value and the second hash value is smaller than a set threshold value.
In this step, after it is determined that a difference value between a first hash value corresponding to a currently obtained screenshot picture and a second hash value corresponding to a previous screenshot picture is less than a set threshold value N times continuously, it is determined that the target page is completely loaded; n is a positive integer greater than 1.
When the page is in the loading and rendering processes, the view level of the page is unstable, the content is changed all the time, and when the page rendering loading is completed, the view level is basically in a stable state, and the content is not changed greatly any more. Therefore, when the difference between the first hash value and the second hash value is smaller than the set threshold, it can be shown that the similarity between the page corresponding to the previous screenshot picture and the page corresponding to the next screenshot picture is high, and the difference is small, and if the difference between the first hash value and the second hash value is determined to be smaller than the set threshold for N consecutive times, it can be determined that the view level of the target page is in a stable state, and the page loading is considered to be completed.
In a possible implementation manner, after the target page is determined to be loaded, the time consumed for loading the target page can be determined based on the time when the target page starts to be loaded and the time corresponding to the currently obtained screenshot picture.
For example, the time when the target page starts to be loaded is taken as the starting time, the capturing time of the currently obtained screenshot image is taken as the ending time, and the time length from the starting time to the time within the ending time is taken as the time consumed by loading the target page.
According to the page loading detection method provided by the embodiment of the disclosure, after a target page is loaded, a screen of the target page being loaded is captured according to a preset time interval, and a difference value between a first hash value corresponding to a previously obtained screen capture picture and a second hash value corresponding to a previously obtained screen capture picture is calculated, wherein the difference value between the first hash value and the second hash value can represent a difference degree between the currently obtained screen capture picture and the previously obtained screen capture picture of the target page, and if the difference degree between the two screen capture pictures is smaller, it is indicated that display content of the target page is basically stable, page loading completion can be determined, so that the page can be rapidly and accurately detected to be in a state of being loaded, and thus page loading time consumption detection accuracy is improved.
Referring to fig. 2, a flowchart of another page loading test method provided in the embodiment of the present disclosure is shown, the method comprises the steps of regularly acquiring a screen shot after a page is loaded, compressing the size of the acquired screen shot, converting the compressed screen shot into a gray-scale image, then, calculating the gray difference value between the next pixel point and the previous pixel point in each line of pixel points in the gray map to obtain a fingerprint hash value (hash), comparing the fingerprint hash of the current screen capture with the fingerprint hash of the previous screen capture to obtain the difference value of the fingerprint hash, if the fingerprint hash difference value is less than the set threshold value for N times, then it may be determined that the page is in a stable state, it may be determined that the page loading is complete, the acquisition of the page screenshot may be stopped, and if the page is not in a stable state, the step of acquiring the screen shot can be executed in a timed mode, and a loop is entered until the page loading is determined to be completed.
It will be understood by those skilled in the art that in the method of the present invention, the order of writing the steps does not imply a strict order of execution and any limitations on the implementation, and the specific order of execution of the steps should be determined by their function and possible inherent logic.
Based on the same inventive concept, the embodiment of the present disclosure further provides a page loading detection apparatus corresponding to the page loading detection method, and since the principle of the apparatus in the embodiment of the present disclosure for solving the problem is similar to the page loading detection method in the embodiment of the present disclosure, the implementation of the apparatus may refer to the implementation of the method, and repeated details are not described again.
Referring to fig. 3, which is a schematic diagram of an architecture of a page loading detection apparatus provided in an embodiment of the present disclosure, the apparatus includes: an acquisition module 310, a calculation module 320, a first determination module 330; wherein the content of the first and second substances,
the obtaining module 310 is configured to capture a screen at a preset time interval after the target page starts to be loaded, and obtain a screen capture picture;
a calculating module 320, configured to calculate, starting from the second captured screenshot picture, differences between a first hash value corresponding to the currently obtained screenshot picture and a second hash value corresponding to the previous screenshot picture;
a first determining module 330, configured to determine that the target page is loaded completely after a difference between the first hash value and the second hash value is smaller than a set threshold.
The page loading detection device provided by the embodiment of the disclosure performs screen capturing on a target page being loaded according to a preset time interval after the target page starts to be loaded, calculates a difference value between a first hash value corresponding to a previously obtained screen capturing picture and a second hash value corresponding to a previously obtained screen capturing picture, and determines that the page loading is completed if the difference value between the first hash value and the second hash value is smaller than the difference value between the currently obtained screen capturing picture and the previously obtained screen capturing picture of the target page.
In an optional implementation manner, the page loading detection apparatus 300 further includes:
the second determining module 340 is configured to determine, after it is determined that the target page is completely loaded, time consumed for loading the target page based on a time when the target page starts to be loaded and a time corresponding to the currently obtained screenshot picture.
In an optional implementation manner, the first determining module 330 is specifically configured to:
after determining that the difference value between a first hash value corresponding to the currently obtained screen capture picture and a second hash value corresponding to the previous screen capture picture is smaller than a set threshold value for N times, determining that the target page is completely loaded; n is a positive integer greater than 1.
In an optional implementation manner, the page loading detection apparatus 300 further includes a third determining module 350, configured to:
converting the screen capture picture into a gray scale image to obtain the gray scale value of each pixel point in the gray scale image;
and determining the hash value of the screen capture picture based on the gray value of each pixel point in the gray map.
In an optional implementation manner, when determining the hash value of the screenshot picture based on the gray value of each pixel point in the gray map, the third determining module 350 is specifically configured to:
determining the difference value of the gray value between the next pixel point and the previous pixel point in each row of pixel points of the gray map;
and determining the hash value of the screen capture picture based on the difference value of the gray values.
In an optional implementation manner, when the third determining module 350 converts the screen shot into a grayscale map, it is specifically configured to:
compressing the screen shot picture to a preset size;
and converting the screen capture picture compressed to the preset size into a gray scale image.
The description of the processing flow of each module in the device and the interaction flow between the modules may refer to the related description in the above method embodiments, and will not be described in detail here.
Based on the same technical concept, the embodiment of the disclosure also provides computer equipment. Referring to fig. 4, a schematic structural diagram of a computer device 400 provided in the embodiment of the present disclosure includes a processor 401, a memory 402, and a bus 403. The memory 402 is used for storing execution instructions and includes a memory 4021 and an external memory 4022; the memory 4021 is also referred to as an internal memory, and is configured to temporarily store operation data in the processor 401 and data exchanged with an external memory 4022 such as a hard disk, the processor 401 exchanges data with the external memory 4022 through the memory 4021, and when the computer device 400 operates, the processor 401 communicates with the memory 402 through the bus 403, so that the processor 401 executes the following instructions:
after the target page starts to be loaded, screen capturing is carried out according to a preset time interval, and a screen capturing picture is obtained;
respectively calculating the difference value between a first hash value corresponding to the currently obtained screen capture picture and a second hash value corresponding to the previous screen capture picture from the captured second screen capture picture;
and determining that the target page is loaded completely after the difference value between the first hash value and the second hash value is smaller than a set threshold value.
In a possible implementation manner, the determining that the target page loading is completed after the difference between the first hash value and the second hash value is smaller than a set threshold by the processor 401 includes:
after determining that the difference value between a first hash value corresponding to the currently obtained screen capture picture and a second hash value corresponding to the previous screen capture picture is smaller than a set threshold value for N times, determining that the target page is completely loaded; n is a positive integer greater than 1.
In one possible implementation, after determining that the target page loading is completed, processor 401 is further configured to:
and determining the loading time of the target page based on the moment when the target page starts to be loaded and the moment corresponding to the currently obtained screenshot picture.
In one possible implementation, the processor 401 is further configured to perform:
converting the screen capture picture into a gray scale image to obtain the gray scale value of each pixel point in the gray scale image;
and determining the hash value of the screen capture picture based on the gray value of each pixel point in the gray map.
In a possible embodiment, the instructions executed by the processor 401 for determining the hash value of the screenshot based on the gray scale value of each pixel point in the gray scale map includes:
determining the difference value of the gray value between the next pixel point and the previous pixel point in each row of pixel points of the gray map;
and determining the hash value of the screen capture picture based on the difference value of the gray values.
In a possible implementation, the instructions executed by the processor 401 for converting the screenshot into a grayscale map include:
compressing the screen shot picture to a preset size;
and converting the screen capture picture compressed to the preset size into a gray scale image.
The embodiments of the present disclosure also provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the page load detection method in the foregoing method embodiments are executed. The storage medium may be a volatile or non-volatile computer-readable storage medium.
The computer program product of the page load detection method provided in the embodiments of the present disclosure includes a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the steps of the page load detection method in the above method embodiments, which may be referred to specifically in the above method embodiments, and are not described herein again.
The embodiments of the present disclosure also provide a computer program, which when executed by a processor implements any one of the methods of the foregoing embodiments. The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and 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 units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are merely specific embodiments of the present disclosure, which are used for illustrating the technical solutions of the present disclosure and not for limiting the same, and the scope of the present disclosure is not limited thereto, and although the present disclosure is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive of the technical solutions described in the foregoing embodiments or equivalent technical features thereof within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present disclosure, and should be construed as being included therein. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (10)

1. A page loading detection method is characterized by comprising the following steps:
after the target page starts to be loaded, screen capturing is carried out according to a preset time interval, and a screen capturing picture is obtained;
respectively calculating the difference value between a first hash value corresponding to the currently obtained screen capture picture and a second hash value corresponding to the previous screen capture picture from the captured second screen capture picture;
and determining that the target page is loaded completely after the difference value between the first hash value and the second hash value is smaller than a set threshold value.
2. The method of claim 1, wherein determining that the target page load is complete after the difference between the first hash value and the second hash value is less than a set threshold comprises:
after determining that the difference value between a first hash value corresponding to the currently obtained screen capture picture and a second hash value corresponding to the previous screen capture picture is smaller than a set threshold value for N times, determining that the target page is completely loaded; n is a positive integer greater than 1.
3. The method of claim 1, wherein upon determining that the target page load is complete, the method further comprises:
and determining the loading time of the target page based on the moment when the target page starts to be loaded and the moment corresponding to the currently obtained screenshot picture.
4. The method of claim 1, wherein the hash value of the screenshot picture is determined according to the following steps:
converting the screen capture picture into a gray scale image to obtain the gray scale value of each pixel point in the gray scale image;
and determining the hash value of the screen capture picture based on the gray value of each pixel point in the gray map.
5. The method of claim 4, wherein determining the hash value of the screenshot picture based on the grayscale value of each pixel point in the grayscale map comprises:
determining the difference value of the gray value between the next pixel point and the previous pixel point in each row of pixel points of the gray map;
and determining the hash value of the screen capture picture based on the difference value of the gray values.
6. The method of claim 4, wherein converting the screenshot picture to a grayscale picture comprises:
compressing the screen shot picture to a preset size;
and converting the screen capture picture compressed to the preset size into a gray scale image.
7. A page load detection apparatus, comprising:
the acquisition module is used for carrying out screen capture according to a preset time interval after the target page starts to be loaded, and acquiring a screen capture picture;
the calculation module is used for respectively calculating the difference value between a first hash value corresponding to the currently obtained screen capture picture and a second hash value corresponding to the previous screen capture picture from the intercepted second screen capture picture;
and the first determining module is used for determining that the target page is loaded completely after the difference value between the first hash value and the second hash value is smaller than a set threshold value.
8. The apparatus of claim 7, further comprising:
and the second determining module is used for determining the time consumed by loading the target page based on the moment when the target page starts to be loaded and the moment corresponding to the currently obtained screenshot picture after the target page is determined to be loaded.
9. A computer device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when a computer device is running, the machine-readable instructions when executed by the processor performing the steps of the page load detection method according to any one of claims 1 to 6.
10. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the page load detection method according to any one of claims 1 to 6.
CN202011108816.8A 2020-10-16 2020-10-16 Page loading detection method and device Pending CN112241502A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011108816.8A CN112241502A (en) 2020-10-16 2020-10-16 Page loading detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011108816.8A CN112241502A (en) 2020-10-16 2020-10-16 Page loading detection method and device

Publications (1)

Publication Number Publication Date
CN112241502A true CN112241502A (en) 2021-01-19

Family

ID=74169334

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011108816.8A Pending CN112241502A (en) 2020-10-16 2020-10-16 Page loading detection method and device

Country Status (1)

Country Link
CN (1) CN112241502A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688043A (en) * 2021-08-25 2021-11-23 北京三快在线科技有限公司 Application program testing method, device, server, iOS device and medium
CN113791786A (en) * 2021-09-23 2021-12-14 安然 APP page control automation method and device based on IOS system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8341538B1 (en) * 2009-06-09 2012-12-25 Symantec Corporation Systems and methods for reducing redundancies in quality-assurance reviews of graphical user interfaces
CN104661096A (en) * 2013-11-21 2015-05-27 深圳市快播科技有限公司 Video barrage adding method and device, video playing method and video player
CN105956020A (en) * 2016-04-22 2016-09-21 广州精点计算机科技有限公司 Method and device for searching similar image based on perceptual hash
CN108062463A (en) * 2016-11-07 2018-05-22 武汉安天信息技术有限责任公司 It is a kind of that packet inspection method and system are beaten again based on screenshot picture
CN110555179A (en) * 2019-09-05 2019-12-10 厦门市美亚柏科信息股份有限公司 Dynamic website script evidence obtaining method, terminal equipment and storage medium
CN110990492A (en) * 2020-03-03 2020-04-10 支付宝(杭州)信息技术有限公司 Information processing method, device and equipment
CN111355769A (en) * 2019-04-24 2020-06-30 深圳市鸿合创新信息技术有限责任公司 Remote monitoring method and device and electronic equipment
CN111752817A (en) * 2020-06-30 2020-10-09 汉海信息技术(上海)有限公司 Method, device and equipment for determining page loading duration and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8341538B1 (en) * 2009-06-09 2012-12-25 Symantec Corporation Systems and methods for reducing redundancies in quality-assurance reviews of graphical user interfaces
CN104661096A (en) * 2013-11-21 2015-05-27 深圳市快播科技有限公司 Video barrage adding method and device, video playing method and video player
CN105956020A (en) * 2016-04-22 2016-09-21 广州精点计算机科技有限公司 Method and device for searching similar image based on perceptual hash
CN108062463A (en) * 2016-11-07 2018-05-22 武汉安天信息技术有限责任公司 It is a kind of that packet inspection method and system are beaten again based on screenshot picture
CN111355769A (en) * 2019-04-24 2020-06-30 深圳市鸿合创新信息技术有限责任公司 Remote monitoring method and device and electronic equipment
CN110555179A (en) * 2019-09-05 2019-12-10 厦门市美亚柏科信息股份有限公司 Dynamic website script evidence obtaining method, terminal equipment and storage medium
CN110990492A (en) * 2020-03-03 2020-04-10 支付宝(杭州)信息技术有限公司 Information processing method, device and equipment
CN111752817A (en) * 2020-06-30 2020-10-09 汉海信息技术(上海)有限公司 Method, device and equipment for determining page loading duration and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688043A (en) * 2021-08-25 2021-11-23 北京三快在线科技有限公司 Application program testing method, device, server, iOS device and medium
CN113688043B (en) * 2021-08-25 2022-07-26 北京三快在线科技有限公司 Application program testing method, device, server, iOS device and medium
CN113791786A (en) * 2021-09-23 2021-12-14 安然 APP page control automation method and device based on IOS system
CN113791786B (en) * 2021-09-23 2024-01-19 安然 APP page control automation method and device based on IOS system

Similar Documents

Publication Publication Date Title
CN111476306B (en) Object detection method, device, equipment and storage medium based on artificial intelligence
CN110059468B (en) Applet risk identification method and device
CN112241502A (en) Page loading detection method and device
CN109598250B (en) Feature extraction method, device, electronic equipment and computer readable medium
CN108875519B (en) Object detection method, device and system and storage medium
CN113538070B (en) User life value cycle detection method and device and computer equipment
CN111681284A (en) Corner point detection method and device, electronic equipment and storage medium
CN112306829A (en) Method and device for determining performance information, storage medium and terminal
CN112181141A (en) AR positioning method, AR positioning device, electronic equipment and storage medium
CN115330626A (en) Picture transformation method and device based on mesh grid network decomposition
CN109302523B (en) Mobile phone performance evaluation method for mobile phone side and server side
CN111027450A (en) Bank card information identification method and device, computer equipment and storage medium
CN113888619A (en) Distance determination method and device, electronic equipment and storage medium
US20060204091A1 (en) System and method for analyzing and processing two-dimensional images
CN105049706A (en) Image processing method and terminal
CN115238837B (en) Data processing method and device, electronic equipment and storage medium
CN108763491B (en) Picture processing method and device and terminal equipment
CN115797267A (en) Image quality evaluation method, system, electronic device, and storage medium
CN112763030B (en) Weighing method, device, equipment and storage medium
CN111353428B (en) Action information identification method and device, electronic equipment and storage medium
CN114022658A (en) Target detection method, device, storage medium and terminal
CN110245668B (en) Terminal information acquisition method, acquisition device and storage medium based on image recognition
CN111626258A (en) Sign-in information display method and device, computer equipment and storage medium
CN111353991A (en) Target detection method and device, electronic equipment and storage medium
CN115601606B (en) Store state detection method, device, equipment and storage medium

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
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information