CN112052150A - Page loading time detection method, equipment, storage medium and device - Google Patents

Page loading time detection method, equipment, storage medium and device Download PDF

Info

Publication number
CN112052150A
CN112052150A CN202010925460.0A CN202010925460A CN112052150A CN 112052150 A CN112052150 A CN 112052150A CN 202010925460 A CN202010925460 A CN 202010925460A CN 112052150 A CN112052150 A CN 112052150A
Authority
CN
China
Prior art keywords
page loading
page
event
loading time
frame
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
CN202010925460.0A
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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202010925460.0A priority Critical patent/CN112052150A/en
Publication of CN112052150A publication Critical patent/CN112052150A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • G06F11/3419Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment by assessing time

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The invention relates to the technical field of Internet, and discloses a page loading time detection method, a device, a storage medium and a device, wherein the method comprises the following steps: when a page loading event is detected, searching a starting frame corresponding to the page loading event in a target screen recording video, determining an ending frame of the page loading event according to a preset image contrast model and the target screen recording video, and determining current page loading time according to the starting frame and the ending frame; compared with the existing mode of manually confirming the starting frame and the ending frame, the starting frame is determined according to the page loading event, the ending frame is determined according to the preset image comparison model, and the current page loading time is determined according to the starting frame and the ending frame, so that the defect that the page loading time cannot be objectively detected in the prior art is overcome, the page loading time can be accurately detected, and the user requirements are met.

Description

Page loading time detection method, equipment, storage medium and device
Technical Field
The invention relates to the technical field of internet, in particular to a page loading time detection method, equipment, a storage medium and a device.
Background
With the rapid development of computer technology and internet technology, users are pursuing smooth operation experience more and more when using application programs.
At present, when a developer of an application program detects page loading time of the application program, an adopted detection mode is generally as follows: the method comprises the steps of recording a complete video loaded on a page through a high-definition high-speed camera in a screen-recording and frame-dividing mode, disassembling the video into a frame-by-frame picture through a tool, manually finding out a starting frame and an ending frame from the picture, and calculating the time consumed by loading through the time difference between the frames.
However, the above detection method has the following disadvantages: the starting frame and the ending frame are manually found out by relying on manual operation intervention, certain subjectivity is achieved, different results can be obtained by different personnel, the operation is complicated, more time is consumed, and the overall efficiency is not high.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a method, equipment, a storage medium and a device for detecting page loading time, and aims to solve the technical problem of how to accurately detect the page loading time.
In order to achieve the above object, the present invention provides a method for detecting page loading time, which comprises the following steps:
when a page loading event is detected, searching a starting frame corresponding to the page loading event in a target screen recording video;
determining an end frame of the page loading event according to a preset image comparison model and the target screen recording video;
and determining the current page loading time according to the starting frame and the ending frame.
Preferably, before the step of searching for a start frame corresponding to the page loading event in the target screen recording video when the page loading event is detected, the page loading time detection method further includes:
monitoring a click event of a target terminal interface based on a preset script;
when a click event is monitored, acquiring a system event log, screening the system event log to obtain a touch event log, wherein the system event log is stored in a block chain;
detecting whether preset type data exist in the touch event log or not;
and when the preset type data exists in the touch event log, judging that a page loading event exists.
Preferably, the step of searching for a start frame corresponding to the page loading event in the target screen recording video when the page loading event is detected specifically includes:
when a page loading event is detected, searching a page creation time point corresponding to the page loading event in the touch event log;
and marking the target screen recording video according to the page creation time point to obtain a starting frame of the page loading event.
Preferably, the step of determining an end frame of the page loading event according to a preset image contrast model and the target screen recording video specifically includes:
comparing and analyzing the target screen recording video based on a preset image comparison model to obtain an analysis result;
and marking the target screen recording video according to the analysis result to obtain an end frame of the page loading event.
Preferably, the step of performing comparative analysis on the target screen recording video based on a preset image comparison model to obtain an analysis result specifically includes:
performing image extraction on the target screen recording video through a preset extraction strategy to obtain a first single-frame image and a second single-frame image;
calculating image similarity between the first single-frame image and the second single-frame image based on a preset image contrast model;
and carrying out comparison analysis on the target screen recording video according to the image similarity to obtain an analysis result.
Preferably, after the step of determining the current page loading time according to the start frame and the end frame, the page loading time detection method further includes:
counting the current detection times of page loading time detection, and judging whether the current detection times are equal to preset times or not;
and when the current detection times are not equal to the preset times, adjusting the current detection times, and returning to the step of searching for the initial frame corresponding to the page loading event in the target screen recording video until the current detection times are equal to the preset times.
Preferably, after the step of counting the current detection times of the page loading time detection and determining whether the current detection times is equal to a preset number, the page loading time detection method further includes:
when the current detection times are equal to the preset times, generating a current page loading time set according to the current page loading time, and calculating average loading time according to the current page loading time set;
traversing the page loading time in the current page loading time set, and taking the traversed page loading time as the page loading time to be detected;
calculating a time difference value between the loading time of the page to be detected and the average loading time, and judging whether the time difference value is greater than a preset threshold value or not;
when the time difference is larger than the preset threshold, taking the loading time of the page to be detected as the loading time of the abnormal page;
after traversing the page loading time, screening the current page loading time set according to the abnormal page loading time to obtain a target page loading time set;
and determining the target page loading time according to the target page loading time set.
In addition, in order to achieve the above object, the present invention further provides a page loading time detection apparatus, where the page loading time detection apparatus includes a memory, a processor, and a page loading time detection program stored in the memory and capable of running on the processor, and the page loading time detection program is configured to implement the steps of the page loading time detection method described above.
In addition, in order to achieve the above object, the present invention further provides a storage medium, where a page loading time detection program is stored, and when the page loading time detection program is executed by a processor, the steps of the page loading time detection method are implemented as described above.
In addition, to achieve the above object, the present invention further provides a page loading time detection apparatus, where the page loading time detection apparatus includes: the device comprises a searching module, a determining module and a detecting module;
the searching module is used for searching a starting frame corresponding to a page loading event in a target screen recording video when the page loading event is detected;
the determining module is used for determining an end frame of the page loading event according to a preset image contrast model and the target screen recording video;
and the detection module is used for determining the current page loading time according to the starting frame and the ending frame.
In the invention, when a page loading event is detected, a starting frame corresponding to the page loading event is searched in a target screen recording video, an ending frame of the page loading event is determined according to a preset image contrast model and the target screen recording video, and the current page loading time is determined according to the starting frame and the ending frame; compared with the existing mode of manually confirming the starting frame and the ending frame, the starting frame is determined according to the page loading event, the ending frame is determined according to the preset image comparison model, and the current page loading time is determined according to the starting frame and the ending frame, so that the defect that the page loading time cannot be objectively detected in the prior art is overcome, the page loading time can be accurately detected, and the user requirements are met.
Drawings
Fig. 1 is a schematic structural diagram of a page load time detection device of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for detecting page loading time according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a page loading time detection method according to a second embodiment of the present invention;
FIG. 4 is a flowchart illustrating a page loading time detection method according to a third embodiment of the present invention;
fig. 5 is a block diagram of a first embodiment of the page loading time detection apparatus according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a page load time detection device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the page load time detection apparatus may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), and the optional user interface 1003 may further include a standard wired interface and a wireless interface, and the wired interface for the user interface 1003 may be a USB interface in the present invention. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory or a Non-volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the page load time detection apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in FIG. 1, memory 1005, identified as one type of computer storage medium, may include an operating system, a network communication module, a user interface module, and a page load time detection program.
In the page loading time detection device shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server and performing data communication with the background server; the user interface 1003 is mainly used for connecting user equipment; the page loading time detection device calls a page loading time detection program stored in the memory 1005 through the processor 1001, and executes the page loading time detection method provided by the embodiment of the present invention.
Based on the hardware structure, the embodiment of the page loading time detection method is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for detecting page loading time according to a first embodiment of the present invention.
Step S10: when a page loading event is detected, a starting frame corresponding to the page loading event is searched in a target screen recording video.
It should be noted that the main execution body of this embodiment is the page loading time detection device, where the page loading time detection device may be an electronic device such as a mobile phone, a tablet computer, a personal computer, and a server, and may also be another device that can achieve the same or similar functions.
It should be noted that the page loading event may be an event for loading a page of the application program; the target screen recording video can be a video obtained by recording a target terminal interface; the target terminal interface may be a terminal device for installing the application to be detected, and in this embodiment, a mobile phone is taken as an example for description.
It should be understood that, when a page loading event is detected, searching for a start frame corresponding to the page loading event in a target screen recording video may be that, when a page loading event is detected, searching for a page creation time point corresponding to the page loading event in the touch event log, and marking the target screen recording video according to the page creation time point to obtain the start frame of the page loading event.
The touch event log may store data such as time information of the touch event; the page creation time point may be the open time of the currently loaded page.
It should be understood that the target screen-recorded video may be composed of a time axis as well as frames. Therefore, the target screen recording video can be directly marked according to the page creation time point, and the initial frame of the page loading event is obtained.
Step S20: and determining an end frame of the page loading event according to a preset image contrast model and the target screen recording video.
It should be understood that the determining of the end frame of the page loading event according to the preset image contrast model and the target screen recording video may be comparing and analyzing the target screen recording video based on the preset image contrast model to obtain an analysis result, and marking the target screen recording video according to the analysis result to obtain the end frame of the page loading event.
Further, in consideration of practical application, if the target screen recording video is directly subjected to comparison analysis based on a preset image comparison model, the video is inevitably processed, and the calculation amount is too large. In order to overcome this drawback, the comparing and analyzing the target screen recording video based on the preset image comparison model to obtain an analysis result includes:
performing image extraction on the target screen recording video through a preset extraction strategy to obtain a first single-frame image and a second single-frame image; calculating image similarity between the first single-frame image and the second single-frame image based on a preset image contrast model; and carrying out comparison analysis on the target screen recording video according to the image similarity to obtain an analysis result.
It should be noted that the preset extraction policy may be an image extraction policy preset by a user, in this embodiment, taking an example of extracting images in a target screen recording video frame by frame in reverse order from back to front as an example, which is not limited in this embodiment; the preset image contrast model may be at least one of opencv, PIL, and sketch, and in the present embodiment, opencv is taken as an example for description.
Step S30: and determining the current page loading time according to the starting frame and the ending frame.
It should be appreciated that determining the current page load time from the start frame and the end frame may be determining a current time difference from the start frame and the end frame, and determining the current page load time from the current time difference.
In a first embodiment, when a page loading event is detected, a start frame corresponding to the page loading event is searched in a target screen recording video, an end frame of the page loading event is determined according to a preset image contrast model and the target screen recording video, and current page loading time is determined according to the start frame and the end frame; compared with the existing mode of manually confirming the starting frame and the ending frame, the starting frame is determined according to the page loading event, the ending frame is determined according to the preset image contrast model, and the current page loading time is determined according to the starting frame and the ending frame, so that the defect that the page loading time cannot be objectively detected in the prior art is overcome, the page loading time can be accurately detected, and the user requirements are met.
Referring to fig. 3, fig. 3 is a flowchart illustrating a page loading time detection method according to a second embodiment of the present invention, and the second embodiment of the page loading time detection method according to the present invention is proposed based on the first embodiment illustrated in fig. 2.
In the second embodiment, before the step S10, the method further includes:
step S01: and monitoring the click event of the target terminal interface based on a preset script.
It should be noted that the preset script may be an automation script, for example, a get event command of an ADB shell script; the target terminal interface may be a terminal device for installing the application to be detected, and in this embodiment, a mobile phone is taken as an example for description; the click event may be a single click, a double click, a long press, etc., which is not limited in this embodiment.
In a specific implementation, for example, the monitoring of the click event of the target terminal interface based on the preset script may be based on a get event command of the ADB shell, and the click event of the mobile phone screen is monitored in real time.
Step S02: when a click event is monitored, a system event log is obtained, the system event log is screened, and a touch event log is obtained, wherein the system event log is stored in a block chain.
It should be noted that the system event log may be a system event log of the target terminal corresponding to the target terminal interface, and the system event log may be information of an event occurring in the monitoring system, which is not limited in this embodiment; the touch event log may be a touch event log of a single click, a double click, a long press, and the like, which is not limited in this embodiment.
It should be understood that, acquiring the system event log may be to execute a preset log script to extract the system event log, where the preset log script may be set according to an actual requirement of a user, and this embodiment is not limited thereto.
It can be understood that the system event log is screened, and the obtaining of the touch event log may be detecting whether an event identifier corresponding to the system event log is a preset identifier, and when the event identifier is the preset identifier, the system event log is used as the touch event log. The preset identifier may be identifier bit information for identifying a touch event, which is preset by a user.
It is emphasized that to further ensure privacy and security of the system event log, the system event log may also be stored in a node of a blockchain.
Step S03: and detecting whether preset type data exist in the touch event log.
It should be noted that the preset type data may be page loading type data.
It can be understood that the detecting whether the preset type data exists in the touch event log may be performing data analysis on the touch event log to obtain a data analysis result, and determining whether the preset type data exists in the touch event log according to the data analysis result.
Step S04: and when the preset type data exists in the touch event log, judging that a page loading event exists.
It should be understood that when the preset type data exists in the touch event log, it indicates that the target terminal has started to load a page at this time. Thus, it may be determined that a page load event exists.
In a second embodiment, click event monitoring is performed on a target terminal interface based on a preset script, when a click event is monitored, a system event log is obtained and is screened to obtain a touch event log, wherein the system event log is stored in a block chain, whether preset type data exists in the touch event log is detected, and when the preset type data exists in the touch event log, a page loading event is judged to exist; according to the method and the device, the click event is monitored through the preset script, the system event log is obtained when the click event is monitored, the system event log is screened to obtain the touch event log, whether the page loading event exists or not is judged according to the touch event log, therefore, the starting point of the page loading process can be automatically determined, and the testing efficiency is higher.
In the second embodiment, the step S10 includes:
step S101: and when a page loading event is detected, searching a page creation time point corresponding to the page loading event in the touch event log.
The touch event log may store data such as time information of the touch event; the page creation time point may be the open time of the currently loaded page.
It should be understood that, when the page loading time is detected, finding the page creation time point corresponding to the page loading event in the touch event log may be to find time information of the page loading event in the touch event log, and determine the page creation time point corresponding to the page loading event according to the time information.
Step S102: and marking the target screen recording video according to the page creation time point to obtain a starting frame of the page loading event.
It should be understood that the target screen-recorded video may be composed of a time axis as well as frames. Therefore, the target screen recording video can be directly marked according to the page creation time point, and the initial frame of the page loading event is obtained.
In a second embodiment, when a page loading event is detected, a page creation time point corresponding to the page loading event is searched in the touch event log, a target screen recording video is marked according to the page creation time point, and a start frame of the page loading event is obtained; according to the method and the device for detecting the page loading event, the page creation time point corresponding to the page loading event is searched in the touch event log, and the initial frame of the page loading event is obtained according to the page creation time point, so that the initial frame of the page loading event can be automatically marked, and the test result is more accurate.
In the second embodiment, the step S20 includes:
step S201: and carrying out comparison analysis on the target screen recording video based on a preset image comparison model to obtain an analysis result.
It should be understood that, the target screen recording video is subjected to comparative analysis based on the preset image contrast model, and the analysis result may be obtained by directly performing comparative analysis on the target screen recording video based on the preset image contrast model to obtain a video difference change trend, and determining an interface stabilization time point according to the video difference change trend, and taking the interface stabilization time point as the analysis result.
Further, in consideration of practical application, if the target screen recording video is directly subjected to comparison analysis based on a preset image comparison model, the video is inevitably processed, and the calculation amount is too large. To overcome this drawback, step S201 includes:
performing image extraction on the target screen recording video through a preset extraction strategy to obtain a first single-frame image and a second single-frame image;
calculating image similarity between the first single-frame image and the second single-frame image based on a preset image contrast model;
and carrying out comparison analysis on the target screen recording video according to the image similarity to obtain an analysis result.
It should be noted that the preset extraction policy may be an image extraction policy preset by a user, in this embodiment, taking an example of extracting images in a target screen recording video frame by frame in reverse order from back to front as an example, which is not limited in this embodiment; the preset image contrast model may be at least one of opencv, PIL, and sketch, and in the present embodiment, opencv is taken as an example for description.
It should be understood that, by performing image extraction on the target screen recording video through a preset extraction strategy, obtaining the first single-frame image and the second single-frame image may extract images in the target screen recording video frame by frame in reverse order from back to front, obtaining the first single-frame image and the second single-frame image.
It is to be understood that calculating the image similarity between the first single frame image and the second single frame image based on the preset image contrast model may be calculating the image similarity between the first single frame image and the second single frame image based on opencv.
It should be understood that, the target screen recording video is subjected to comparative analysis according to the image similarity, and the obtained analysis result may be that whether the image similarity is smaller than a preset similarity threshold value or not is judged, and when the image similarity is smaller than the preset similarity threshold value, the page loading interface is in a stable state as an analysis result; when the image similarity is greater than or equal to a preset similarity threshold, taking the analysis result as that the page loading interface is not in a stable state, where the preset similarity threshold may be set according to a user requirement, and this embodiment is not limited thereto.
Step S202: and marking the target screen recording video according to the analysis result to obtain an end frame of the page loading event.
It should be understood that, the marking of the target screen recording video according to the analysis result and the obtaining of the end frame of the page loading event may be to search a time point corresponding to the first single-frame image or the second single-frame image when the analysis result is that the page loading interface is in a stable state, and directly mark the target screen recording video according to the time point to obtain the end frame of the page loading event.
In a second embodiment, the target screen recording video is subjected to comparative analysis based on a preset image comparative model to obtain an analysis result, and the target screen recording video is marked according to the analysis result to obtain an end frame of the page loading event; the embodiment performs comparison analysis on the target screen recording video based on the preset image comparison model, marks the target screen recording video according to the analysis result, and obtains the end frame of the page loading event, so that the end frame of the page loading event can be automatically marked, and the test result is more accurate.
Referring to fig. 4, fig. 4 is a flowchart illustrating a third embodiment of the method for detecting page loading time according to the present invention, and the third embodiment of the method for detecting page loading time according to the present invention is proposed based on the first embodiment illustrated in fig. 2.
In the third embodiment, after the step S30, the method further includes:
step S40: counting the current detection times of page loading time detection, and judging whether the current detection times are equal to preset times or not.
It should be noted that the current detection times may be execution times for identifying page loading time detection; the set of page load times may be a set used to deposit page load times.
It should be understood that the current number of detections of the statistical page load time detection may be the current number of detections of the statistical page load time detection in a preset database, wherein the preset database may be preset by a user.
It can be understood that the generating of the current page loading time set according to the current page loading time may be to store the current page loading time in an initial page loading time set to obtain the current page loading time set, where the initial page loading time set may be a page loading time set of a previous time.
It should be noted that the preset number of times may be set according to a user requirement, for example, when the user needs to perform 5 page loading time detection tasks, the preset number of times may be set to 5.
Further, after the step S40, the method further includes:
when the current detection times are equal to the preset times, generating a current page loading time set according to the current page loading time, and calculating average loading time according to the current page loading time set;
traversing the page loading time in the current page loading time set, and taking the traversed page loading time as the page loading time to be detected;
calculating a time difference value between the loading time of the page to be detected and the average loading time, and judging whether the time difference value is greater than a preset threshold value or not;
when the time difference is larger than the preset threshold, taking the loading time of the page to be detected as the loading time of the abnormal page;
after traversing the page loading time, screening the current page loading time set according to the abnormal page loading time to obtain a target page loading time set;
and determining the target page loading time according to the target page loading time set.
It should be understood that when the current number of detections is equal to the preset number, it indicates that the detection task set by the user has been completed. At this time, the target page loading time may be output after the data processing is performed on the current page loading time set.
It can be understood that, the data processing on the current page loading time set may be to calculate an average loading time of the current page loading time set, calculate a time difference between the page loading time in the current page loading time set and the average loading time, and determine whether the time difference is greater than a preset threshold, where when the time difference is greater than the preset threshold, it indicates that the page loading time is too large or too small, and is the abnormal page loading time. Therefore, the abnormal page loading time needs to be deleted from the current page loading time set to obtain the target page loading time set. At this time, an average value of the target page load time set may be calculated as the target page load time.
Step S50: and when the current detection times are not equal to the preset times, adjusting the current detection times, and returning to the step of searching for the initial frame corresponding to the page loading event in the target screen recording video until the current detection times are equal to the preset times.
It can be understood that when the current detection number of times is not equal to the preset number of times, it indicates that the detection task set by the user is not completed, and at this time, the step of searching for the start frame corresponding to the page loading event in the target screen recording video needs to be returned again.
In a third embodiment, counting the current detection times of page loading time detection, and determining whether the current detection times are equal to preset times, when the current detection times are not equal to the preset times, adjusting the current detection times, and returning to the step of searching for a start frame corresponding to the page loading event in a target screen recording video until the current detection times are equal to the preset times; the embodiment judges that the current detection times are equal to the preset times, and returns to the step of searching the initial frame corresponding to the page loading event in the target screen recording video when the current detection times are not equal to the preset times, so that the detection task set by the user can be accurately completed.
In addition, an embodiment of the present invention further provides a storage medium, where a page loading time detection program is stored on the storage medium, and the page loading time detection program, when executed by a processor, implements the steps of the page loading time detection method described above.
In addition, referring to fig. 5, an embodiment of the present invention further provides a device for detecting page loading time, where the device for detecting page loading time includes: the searching module 10, the determining module 20 and the detecting module 30;
the searching module 10 is configured to search, when a page loading event is detected, a start frame corresponding to the page loading event in a target screen recording video.
It should be noted that the page loading event may be an event for loading a page of the application program; the target screen recording video can be a video obtained by recording a target terminal interface; the target terminal interface may be a terminal device for installing the application to be detected, and in this embodiment, a mobile phone is taken as an example for description.
It should be understood that, when a page loading event is detected, searching for a start frame corresponding to the page loading event in a target screen recording video may be that, when a page loading event is detected, searching for a page creation time point corresponding to the page loading event in the touch event log, and marking the target screen recording video according to the page creation time point to obtain the start frame of the page loading event.
The touch event log may store data such as time information of the touch event; the page creation time point may be the open time of the currently loaded page.
It should be understood that the target screen-recorded video may be composed of a time axis as well as frames. Therefore, the target screen recording video can be directly marked according to the page creation time point, and the initial frame of the page loading event is obtained.
The determining module 20 is configured to determine an end frame of the page loading event according to a preset image contrast model and the target screen recording video.
It should be understood that the determining of the end frame of the page loading event according to the preset image contrast model and the target screen recording video may be comparing and analyzing the target screen recording video based on the preset image contrast model to obtain an analysis result, and marking the target screen recording video according to the analysis result to obtain the end frame of the page loading event.
Further, in consideration of practical application, if the target screen recording video is directly subjected to comparison analysis based on a preset image comparison model, the video is inevitably processed, and the calculation amount is too large. In order to overcome this drawback, the comparing and analyzing the target screen recording video based on the preset image comparison model to obtain an analysis result includes:
performing image extraction on the target screen recording video through a preset extraction strategy to obtain a first single-frame image and a second single-frame image; calculating image similarity between the first single-frame image and the second single-frame image based on a preset image contrast model; and carrying out comparison analysis on the target screen recording video according to the image similarity to obtain an analysis result.
It should be noted that the preset extraction policy may be an image extraction policy preset by a user, in this embodiment, taking an example of extracting images in a target screen recording video frame by frame in reverse order from back to front as an example, which is not limited in this embodiment; the preset image contrast model may be at least one of opencv, PIL, and sketch, and in the present embodiment, opencv is taken as an example for description.
The detecting module 30 is configured to determine a current page loading time according to the start frame and the end frame.
It should be appreciated that determining the current page load time from the start frame and the end frame may be determining a current time difference from the start frame and the end frame, and determining the current page load time from the current time difference.
In this embodiment, when a page loading event is detected, a start frame corresponding to the page loading event is searched in a target screen recording video, an end frame of the page loading event is determined according to a preset image contrast model and the target screen recording video, and current page loading time is determined according to the start frame and the end frame; compared with the existing mode of manually confirming the starting frame and the ending frame, the starting frame is determined according to the page loading event, the ending frame is determined according to the preset image contrast model, and the current page loading time is determined according to the starting frame and the ending frame, so that the defect that the page loading time cannot be objectively detected in the prior art is overcome, the page loading time can be accurately detected, and the user requirements are met.
In an embodiment, the page load time detection apparatus further includes: a decision module;
the judging module is used for monitoring a click event of a target terminal interface based on a preset script, acquiring a system event log when the click event is monitored, screening the system event log to obtain a touch event log, wherein the system event log is stored in a block chain, screening the system event log according to the type of the log event to obtain the touch event log, detecting whether preset type data exists in the touch event log, and judging that a page loading event exists when the preset type data exists in the touch event log;
in an embodiment, the searching module 10 is further configured to search, when a page loading event is detected, a page creation time point corresponding to the page loading event in the touch event log, mark a target screen recording video according to the page creation time point, and obtain a start frame of the page loading event;
in an embodiment, the determining module 20 is further configured to perform comparison analysis on the target screen recording video based on a preset image comparison model to obtain an analysis result, mark the target screen recording video according to the analysis result, and obtain an end frame of the page loading event;
in an embodiment, the determining module 20 is further configured to perform image extraction on the target screen recording video through a preset extraction policy to obtain a first single-frame image and a second single-frame image, calculate an image similarity between the first single-frame image and the second single-frame image based on a preset image comparison model, perform contrast analysis on the target screen recording video according to the image similarity, and obtain an analysis result;
in an embodiment, the page load time detection apparatus further includes: a judgment module;
the judging module is used for counting the current detection times of page loading time detection, judging whether the current detection times are equal to preset times or not, adjusting the current detection times when the current detection times are not equal to the preset times, and returning to the step of searching for the initial frame corresponding to the page loading event in the target screen recording video until the current detection times are equal to the preset times;
in an embodiment, the determining module is further configured to, when the current detection number is equal to the preset number, generate a current page loading time set according to the current page loading time, calculate an average loading time according to the current page loading time set, traverse the page loading time in the current page loading time set, use the traversed page loading time as a to-be-detected page loading time, calculate a time difference between the to-be-detected page loading time and the average loading time, and determine whether the time difference is greater than a preset threshold, when the time difference is greater than the preset threshold, use the to-be-detected page loading time as an abnormal page loading time, and after the traversal of the page loading time is completed, screen the current page loading time set according to the abnormal page loading time, and obtaining a target page loading time set, and determining the target page loading time according to the target page loading time set.
Other embodiments or specific implementation manners of the page loading time detection apparatus according to the present invention may refer to the above method embodiments, and are not described herein again.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second, third, etc. do not denote any order, but rather the words first, second, third, etc. are to be interpreted as names.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g., a Read Only Memory (ROM)/Random Access Memory (RAM), a magnetic disk, an optical disk), and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A page loading time detection method is characterized by comprising the following steps:
when a page loading event is detected, searching a starting frame corresponding to the page loading event in a target screen recording video;
determining an end frame of the page loading event according to a preset image comparison model and the target screen recording video;
and determining the current page loading time according to the starting frame and the ending frame.
2. The method for detecting page loading time according to claim 1, wherein before the step of searching for the start frame corresponding to the page loading event in the target screen recording video when the page loading event is detected, the method for detecting page loading time further comprises:
monitoring a click event of a target terminal interface based on a preset script;
when a click event is monitored, acquiring a system event log, screening the system event log to obtain a touch event log, wherein the system event log is stored in a block chain;
detecting whether preset type data exist in the touch event log or not;
and when the preset type data exists in the touch event log, judging that a page loading event exists.
3. The method for detecting page loading time according to claim 2, wherein the step of searching for a start frame corresponding to the page loading event in the target screen recording video when the page loading event is detected specifically comprises:
when a page loading event is detected, searching a page creation time point corresponding to the page loading event in the touch event log;
and marking the target screen recording video according to the page creation time point to obtain a starting frame of the page loading event.
4. The method for detecting page loading time according to claim 1, wherein the step of determining the end frame of the page loading event according to a preset image contrast model and the target screen recording video specifically comprises:
comparing and analyzing the target screen recording video based on a preset image comparison model to obtain an analysis result;
and marking the target screen recording video according to the analysis result to obtain an end frame of the page loading event.
5. The method for detecting page loading time according to claim 4, wherein the step of performing comparative analysis on the target screen recording video based on a preset image comparative model to obtain an analysis result specifically comprises:
performing image extraction on the target screen recording video through a preset extraction strategy to obtain a first single-frame image and a second single-frame image;
calculating image similarity between the first single-frame image and the second single-frame image based on a preset image contrast model;
and carrying out comparison analysis on the target screen recording video according to the image similarity to obtain an analysis result.
6. The method for detecting page load time according to any of claims 1-5, wherein after the step of determining the current page load time according to the start frame and the end frame, the method for detecting page load time further comprises:
counting the current detection times of page loading time detection, and judging whether the current detection times are equal to preset times or not;
and when the current detection times are not equal to the preset times, adjusting the current detection times, and returning to the step of searching for the initial frame corresponding to the page loading event in the target screen recording video until the current detection times are equal to the preset times.
7. The method for detecting page loading time according to claim 6, wherein after the step of counting the current detection times of the page loading time detection and determining whether the current detection times is equal to a preset number, the method for detecting page loading time further comprises:
when the current detection times are equal to the preset times, generating a current page loading time set according to the current page loading time, and calculating average loading time according to the current page loading time set;
traversing the page loading time in the current page loading time set, and taking the traversed page loading time as the page loading time to be detected;
calculating a time difference value between the loading time of the page to be detected and the average loading time, and judging whether the time difference value is greater than a preset threshold value or not;
when the time difference is larger than the preset threshold, taking the loading time of the page to be detected as the loading time of the abnormal page;
after traversing the page loading time, screening the current page loading time set according to the abnormal page loading time to obtain a target page loading time set;
and determining the target page loading time according to the target page loading time set.
8. A page load time detection device, characterized in that the page load time detection device comprises: memory, processor and page load time detection program stored on the memory and executable on the processor, the page load time detection program when executed by the processor implementing the steps of the page load time detection method according to any of claims 1 to 7.
9. A storage medium having stored thereon a page load time detection program, which when executed by a processor implements the steps of the page load time detection method of any one of claims 1 to 7.
10. A page loading time detection apparatus, wherein the page loading time detection apparatus comprises: the device comprises a searching module, a determining module and a detecting module;
the searching module is used for searching a starting frame corresponding to a page loading event in a target screen recording video when the page loading event is detected;
the determining module is used for determining an end frame of the page loading event according to a preset image contrast model and the target screen recording video;
and the detection module is used for determining the current page loading time according to the starting frame and the ending frame.
CN202010925460.0A 2020-09-03 2020-09-03 Page loading time detection method, equipment, storage medium and device Pending CN112052150A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010925460.0A CN112052150A (en) 2020-09-03 2020-09-03 Page loading time detection method, equipment, storage medium and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010925460.0A CN112052150A (en) 2020-09-03 2020-09-03 Page loading time detection method, equipment, storage medium and device

Publications (1)

Publication Number Publication Date
CN112052150A true CN112052150A (en) 2020-12-08

Family

ID=73607460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010925460.0A Pending CN112052150A (en) 2020-09-03 2020-09-03 Page loading time detection method, equipment, storage medium and device

Country Status (1)

Country Link
CN (1) CN112052150A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115484492A (en) * 2022-11-11 2022-12-16 荣耀终端有限公司 Interface time delay obtaining method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115484492A (en) * 2022-11-11 2022-12-16 荣耀终端有限公司 Interface time delay obtaining method and device

Similar Documents

Publication Publication Date Title
CN112615873B (en) Internet of things equipment safety detection method, equipment, storage medium and device
CN112507087B (en) Terminal equipment identification method, equipment, storage medium and device
CN112580047A (en) Industrial malicious code marking method, equipment, storage medium and device
CN112381092A (en) Tracking method, device and computer readable storage medium
CN112052150A (en) Page loading time detection method, equipment, storage medium and device
CN110991357A (en) Answer matching method and device and electronic equipment
CN113312261A (en) Test case screening method, test case screening equipment, storage medium and device
CN112446850B (en) Adaptation test method and device and electronic equipment
JP4102365B2 (en) Data linkage support method between applications
CN109788001B (en) Suspicious internet protocol address discovery method, user equipment, storage medium and device
CN112417449B (en) Abnormal behavior detection method, device, storage medium and apparatus
CN114463242A (en) Image detection method, device, storage medium and device
CN114742741A (en) Video picture quality evaluation method, device, equipment and storage medium
CN113269276A (en) Image recognition method, device, equipment and storage medium
CN115618350A (en) Industrial control asset vulnerability detection method, equipment, storage medium and device
CN111125567A (en) Equipment marking method and device, electronic equipment and storage medium
CN111338946A (en) Android simulator detection method and device
CN111552634A (en) Method and device for testing front-end system and storage medium
CN112905191B (en) Data processing method, device, computer readable storage medium and computer equipment
CN112559085B (en) Plug-in loading method, equipment, storage medium and device of Internet of things equipment
CN112434293B (en) File feature extraction method, device, storage medium and apparatus
CN114448848B (en) Switch testing method and device, electronic equipment and storage medium
CN114463243A (en) Image detection method, device, storage medium and device
CN110969093B (en) Block chain-based community security video evidence obtaining method, device, equipment and medium
CN114387279A (en) Face region selection method, face region selection equipment, storage medium and device

Legal Events

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