CN111026989A - Page loading time detection method and device and electronic equipment - Google Patents

Page loading time detection method and device and electronic equipment Download PDF

Info

Publication number
CN111026989A
CN111026989A CN201911121916.1A CN201911121916A CN111026989A CN 111026989 A CN111026989 A CN 111026989A CN 201911121916 A CN201911121916 A CN 201911121916A CN 111026989 A CN111026989 A CN 111026989A
Authority
CN
China
Prior art keywords
page
graph
tested
image
loading
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.)
Granted
Application number
CN201911121916.1A
Other languages
Chinese (zh)
Other versions
CN111026989B (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.)
Hanhai Information Technology Shanghai Co Ltd
Original Assignee
Hanhai Information Technology Shanghai 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 Hanhai Information Technology Shanghai Co Ltd filed Critical Hanhai Information Technology Shanghai Co Ltd
Priority to CN201911121916.1A priority Critical patent/CN111026989B/en
Publication of CN111026989A publication Critical patent/CN111026989A/en
Application granted granted Critical
Publication of CN111026989B publication Critical patent/CN111026989B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application discloses a method and a device for detecting page loading time and electronic equipment. An embodiment of the method comprises: continuously screenshot is carried out on the display interface through a preset screenshot tool, and a page to be tested is loaded in the continuous screenshot process; acquiring the time consumption of each screenshot; identifying a starting graph and an ending graph in the loading process of the page to be detected from the intercepted graph; and taking the sum of the time consumption of the intercepted starting graph, the intercepted ending graph and the graphs intercepted between the starting graph and the ending graph as the loading time of the page to be tested. The embodiment improves the accuracy of the detection of the page loading time.

Description

Page loading time detection method and device and electronic equipment
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method and a device for detecting page loading time and electronic equipment.
Background
When a user browses a page in an Application (APP) through an electronic device (such as a mobile phone, a tablet computer, etc.), the page needs to be loaded first. When loading is complete, the user can browse the content in the page. When the page loading time is too long, the user will wait for a long time, and the user is easy to lose.
The conventional method for detecting page loading time generally records a time point when a page starts to be loaded and a time point when the page finishes being loaded, and takes a difference between the two time points as the page loading time. However, since the time point when the page starts to be loaded and the time point when the page finishes being loaded cannot be accurately obtained, the page loading time detected in this way is not accurate enough.
Disclosure of Invention
The embodiment of the application provides a method and a device for detecting page loading time and electronic equipment, so as to improve the accuracy of detecting the page loading time.
In a first aspect, an embodiment of the present application provides a method for detecting page loading time, where the method includes: continuously screenshot is carried out on the display interface through a preset screenshot tool, and a page to be tested is loaded in the continuous screenshot process; acquiring the time consumption of each screenshot; identifying a starting graph and an ending graph in the loading process of the page to be detected from the intercepted graph; and taking the sum of the time consumption of the intercepted starting graph, the intercepted ending graph and the graphs intercepted between the starting graph and the ending graph as the loading time of the page to be tested.
In a second aspect, an embodiment of the present application provides an apparatus for detecting page loading time, where the apparatus includes: the screenshot unit is configured to perform continuous screenshot on the display interface through a preset screenshot tool and load a page to be tested in the continuous screenshot process; an acquisition unit configured to acquire a time consumption of each screenshot; the identification unit is configured to identify a starting graph and an ending graph in the loading process of the page to be detected from the intercepted graph; and the summation unit is configured to take the sum of the time consumed by the interception of the starting graph, the ending graph and the graphs intercepted between the starting graph and the ending graph as the loading time of the page to be tested.
In a third aspect, an embodiment of the present application provides an electronic device, including: one or more processors; storage means having one or more programs stored thereon which, when executed by one or more processors, cause the one or more processors to carry out the method as in the first aspect described above.
In a fourth aspect, embodiments of the present application provide a computer-readable medium, on which a computer program is stored, which when executed by a processor implements the method as in the first aspect described above.
According to the method, the device and the electronic equipment for detecting the page loading time, continuous screenshot is carried out on the display interface through the preset screenshot tool, and the page to be detected is loaded in the continuous screenshot process; then acquiring the time consumption of each screenshot; then, identifying a starting graph and an ending graph in the loading process of the page to be detected from the intercepted graph; and finally, taking the sum of the time consumption of the intercepted starting graph, the intercepted ending graph and each graph intercepted between the starting graph and the ending graph as the loading time of the page to be tested. Because the preset screenshot tool can continuously and quickly screenshot the display interface and accurately record the time consumed by each screenshot, after the start image and the end image in the loading process of the page to be detected are identified, the accurate page loading duration can be obtained by counting the time consumed in the process from intercepting the start image to intercepting the end image. In the process, the time point for starting loading and the time point for finishing loading do not need to be acquired, so that errors caused by inaccurate acquisition of the time points are avoided, and the accuracy of detecting the page loading time is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is a flow diagram of one embodiment of a method for page load time detection according to the present application;
FIG. 2 is a flow diagram of yet another embodiment of a method for page load time detection according to the present application;
FIG. 3 is a schematic diagram illustrating an embodiment of an apparatus for detecting page loading time according to the present application;
FIG. 4 is a block diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Referring to fig. 1, a flowchart 100 of an embodiment of a method for detecting page loading time according to the present application is shown. The method for detecting the page loading time comprises the following steps:
step 101, performing continuous screenshot on a display interface through a preset screenshot tool, and loading a page to be tested in the process of continuous screenshot.
In this embodiment, the execution subject of the page loading time detection method may be various test devices for testing the page loading speed. The test equipment can detect the page loading time of an Application (APP) running in equipment to be tested (such as a mobile phone, a tablet personal computer and the like). The device to be tested can also run with a preset screenshot tool. The execution main body can control the starting or closing of the preset screenshot tool, and can also set the function of the preset screenshot tool, the storage position of the intercepted image and the like.
Here, the preset screenshot tool may be an existing high-speed screenshot tool. The high-speed screenshot tool can adopt the speed of 60 frames per second to screenshot on a display screen of the equipment to be tested, and transmits the screenshot to a preset storage position in real time.
In this embodiment, the execution subject may use any page, of which the loading time needs to be tested, in the current application to be tested as the page to be tested. For example, for a certain comment application, the main page of the comment application may be used as a page to be tested, and the time for loading the main page of the application may be tested. In practice, the time for loading the main page is the time from clicking the entry (such as an icon) of the application to the completion of loading the main page.
In this embodiment, the execution main body performs continuous screenshot on the display interface through a preset screenshot tool, and loads a page to be tested in the process of continuous screenshot. In the continuous screenshot process, no time interval exists between two adjacent screenshot operations. In the process of high-speed and continuous screenshot, the page to be detected can be loaded, so that the change condition of the page to be detected in the loading process is recorded through the continuously captured images.
Step 102, acquiring the time consumption of each screenshot.
In this embodiment, the preset screenshot tool may record the time consumed by each screenshot. The time spent for each screenshot may be the length of time from the start of the screenshot to the generation of the picture stream. It should be noted that the saving and transmission of the captured data such as images may be asynchronous, and therefore, the time consumed for saving and transmitting the images is not included in the time consumed for each screenshot.
Here, the execution subject may obtain time consumption of each screenshot from information recorded by the preset screenshot tool.
And 103, identifying a starting graph and an ending graph in the loading process of the page to be detected from the intercepted graph.
In this embodiment, the execution body may identify a start graph and an end graph in the process of loading the page to be tested from the intercepted graph. The start graph may refer to a screenshot of the start time of loading of the page to be tested. The ending map may refer to a screenshot of the loading completion time of the page to be tested.
It can be understood that the display interfaces before and after the page to be tested is loaded are different. Taking the page to be tested as the main page of a certain application to be tested as an example, before the main page is loaded, the content presented on the display interface may include icons of a plurality of applications (including the application to be tested) installed on the device to be tested. And when the icon of the application to be tested is triggered, the main page can be loaded and presented.
Therefore, the initial graph in the loading process of the page to be tested can be determined by comparing the intercepted graph with the display interface before the page to be tested is loaded (such as calculating the similarity, comparing the pixel values and the like). Similarly, the ending graph in the loading process of the page to be tested can be determined by comparing the intercepted graph with the display interface of the page to be tested after the page to be tested is loaded.
In addition, a starting image in the loading process of the page to be tested can be determined by comparing a certain region in the intercepted image with the content in the same region in the display interface before the page to be tested is loaded (such as calculating similarity, comparing pixel values and the like). Similarly, the ending graph in the loading process of the page to be tested can be determined by comparing the other area of the intercepted graph with the same area in the display interface after the page to be tested is loaded.
In some optional implementations of this embodiment, the executing main body may execute according to the following sub-steps:
in sub-step S11, from the clipped images, first image content located in the first feature region and second image content located in the second feature region are extracted respectively.
Here, the first characteristic region and the second characteristic region may be preset according to a content change condition before and after loading the page to be tested. The first characteristic region may be a region including a characteristic of the page to be tested at the start of loading. The second characteristic region may be a region including a characteristic of the page to be tested when the loading is completed.
As an example, a region where content that is displayed all the time before the page to be tested is loaded and that changes or disappears during the loading process of the page to be tested is located may be selected as the first feature region.
As another example, an area where content that is not presented before the page to be tested is loaded and starts to be presented from the start time of the page to be tested is selected as the first feature area.
As another example, an area where the content that is not displayed before the loading of the page to be tested is finished and is displayed after the loading of the page to be tested is finished may be selected as the second feature area.
As another example, a certain area presenting different contents before and after the page to be tested is loaded may be selected as the second feature area.
It should be noted that the selection principle and the specific position of the first characteristic region and the second characteristic region may be preset according to needs, and are not limited herein.
For each of the truncated graphs, the image content located in the first feature region of the graph may be taken as the first image content of the graph. Meanwhile, the image content located in the second feature region of the map is taken as the second image content of the map.
And a substep S12, matching the first image content in each graph with a first reference image obtained in advance, and determining a starting graph in the loading process of the page to be tested based on the matching result.
Here, the first reference image is an image as a reference for comparison of the first image content. And comparing the first reference image with the first image content in each image to determine an initial image in the loading process of the page to be tested.
For each of the truncated graphs, the first image content of the graph may be matched to a first reference image. Here, the matching may be performed by calculating the similarity or by determining whether the matching pixel values are consistent. Resulting in respective maps of the first image content matching the first reference image. Then, the starting graph in the process of loading the page to be tested can be identified from the matched graphs.
As an example, when the first feature region is a region where content that is displayed before the page to be tested is loaded and changes or disappears during the loading process of the page to be tested is located, the first reference image may be image content in the first feature region before the page to be tested is loaded. At this time, the graph with the latest interception time can be selected from the matched graphs to serve as the initial graph in the loading process of the page to be detected.
As another example, when the first feature region is a region where content that is not presented before the page to be tested is loaded and that starts to be presented from the start time of the page to be tested is loaded, the first reference image may be image content in the first feature region after the page to be tested is loaded. The graph with the earliest interception time can be selected from the matched graphs to be used as the initial graph in the loading process of the page to be tested.
And a substep S13, matching the second image content in each graph with a second reference image acquired in advance, and determining an end graph in the process of loading the page to be tested based on the matching result.
Here, the second reference image is an image as a reference for comparison of the second image content. And comparing the second reference image with the second image content in each image to determine the initial image in the loading process of the page to be tested.
For each of the truncated graphs, the second image content of the graph may be matched to a second reference image. Here, the matching may be performed by calculating the similarity or by determining whether the matching pixel values are consistent. Resulting in respective maps of the second image content matching the second reference image. Then, an end graph in the process of loading the page to be tested can be identified from the matched graphs.
As an example, when the second feature region is a region presenting different contents before and after the page to be tested is loaded, the second reference image may be image content in the second feature region after the page to be tested is loaded. At this time, the graph with the earliest interception time can be selected from the matched graphs to serve as the initial graph in the loading process of the page to be tested.
And step 104, taking the sum of the time consumption of the intercepted starting graph, the intercepted ending graph and each graph intercepted between the starting graph and the ending graph as the loading time of the page to be tested.
In this embodiment, the execution body may use the sum of the time spent on intercepting the start graph, the end graph, and each graph intercepted between the start graph and the end graph as the loading time of the page to be tested. The graph cut between the start graph and the end graph is the graph cut after the start graph and before the end graph.
As an example, the start graph cut takes 17 milliseconds, the end graph cut takes 16 milliseconds, and after the start graph cut and before the end graph cut, 3 graphs are cut, which take 17 milliseconds, 16 milliseconds, and 16 milliseconds, respectively. The sum of the time taken to intercept the above figures is 82 milliseconds. At this time, the loading time of the page to be tested is 82 milliseconds.
According to the method provided by the embodiment of the application, continuous screenshot is carried out on the display interface through the preset screenshot tool, and the page to be tested is loaded in the continuous screenshot process; then acquiring the time consumption of each screenshot; then, identifying a starting graph and an ending graph in the loading process of the page to be tested from the intercepted graph; and finally, taking the sum of the time consumption of the intercepted starting graph, the intercepted ending graph and each graph intercepted between the starting graph and the ending graph as the loading time of the page to be tested. Because the preset screenshot tool can continuously and quickly screenshot the display interface and accurately record the time consumed by each screenshot, after the start image and the end image in the loading process of the page to be detected are identified, the accurate page loading duration can be obtained by counting the time consumed in the process from intercepting the start image to intercepting the end image. In the process, the time point for starting loading and the time point for finishing loading do not need to be acquired, so that errors caused by inaccurate acquisition of the time points are avoided, and the accuracy of detecting the page loading time is improved.
With further reference to FIG. 2, a flow 200 of yet another embodiment of a method of detecting page load time is shown. The process 200 of the page loading time detection method includes the following steps:
step 201, performing continuous screenshot on the display interface through a preset screenshot tool, and loading the page to be tested in the process of continuous screenshot.
Step 202, acquiring the time consumption of each screenshot.
Step 201 to step 202 in this embodiment can refer to step 101 to step 102 in the embodiment shown in fig. 1, and are not described here again.
Step 203, extracting the first image content located in the first characteristic region and the second image content located in the second characteristic region from the intercepted images respectively.
In this embodiment, the execution subject may pre-select the first feature region and the second feature region in the display interface. Then, from the respective cut-out figures, first image content located in the first feature region and second image content located in the second feature region are extracted, respectively.
In some optional implementations of this embodiment, the first feature region may be obtained in advance by: first, a first target content is selected from a display interface before a page to be tested is loaded. The first target content is content which changes or disappears in the loading process of the page to be tested. Then, the area where the first target content is located is taken as a first characteristic area.
In some optional implementations of this embodiment, the first feature region may be obtained in advance by: firstly, selecting second target content from a display interface after the page to be tested is loaded. And the second target content is content which is not presented before the page to be tested is loaded and is presented from the loading starting time of the page to be tested. Then, the area where the second target content is located is taken as the first characteristic area.
In some optional implementations of this embodiment, the second reference image is obtained in advance by: firstly, selecting third target content from a display interface after the page to be tested is loaded. And the third target content is content which is not presented before the loading of the page to be tested is finished. Then, the area where the third target content is located is taken as the second characteristic area.
And 204, matching the first image content in each image with a first reference image acquired in advance, and determining a starting image in the loading process of the page to be detected based on the matching result.
In this embodiment, the executing entity may match the first image content in each graph with a first reference image obtained in advance (e.g., calculate similarity, compare pixel values, etc.), and determine a starting graph in the process of loading the page to be tested based on the matching result.
In some optional implementation manners in this embodiment, when the area where the first target content is located is used as the first feature area, an image located in the first feature area in the display interface before the page to be tested is loaded may be used as the first reference image. At this time, the start map can be identified as follows:
first, pixel data corresponding to first image content in each image is acquired. The pixel data may include pixel values of respective pixel points in the first image content.
And a second step of determining a first similarity between the acquired pixel data and the pixel data of the first reference image acquired in advance, respectively. Here, the first similarity may be calculated by calculating various existing similarity calculation methods. For example, the first similarity may be calculated in a similarity calculation manner based on the euclidean distance. The larger the calculation result of the euclidean distance, the smaller the similarity.
And thirdly, selecting the graph with the latest intercepting time from the intercepted graphs with the first similarity larger than a first preset threshold (such as 0.99 or 0.98) as a starting graph in the loading process of the page to be detected. Here, the first preset threshold may be preset according to statistics and experiments of a large amount of data, and the specific value of the first preset threshold is not limited in the present application.
In some optional implementation manners in this embodiment, when the area where the second target content is located is used as the first feature area, an image located in the first feature area in the display interface after the page to be tested is loaded may be used as the first reference image. At this time, the start map can be identified as follows:
first, pixel data corresponding to first image content in each image is acquired.
And a second step of determining a first similarity between the acquired pixel data and the pixel data of the first reference image acquired in advance, respectively.
And thirdly, selecting the graph with the earliest interception time from the intercepted graphs with the first similarity larger than a first preset threshold value as an initial graph in the loading process of the page to be detected.
And step 205, matching the second image content in each graph with a second reference image acquired in advance, and determining an end graph in the loading process of the page to be detected based on the matching result.
In this embodiment, the executing entity may match (e.g., calculate similarity, compare pixel values, etc.) the second image content in each graph with a second reference image obtained in advance, and determine an end graph in the process of loading the page to be tested based on the matching result.
In some optional implementation manners in this embodiment, when the area where the third target content is located is used as the second feature area, an image in the display interface after the loading of the page to be tested is finished and located in the second feature area may be used as the second reference image. At this time, the end graph can be recognized as follows:
first, pixel data corresponding to second image content in each image is obtained.
A second step of determining a second similarity between the acquired pixel data and pixel data of a second reference image acquired in advance, respectively;
and thirdly, selecting the graph with the earliest interception time from the intercepted graphs with the second similarity larger than a second preset threshold value as an end graph in the loading process of the page to be detected. Here, the second preset threshold may be preset according to statistics and experiments of a large amount of data, and the specific value of the second preset threshold is not limited in the present application.
And step 206, taking the sum of the time consumption of the intercepted starting graph, the intercepted ending graph and the graphs intercepted between the starting graph and the ending graph as the loading time of the page to be tested.
Step 206 in this embodiment can refer to step 104 in the embodiment shown in fig. 1, and is not described here again.
As can be seen from fig. 2, compared with the embodiment shown in fig. 1, the flow 200 of the page loading time detection method in this embodiment involves the steps of identifying the start graph and the end graph based on the first reference image and the second reference image. According to the scheme described in the embodiment, after the start graph and the end graph in the page loading process to be tested are identified, the accurate page loading duration can be obtained by counting the time consumed in the process from intercepting the start graph to intercepting the end graph. In the process, the time point for starting loading and the time point for finishing loading do not need to be acquired, so that errors caused by inaccurate acquisition of the time points are avoided, and the accuracy of detecting the page loading time is improved.
With further reference to fig. 3, as an implementation of the methods shown in the above-mentioned figures, the present application provides an embodiment of an apparatus for detecting page loading time, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 1, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 3, the apparatus 300 for detecting page loading time according to this embodiment includes: the screenshot unit 301 is configured to perform continuous screenshot on the display interface through a preset screenshot tool, and load a page to be tested in the continuous screenshot process; an acquisition unit 302 configured to acquire a time consumption of each screenshot; an identifying unit 303, configured to identify a start graph and an end graph in the process of loading the page to be tested from the intercepted graph; a summation unit 304 configured to take the sum of the elapsed times of the clipping of the start map, the end map, and the respective maps between the start map and the end map as the loading time of the page to be tested.
In some optional implementations of the present embodiment, the identifying unit 303 is further configured to: respectively extracting first image content located in the first characteristic region and second image content located in the second characteristic region from the intercepted images; matching the first image content in each image with a first reference image acquired in advance, and determining a starting image in the loading process of the page to be detected based on a matching result; and matching the second image content in each image with a second reference image acquired in advance, and determining an end image in the loading process of the page to be detected based on a matching result.
In some optional implementations of the present embodiment, the first reference image is obtained in advance by: selecting first target content from a display interface before loading a page to be tested, wherein the first target content is changed or disappeared in the loading process of the page to be tested; taking the area where the first target content is as a first characteristic area; and taking the image which is positioned in the first characteristic region in the display interface before the page to be tested is loaded as a first reference image.
In some optional implementations of the present embodiment, the identifying unit 303 is further configured to: acquiring pixel data corresponding to first image content in each image; respectively determining first similarity of the acquired pixel data and pixel data of a first reference image acquired in advance; and selecting the graph with the latest intercepting time from the intercepted graphs with the first similarity larger than the first preset threshold value as the initial graph in the loading process of the page to be detected.
In some optional implementations of the present embodiment, the first reference image is obtained in advance by: selecting second target content from a display interface after the page to be tested is loaded, wherein the second target content is content which is not presented before the page to be tested is loaded and is presented from the initial moment of the page to be tested; taking the area where the second target content is as a first characteristic area; and taking the image which is positioned in the first characteristic region in the display interface after the page to be tested is loaded as a first reference image.
In some optional implementations of the present embodiment, the identifying unit 303 is further configured to: acquiring pixel data corresponding to first image content in each image; respectively determining first similarity of the acquired pixel data and pixel data of a first reference image acquired in advance; and selecting the graph with the earliest interception time from the intercepted graphs with the first similarity larger than the first preset threshold value as the initial graph in the loading process of the page to be detected.
In some optional implementations of the present embodiment, the second reference image is obtained in advance by: selecting third target content from a display interface after the page to be tested is loaded, wherein the third target content is content which is not presented before the page to be tested is loaded; taking the area where the third target content is as a second characteristic area; and taking the image which is positioned in the second characteristic area in the display interface after the loading of the page to be tested is finished as a second reference image.
In some optional implementations of the present embodiment, the identifying unit 303 is further configured to: acquiring pixel data corresponding to second image content in each image; respectively determining second similarity of the acquired pixel data and pixel data of a second reference image acquired in advance; and selecting the graph with the earliest interception time from the intercepted graphs with the second similarity larger than a second preset threshold value as an end graph in the loading process of the page to be detected.
According to the device provided by the embodiment of the application, continuous screenshot is carried out on the display interface through the preset screenshot tool, and the page to be tested is loaded in the continuous screenshot process; then acquiring the time consumption of each screenshot; then, identifying a starting graph and an ending graph in the loading process of the page to be tested from the intercepted graph; and finally, taking the sum of the time consumption of the intercepted starting graph, the intercepted ending graph and each graph intercepted between the starting graph and the ending graph as the loading time of the page to be tested. Because the preset screenshot tool can continuously and quickly screenshot the display interface and accurately record the time consumed by each screenshot, after the start image and the end image in the loading process of the page to be detected are identified, the accurate page loading duration can be obtained by counting the time consumed in the process from intercepting the start image to intercepting the end image. In the process, the time point for starting loading and the time point for finishing loading do not need to be acquired, so that errors caused by inaccurate acquisition of the time points are avoided, and the accuracy of detecting the page loading time is improved.
Referring now to FIG. 4, shown is a block diagram of a computer system 400 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the system 400 are also stored. The CPU401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section 407 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411. The computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 401. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The units described may also be provided in a processor, where the names of the units do not in some cases constitute a limitation of the units themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: continuously screenshot is carried out on a display interface through a preset screenshot tool, and a page to be tested is loaded in the continuous screenshot process; acquiring the time consumption of each screenshot; identifying a starting graph and an ending graph in the loading process of the page to be detected from the intercepted graph; and taking the sum of the time consumption of the intercepted starting graph, the intercepted ending graph and the graphs intercepted between the starting graph and the ending graph as the loading time of the page to be tested.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (11)

1. A method for detecting page loading time is characterized in that the method comprises the following steps:
continuously screenshot is carried out on a display interface through a preset screenshot tool, and a page to be tested is loaded in the continuous screenshot process;
acquiring the time consumption of each screenshot;
identifying a starting graph and an ending graph in the loading process of the page to be detected from the intercepted graph;
and taking the sum of the time consumption of the intercepted starting graph, the intercepted ending graph and the graphs intercepted between the starting graph and the ending graph as the loading time of the page to be tested.
2. The method according to claim 1, wherein the identifying a start graph and an end graph in the loading process of the page to be tested from the intercepted graph comprises:
respectively extracting first image content located in the first characteristic region and second image content located in the second characteristic region from the intercepted images;
matching the first image content in each image with a first reference image acquired in advance, and determining a starting image in the loading process of the page to be detected based on a matching result;
and matching the second image content in each image with a second reference image acquired in advance, and determining an end image in the loading process of the page to be detected based on a matching result.
3. The method according to claim 2, characterized in that said first reference image is acquired beforehand by:
selecting first target content from a display interface before loading a page to be tested, wherein the first target content is changed or disappeared in the loading process of the page to be tested;
taking the area where the first target content is as a first characteristic area;
and taking the image which is positioned in the first characteristic region in the display interface before the page to be tested is loaded as a first reference image.
4. The method according to claim 3, wherein the matching the first image content in each graph with a first reference image obtained in advance, and determining a starting graph in the loading process of the page to be tested based on the matching result comprises:
acquiring pixel data corresponding to first image content in each image;
respectively determining first similarity of the acquired pixel data and pixel data of a first reference image acquired in advance;
and selecting the graph with the latest intercepting time from the intercepted graphs with the first similarity larger than the first preset threshold value as the initial graph in the loading process of the page to be detected.
5. The method according to claim 2, characterized in that said first reference image is acquired beforehand by:
selecting second target content from a display interface after the page to be tested is loaded, wherein the second target content is content which is not presented before the page to be tested is loaded and is presented from the initial moment of the page to be tested;
taking the area where the second target content is as a first characteristic area;
and taking the image which is positioned in the first characteristic region in the display interface after the page to be tested is loaded as a first reference image.
6. The method according to claim 5, wherein the matching the first image content in each graph with a first reference image obtained in advance, and determining a starting graph in the loading process of the page to be tested based on the matching result comprises:
acquiring pixel data corresponding to first image content in each image;
respectively determining first similarity of the acquired pixel data and pixel data of a first reference image acquired in advance;
and selecting the graph with the earliest interception time from the intercepted graphs with the first similarity larger than a first preset threshold value as an initial graph in the loading process of the page to be detected.
7. The method according to claim 2, characterized in that said second reference image is acquired beforehand by:
selecting third target content from a display interface after the page to be tested is loaded, wherein the third target content is content which is not presented before the page to be tested is loaded;
taking the area where the third target content is as a second characteristic area;
and taking the image which is positioned in the second characteristic area in the display interface after the loading of the page to be tested is finished as a second reference image.
8. The method according to claim 7, wherein the matching the second image content in each graph with a second reference image obtained in advance, and determining an end graph in the loading process of the page to be tested based on the matching result comprises:
acquiring pixel data corresponding to second image content in each image;
respectively determining second similarity of the acquired pixel data and pixel data of a second reference image acquired in advance;
and selecting the graph with the earliest interception time from the intercepted graphs with the second similarity larger than a second preset threshold value as an end graph in the loading process of the page to be detected.
9. An apparatus for detecting page loading time, the apparatus comprising:
the screenshot unit is configured to perform continuous screenshot on a display interface through a preset screenshot tool and load a page to be tested in the continuous screenshot process;
an acquisition unit configured to acquire a time consumption of each screenshot;
the identification unit is configured to identify a starting graph and an ending graph in the loading process of the page to be detected from the intercepted graph;
a summation unit configured to take the sum of the elapsed time of the cutting of the start graph, the end graph, and the graphs between the start graph and the end graph as the loading time of the page to be tested.
10. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
11. A computer-readable 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-8.
CN201911121916.1A 2019-11-15 2019-11-15 Page loading time detection method and device and electronic equipment Active CN111026989B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911121916.1A CN111026989B (en) 2019-11-15 2019-11-15 Page loading time detection method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911121916.1A CN111026989B (en) 2019-11-15 2019-11-15 Page loading time detection method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111026989A true CN111026989A (en) 2020-04-17
CN111026989B CN111026989B (en) 2023-06-27

Family

ID=70200241

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911121916.1A Active CN111026989B (en) 2019-11-15 2019-11-15 Page loading time detection method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111026989B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579416A (en) * 2020-12-11 2021-03-30 广州品唯软件有限公司 Page loading duration statistical method, terminal and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106161133A (en) * 2015-04-21 2016-11-23 腾讯科技(深圳)有限公司 The method of testing of a kind of web page loading time and device
CN108228463A (en) * 2018-01-10 2018-06-29 百度在线网络技术(北京)有限公司 For detecting the method and apparatus of initial screen time
US20180342019A1 (en) * 2017-05-27 2018-11-29 Beijing Xiaomi Mobile Software Co., Ltd. Method and device for acquiring transaction record, and computer readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106161133A (en) * 2015-04-21 2016-11-23 腾讯科技(深圳)有限公司 The method of testing of a kind of web page loading time and device
US20180342019A1 (en) * 2017-05-27 2018-11-29 Beijing Xiaomi Mobile Software Co., Ltd. Method and device for acquiring transaction record, and computer readable storage medium
CN108228463A (en) * 2018-01-10 2018-06-29 百度在线网络技术(北京)有限公司 For detecting the method and apparatus of initial screen time

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘永明;杨婧;: "基于图像相似性的Android钓鱼恶意应用检测方法" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579416A (en) * 2020-12-11 2021-03-30 广州品唯软件有限公司 Page loading duration statistical method, terminal and readable storage medium

Also Published As

Publication number Publication date
CN111026989B (en) 2023-06-27

Similar Documents

Publication Publication Date Title
CN109034069B (en) Method and apparatus for generating information
WO2020029466A1 (en) Image processing method and apparatus
KR20140091555A (en) Measuring web page rendering time
CN110660102B (en) Speaker recognition method, device and system based on artificial intelligence
CN110866205B (en) Method and apparatus for storing information
CN110070076B (en) Method and device for selecting training samples
CN107193747B (en) Code testing method and device and computer equipment
CN110826646A (en) Robot vision testing method and device, storage medium and terminal equipment
CN113268180A (en) Data annotation method, device, equipment, computer readable storage medium and product
CN114494935A (en) Video information processing method and device, electronic equipment and medium
CN111340015A (en) Positioning method and device
CN111026989B (en) Page loading time detection method and device and electronic equipment
CN113138916A (en) Automatic testing method and system for picture structuring algorithm based on labeled sample
CN116048946B (en) Performance detection method, host and storage medium
CN113034580B (en) Image information detection method and device and electronic equipment
CN108415656B (en) Display control method, device, medium and electronic equipment in virtual scene
CN109887124B (en) Vehicle motion data processing method and device, computer equipment and storage medium
CN114842476A (en) Watermark detection method and device and model training method and device
CN114972500A (en) Checking method, marking method, system, device, terminal, equipment and medium
CN112364765A (en) Method and device for detecting human eye movement fixation point
CN110968519A (en) Game testing method, device, server and storage medium
CN111949819A (en) Method and device for pushing video
CN114511694B (en) Image recognition method, device, electronic equipment and medium
CN115016760B (en) Data processing method, device, equipment and medium
CN110704294B (en) Method and apparatus for determining response 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