CN110825456A - Loading time calculation method and device, computer equipment and storage medium - Google Patents

Loading time calculation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110825456A
CN110825456A CN201911060726.3A CN201911060726A CN110825456A CN 110825456 A CN110825456 A CN 110825456A CN 201911060726 A CN201911060726 A CN 201911060726A CN 110825456 A CN110825456 A CN 110825456A
Authority
CN
China
Prior art keywords
loading
time
page
screenshot
page images
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
CN201911060726.3A
Other languages
Chinese (zh)
Other versions
CN110825456B (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.)
Beijing Bo Hongyuan Data Polytron Technologies Inc
Original Assignee
Beijing Bo Hongyuan Data Polytron Technologies Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Bo Hongyuan Data Polytron Technologies Inc filed Critical Beijing Bo Hongyuan Data Polytron Technologies Inc
Priority to CN201911060726.3A priority Critical patent/CN110825456B/en
Publication of CN110825456A publication Critical patent/CN110825456A/en
Application granted granted Critical
Publication of CN110825456B publication Critical patent/CN110825456B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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)
  • Debugging And Monitoring (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses a method and a device for calculating loading time, computer equipment and a storage medium. The method comprises the following steps: in the page loading process, acquiring the loading starting time of a preset module; from the loading starting moment, respectively carrying out screenshot on the page at different moments, and respectively comparing two page images adjacent in time; determining target page images meeting the change stability condition according to the comparison result, and determining the loading ending time according to the screenshot time corresponding to each target page image; and calculating the loading duration of the page according to the loading starting time and the loading ending time. The embodiment of the invention can accurately calculate the loading time, thereby accurately evaluating the performance of the application program.

Description

Loading time calculation method and device, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of computer networks, in particular to a method and a device for calculating loading time, computer equipment and a storage medium.
Background
With the development and popularization of application programs, the requirements of users on the application program performance are higher and higher. The performance of an application can now be evaluated by monitoring the duration of different operations performed by the application software.
In the process of developing the application program, technicians usually count the starting time of the application program so as to realize the test of the application program, optimize the application program based on the test result and improve the user experience. The application start-up time is usually short, but a long time is required from the time the user opens the application to the time the program can be used normally. The existing performance evaluation only takes the starting time length as a judgment basis.
The performance evaluation mode omits the intuitive loading time of the user in the use process, has a single evaluation result, and only counts the loading time of the network or the page loading time. In addition, after the page loading is completed, a page drawing process is also performed, and the asynchronous loading condition is also considered, that is, after the page loading is completed, the page requests resources to further improve the page content and the like.
Disclosure of Invention
The embodiment of the invention provides a method and a device for calculating loading time, computer equipment and a storage medium, which can accurately calculate the loading time so as to accurately evaluate the performance of an application program.
In a first aspect, an embodiment of the present invention provides a load time calculation method, including:
in the page loading process, acquiring the loading starting time of a preset module;
from the loading starting moment, respectively carrying out screenshot on the page at different moments, and respectively comparing two page images adjacent in time;
determining target page images meeting the change stability condition according to the comparison result, and determining the loading ending time according to the screenshot time corresponding to each target page image;
and calculating the loading duration of the page according to the loading starting time and the loading ending time.
In a second aspect, an embodiment of the present invention further provides a load time calculation apparatus, including:
the loading starting time acquisition module is used for acquiring the loading starting time of the preset module in the page loading process;
the screenshot comparison module is used for respectively screenshot the page at different moments from the loading starting moment and respectively comparing two page images adjacent in time;
the loading ending moment determining module is used for determining the target page images meeting the change stability condition according to the comparison result and determining the loading ending moment according to the screenshot moment corresponding to each target page image;
and the loading duration calculation module is used for calculating the loading duration of the page according to the loading starting time and the loading ending time.
In a third aspect, an embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the load time calculation method according to any one of the embodiments of the present invention when executing the computer program.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the load time calculation method according to any one of the embodiments of the present invention.
According to the embodiment of the invention, the page images at different loading moments are obtained by respectively capturing the pages at different moments in the loading process, every two page images adjacent in time are compared, the two page images adjacent in time and less in change are taken as the target page images, the loading ending moment is determined according to the capturing moment of the target page images, and the moment when the display page of the application program does not change any more is taken as the loading ending moment, so that the problems that only the starting time of the application program is counted as the performance judgment standard and the performance evaluation reliability is poor due to inaccurate loading time point in the prior art are solved, the stable and unchangeable moment of the display page in the display screen is taken as the loading ending moment, the duration of the application program can be accurately determined, and the accurate evaluation of the performance of the application program is realized.
Drawings
FIG. 1 is a flowchart of a load time calculation method according to a first embodiment of the present invention;
FIG. 2a is a flowchart of a method for calculating load time according to a second embodiment of the present invention;
FIG. 2b is a flowchart of an application home page loading process according to a second embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a load time calculation apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device in the fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic diagram of a flowchart of a method for calculating loading time in an embodiment of the present invention, where the embodiment is applicable to a case where a first page loading time of an application program is calculated after the application program is started and starts to run, and the method may be executed by a loading time calculating apparatus provided in an embodiment of the present invention, where the apparatus may be implemented in a software and/or hardware manner, and may be generally integrated into a computer device, for example, a terminal device, and more specifically, a client of a mobile terminal. As shown in fig. 1, the method of this embodiment specifically includes:
s110, in the page loading process, the loading starting time of the preset module is obtained.
A page may refer to a page of an application. The preset module is configured to determine a starting time of page loading, where the starting time may be a first loaded functional program in a page loading process, and may be, for example, a so file or a jar file.
Optionally, the preset module includes a code packet injected by using a Hook technology. The code packet injected by the Hook technology refers to a remote thread insertion (injection) technology, and refers to a method for creating a remote thread in another process to enter a memory address space of a target process. By injecting the code package, the application can set up corresponding subroutines to monitor the application's message passing and processing before the messages reach the target window program. The code packet injected by the Hook technology reduces the difficulty and the implementation cost of monitoring the loading of the preset module and accurately determines the loading starting moment.
And the loading starting time is used as a starting point of the loading time length so as to calculate the loading time length.
Typically, an application needs to load at least one page during its execution. The loading time of the page is counted to evaluate the performance of the application program, for example, the loading time is long, which indicates that the performance of the application program is poor; the loading time is long, which indicates that the performance of the application program is good.
Optionally, the page comprises an application home page. The first page refers to the first page displayed after the application program is started.
In fact, after the application home page is loaded, the user can control the application through interactive operation. Therefore, the top page loading duration specifically refers to a duration from when the user sends the start instruction to when all resources on the top page are loaded, that is, a duration when the user actually starts to use the application program, and may be used to evaluate the running speed of the application program to evaluate the performance of the application program.
Specifically, the loading process of the application program comprises an advertisement starting and loading stage, a local resource loading stage, a page skipping stage, a network resource loading stage, a page drawing stage and the like.
The performance of the application program can be determined by calculating the loading duration of the application program, so that technicians can reduce the time for completely loading the home page and optimize the application program from the perspective of users by reducing the advertisement duration, adopting at least one of the modes of loading local resources in an asynchronous mode, caching home page data, reducing the complexity of the home page data and the like.
And S120, from the loading starting moment, respectively carrying out screenshot on the page at different moments, and respectively comparing two page images adjacent in time.
The screenshot is used for acquiring an image of the display content of the current page. And respectively carrying out screenshot on the page at different moments to obtain page images at different moments. The page screenshot may refer to screenshot of an area in a page, or may refer to screenshot of the entire page, which is specifically set according to needs, and thus, embodiments of the present invention are not limited specifically. The area in the page may be configured in advance, and may be, for example, a static area, where the static area refers to an area in the page where content is almost fixed, for example, a page element in a native page, such as a control or a background area. The resources acquired and displayed from the server may change in real time according to the content provided by the server, so that the region to which the resources belong is not a static region, and the resources may refer to multimedia resources such as text, images, audio, video and the like. The region in the page may also be a region other than a dynamically changing image, which refers to an image that automatically cycles through to an image, such as a gif format image.
Optionally, the screenshot performed on the page includes: and screenshot is carried out on a stable region in the page, wherein the change frequency of the display content in the stable region meets the low-frequency condition.
The stable region may refer to a region in the page where an automatic change frequency is low, where the automatic change frequency refers to a frequency at which the region changes without an operation instruction input by the user. The stable area is used for judging whether the page is loaded completely. The variation frequency is used. The low-frequency condition is used for judging whether the display content in the stable area is stable and unchanged. Illustratively, the low frequency condition may include a format of an image, and accordingly, if the format of the image corresponding to the presentation content is not gif, it is determined that the presentation content satisfies the low frequency condition. The low frequency condition may also be a frequency threshold, and accordingly, if the variation frequency of the presentation content is lower than the set threshold, it is determined that the presentation content satisfies the low frequency condition.
The moment when the network resource is loaded in the page can be accurately determined by capturing the stable area as the page image, so that the loading time of the network resource is used as the part of the loading time, and the loading time taking the normal use of the application program as the ending moment is accurately calculated.
In addition, screenshot is carried out on the static area, and the loading ending time is determined, so that the determined loading duration is actually the duration from the time when the application program is started to the time when the local resource loading is completed on the page. Therefore, the user can determine different types of loading duration by capturing the images of different areas of the page according to the needs. In this regard, the embodiments of the present invention are not particularly limited.
The screenshot is performed on the page at different moments, which may be performed on the page according to a preset period.
Two time-adjacent page images mean that the two page images are adjacent in time, that is, other intercepted page images do not exist between the screenshot moments of the two page images.
Two time-adjacent page images are compared, and whether the two page images are similar or not is actually compared. And comparing the two time-adjacent page images to judge whether the two time-adjacent page images are similar, namely judging whether the page changes at the corresponding two screenshot moments so as to judge whether the page is loaded completely. If the two time-adjacent page images are the same or similar, namely the page does not change in the corresponding two screenshot moments, determining that the page is completely loaded; and if the two time-adjacent page images are different, namely the page is changed in the corresponding two screenshot moments, determining that the page is not loaded completely.
S130, determining target page images meeting the change stability condition according to the comparison result, and determining the loading ending time according to the screenshot time corresponding to each target page image.
The comparison result is used to determine whether two temporally adjacent page images are similar. The change stabilization condition is used to determine whether the two target page images are the same or similar. When the two page images are the same or similar, both of the two page images are the target page image. Illustratively, if it is determined that the comparison results are the same result, it is determined that two time-adjacent page images are the target page images satisfying the variation stabilization condition.
The screenshot time corresponding to the target page image may refer to the time when the target page image is captured, and the time may refer to absolute system time or a relative loading start time.
The earliest screenshot time in the timeline can be taken as the loading end time.
Optionally, the determining, according to the comparison result, target page images that satisfy a change stability condition, and determining, according to a screenshot time corresponding to each of the target page images, a loading end time includes: taking the page images of two adjacent times with the same comparison result as target page images meeting the change stability condition; acquiring screenshot time corresponding to each target page image; and taking the screenshot time closest to the loading starting time as the loading ending time.
And the screenshot time closest to the loading starting time is used for determining the earliest time when the page is stable and unchangeable. The screenshot time closest to the loading start time means that the time length between the screenshot time and the loading start time is shortest, that is, the screenshot time is the earliest compared with other screenshot times in the time axis.
The screenshot time closest to the loading starting time is used as the loading ending time, so that the loading ending time is closest to the actual loading finishing time, and the loading ending time is accurately determined.
It should be noted that, when two temporally adjacent page images are compared, when the same result appears in the comparison result for the first time, the subsequent comparison of the two temporally adjacent page images may be stopped. That is, two temporally adjacent page images are respectively compared, including: and respectively comparing two page images adjacent to each other in time according to the time sequence until two page images with the same result appear for the first time. Therefore, the workload in the comparison process can be saved, the calculation efficiency at the moment of finishing the loading is improved, and the calculation efficiency of the loading duration is improved.
And S140, calculating the loading duration of the page according to the loading starting time and the loading ending time.
And the time difference between the loading starting time and the loading ending time is the loading duration of the page.
According to the embodiment of the invention, the page images at different loading moments are obtained by respectively capturing the pages at different moments in the loading process, every two page images adjacent in time are compared, the two page images adjacent in time and less in change are taken as the target page images, the loading ending moment is determined according to the capturing moment of the target page images, and the moment when the display page of the application program does not change any more is taken as the loading ending moment, so that the problems that only the starting time of the application program is counted as the performance judgment standard and the performance evaluation reliability is poor due to inaccurate loading time point in the prior art are solved, the stable and unchangeable moment of the display page in the display screen is taken as the loading ending moment, the duration of the application program can be accurately determined, and the accurate evaluation of the performance of the application program is realized.
Example two
Fig. 2a is a flowchart of a method for calculating loading time according to a second embodiment of the present invention, which is embodied on the basis of the above embodiments, and the comparing of two page images that are adjacent to each other in time is embodied as follows: after the page loading is finished, respectively calculating the similarity between two time-adjacent page images from the at least two intercepted page images; and if the similarity between two target page images adjacent in time exceeds a preset similarity threshold, determining that the comparison result of the two target page images is the same result.
The method of the embodiment specifically includes:
s210, in the page loading process, the loading starting time of the preset module is obtained.
In the embodiment of the present invention, the preset module, the loading start time, the screenshot, the page image, the change stability condition, the target page image, the screenshot time, the loading end time, and the loading duration may refer to the description of the above embodiment.
Optionally, the preset module includes a code packet injected by using a Hook technology.
Illustratively, the code packet is a jar packet, and correspondingly, the loading time is the time when the jar packet is loaded by the ClassLoader of the application program.
Optionally, the page includes an application home page.
And S220, respectively carrying out screenshot on the page at different moments from the loading starting moment.
Optionally, the screenshot performed on the page includes: and screenshot is carried out on a stable region in the page, wherein the change frequency of the display content in the stable region meets the low-frequency condition.
S230, after the page loading is finished, respectively calculating the similarity between two time-adjacent page images from the at least two intercepted page images.
The similarity is used to evaluate the degree of similarity of two page images.
S240, if the similarity between two target page images adjacent in time exceeds a preset similarity threshold, determining that the comparison result of the two target page images is the same result.
The similarity threshold is used for judging whether the two page images are the same or not. In general, if the similarity exceeds a similarity threshold, it is determined that the two page images are identical.
Optionally, the similarity threshold may be updated by a server or a user instruction.
The similarity threshold may be configured in real time, for example, by issuing data to the server for updating, or by directly updating input data received by a user instruction. By updating the similarity threshold, the configuration flexibility of the similarity threshold can be improved, and the method is compatible with a plurality of application scenes.
And S250, determining target page images meeting the change stability condition according to the comparison result, and determining the loading ending time according to the screenshot time corresponding to each target page image.
Optionally, the determining, according to the comparison result, target page images that satisfy a change stability condition, and determining, according to a screenshot time corresponding to each of the target page images, a loading end time includes: taking the page images of two adjacent times with the same comparison result as target page images meeting the change stability condition; acquiring screenshot time corresponding to each target page image; and taking the screenshot time closest to the loading starting time as the loading ending time.
And S260, calculating the loading duration of the page according to the loading starting time and the loading ending time.
The loading time of the page in the embodiment of the invention is actually the time from the moment the application program starts to load the preset module to the moment the page information is drawn. Specifically, as shown in fig. 2b, the process of loading the home page of the application program specifically includes:
s271, an application start instruction is received.
The launch instruction may refer to an instruction input by a user that triggers launching of an application. For example, the start instruction may be a click operation of an icon of the application program by the user through a touch screen of the mobile terminal.
S272, starting a Zygote process, loading so files and Hook-injected jar packages.
Specifically, the zygate process is also called a fertilized egg process and is started by an app _ process, the most significant of the zygate process is that the zygate process is used as a Server end of a Socket and receives a process creation request from all directions, the creation of all application processes in the Android requests a System Server process through a Binder, and the System Server process sends a Socket message to the zygate process and is created by the zygate process uniformly.
S273, create Application and Splash Activity.
When the Application is started for the first time, the Application process enters the Splash Activity (start page) and jumps to the Main interface (such as the Main Activity) of the Application program after a short time (such as 1-2 seconds). Typically, an advertisement or picture will be shown in Splash Activity.
S274, loading the resource and initializing the library.
And acquiring the local resource of the Splash Activity and the local resource of the Main Activity, and loading and initializing.
And S275, requesting and playing the starting advertisement.
And acquiring the starting advertisement to be displayed in the Splash Activity, and playing.
S276, initiating the Main Activity.
The Main Activity is the Main interface of the application program.
And S277, drawing the information of the application program home page through the Main Activity.
And drawing the home page information in the main interface of the application program.
And S278, finishing the drawing of the home page information of the application program.
After the home page information is drawn, the user can control the application program to execute corresponding functions through interactive operation.
Wherein S272 may be a loading start time and S278 may be a loading end time. In order to avoid the interference of the top page loading on the application program, the loading time calculation method provided in the embodiment of the present invention generally performs only the screenshot operation in the top page loading process of the application program, and performs the page image comparison operation, the loading time calculation operation, and the like after S278, that is, after the top page information is completely drawn.
According to the embodiment of the invention, the page images under different loading moments in page loading are obtained, every two adjacent page images are compared, the two adjacent and similar page images are taken as the target page image, the loading ending moment is determined according to the screenshot moment of the target page image, and the moment when the display page of the application program does not change is taken as the loading ending moment, so that the time from the starting of the application program to the instant use can be accurately determined, including a local resource loading stage, a network resource loading stage and a page drawing stage, and therefore, the local resource loading performance, the network resource loading performance, the page drawing performance and the like of the application program are evaluated, the comprehensive and complete accurate evaluation of the application program performance is realized, and the reliability and the accuracy of the evaluation of the application program performance are improved.
EXAMPLE III
Fig. 3 is a schematic diagram of a load time calculation apparatus according to a third embodiment of the present invention. The third embodiment is a corresponding device for implementing the method for calculating loading time provided by the foregoing embodiments of the present invention, and the device may be implemented in a software and/or hardware manner, and may be generally integrated into a computer device, for example, a terminal device, specifically, a mobile phone, a tablet computer, or a vehicle-mounted device.
Accordingly, the apparatus of the present embodiment may include:
a loading start time obtaining module 310, configured to obtain a loading start time of a preset module in a page loading process;
a screenshot comparing module 320, configured to capture a screenshot of each page at different times from the loading start time, and compare two temporally adjacent page images;
a loading end time determining module 330, configured to determine, according to the comparison result, target page images that meet the change stability condition, and determine, according to a screenshot time corresponding to each of the target page images, a loading end time;
and a loading duration calculation module 340, configured to calculate a loading duration of the page according to the loading start time and the loading end time.
According to the embodiment of the invention, the page images at different loading moments are obtained by respectively capturing the pages at different moments in the loading process, every two page images adjacent in time are compared, the two page images adjacent in time and less in change are taken as the target page images, the loading ending moment is determined according to the capturing moment of the target page images, and the moment when the display page of the application program does not change any more is taken as the loading ending moment, so that the problems that only the starting time of the application program is counted as the performance judgment standard and the performance evaluation reliability is poor due to inaccurate loading time point in the prior art are solved, the stable and unchangeable moment of the display page in the display screen is taken as the loading ending moment, the duration of the application program can be accurately determined, and the accurate evaluation of the performance of the application program is realized.
Further, the loading end time determining module 330 includes: the target page image determining unit is used for taking the page images of two adjacent times with the same comparison result as the target page images meeting the change stability condition; acquiring screenshot time corresponding to each target page image; and taking the screenshot time closest to the loading starting time as the loading ending time.
Further, the screenshot comparison module 320 includes: and the area screenshot unit is used for screenshot on a stable area in the page, wherein the change frequency of the display content in the stable area meets the low-frequency condition.
Further, the screenshot comparison module 320 includes: the image similarity calculation unit is used for calculating the similarity between two time-adjacent page images from the at least two intercepted page images after the page loading is finished; and if the similarity between two target page images adjacent in time exceeds a preset similarity threshold, determining that the comparison result of the two target page images is the same result.
Further, the similarity threshold may be updated by a server or a user instruction.
Further, the preset module comprises a code packet injected by adopting a Hook technology.
Further, the page includes an application home page.
The loading time calculation device can execute the loading time calculation method provided by the embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executed loading time calculation method.
Example four
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention. The computer device 12 shown in FIG. 4 is only one example and should not bring any limitations to the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 4, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16. The computer device 12 may be a device that is attached to a bus.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. Computer device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk Read-Only Memory (CD-ROM), Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with computer device 12, and/or with any devices (e.g., network card, modem, etc.) that enable computer device 12 to communicate with one or more other computing devices. Such communication may be through an Input/Output (I/O) interface 22. Also, computer device 12 may communicate with one or more networks (e.g., Local Area Network (LAN), Wide Area Network (WAN)) via Network adapter 20. As shown, Network adapter 20 communicates with other modules of computer device 12 via bus 18. it should be understood that although not shown in FIG. 4, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, Redundant processing units, external disk drive Arrays, (Redundant Arrays of Inesponsive Disks, RAID) systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by executing programs stored in the system memory 28, for example, implementing a load time calculation method provided by any of the embodiments of the present invention.
EXAMPLE five
Fifth, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for calculating a loading time according to any of the embodiments of the present invention:
that is, the program when executed by the processor implements: in the page loading process, acquiring the loading starting time of a preset module; from the loading starting moment, respectively carrying out screenshot on the page at different moments, and respectively comparing two page images adjacent in time; determining target page images meeting the change stability condition according to the comparison result, and determining the loading ending time according to the screenshot time corresponding to each target page image; and calculating the loading duration of the page according to the loading starting time and the loading ending time.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. 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 (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a RAM, a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, 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.
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 any of a variety of 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, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a LAN or a WAN, or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A load time calculation method, comprising:
in the page loading process, acquiring the loading starting time of a preset module;
from the loading starting moment, respectively carrying out screenshot on the page at different moments, and respectively comparing two page images adjacent in time;
determining target page images meeting the change stability condition according to the comparison result, and determining the loading ending time according to the screenshot time corresponding to each target page image;
and calculating the loading duration of the page according to the loading starting time and the loading ending time.
2. The method of claim 1, wherein the determining target page images satisfying a change stabilization condition according to the comparison result, and determining a loading end time according to a screenshot time corresponding to each target page image, comprises:
taking the page images of two adjacent times with the same comparison result as target page images meeting the change stability condition;
acquiring screenshot time corresponding to each target page image;
and taking the screenshot time closest to the loading starting time as the loading ending time.
3. The method of claim 1, wherein the screenshot of the page comprises:
and screenshot is carried out on a stable region in the page, wherein the change frequency of the display content in the stable region meets the low-frequency condition.
4. The method of claim 1, wherein comparing two temporally adjacent page images, respectively, comprises:
after the page loading is finished, respectively calculating the similarity between two time-adjacent page images from the at least two intercepted page images;
and if the similarity between two target page images adjacent in time exceeds a preset similarity threshold, determining that the comparison result of the two target page images is the same result.
5. The method of claim 4, wherein the similarity threshold can be updated by a server or a user instruction.
6. The method of claim 1, wherein the predetermined module comprises a code packet injected using Hook technology.
7. The method of claim 1, wherein the page comprises an application home page.
8. A load time calculation apparatus, comprising:
the loading starting time acquisition module is used for acquiring the loading starting time of the preset module in the page loading process;
the screenshot comparison module is used for respectively screenshot the page at different moments from the loading starting moment and respectively comparing two page images adjacent in time;
the loading ending moment determining module is used for determining the target page images meeting the change stability condition according to the comparison result and determining the loading ending moment according to the screenshot moment corresponding to each target page image;
and the loading duration calculation module is used for calculating the loading duration of the page according to the loading starting time and the loading ending time.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the load time calculation method according to any one of claims 1-7 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the load time calculation method according to any one of claims 1 to 7.
CN201911060726.3A 2019-11-01 2019-11-01 Loading time calculation method, loading time calculation device, computer equipment and storage medium Active CN110825456B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911060726.3A CN110825456B (en) 2019-11-01 2019-11-01 Loading time calculation method, loading time calculation device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911060726.3A CN110825456B (en) 2019-11-01 2019-11-01 Loading time calculation method, loading time calculation device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110825456A true CN110825456A (en) 2020-02-21
CN110825456B CN110825456B (en) 2024-01-23

Family

ID=69552006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911060726.3A Active CN110825456B (en) 2019-11-01 2019-11-01 Loading time calculation method, loading time calculation device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110825456B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538658A (en) * 2020-04-20 2020-08-14 卓望数码技术(深圳)有限公司 Automatic testing method for interface loading duration
CN111581558A (en) * 2020-04-27 2020-08-25 北京达佳互联信息技术有限公司 Method, device and equipment for determining page loading duration and storage medium
CN112203150A (en) * 2020-09-30 2021-01-08 腾讯科技(深圳)有限公司 Time-consuming acquisition method, device, equipment and computer-readable storage medium
CN112905449A (en) * 2021-01-27 2021-06-04 长沙市到家悠享网络科技有限公司 Target test method, device, equipment and storage medium
CN113238958A (en) * 2021-06-01 2021-08-10 广东好太太智能家居有限公司 Automatic testing method and device for big data visualization platform and electronic equipment
CN113703872A (en) * 2021-09-01 2021-11-26 北京云蝶智学科技有限公司 Method and device for acquiring page loading time
CN113760631A (en) * 2020-07-06 2021-12-07 北京沃东天骏信息技术有限公司 Page loading duration determination method, device, equipment and storage medium
CN113778825A (en) * 2021-08-24 2021-12-10 北京达佳互联信息技术有限公司 Method and device for determining page index parameters, storage medium and electronic equipment
CN114896013A (en) * 2022-05-12 2022-08-12 北京达佳互联信息技术有限公司 Page loading duration determining method and device, electronic equipment and storage medium
CN114896013B (en) * 2022-05-12 2024-07-02 北京达佳互联信息技术有限公司 Page loading time length determining method and device, electronic equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761467A (en) * 2011-04-25 2012-10-31 腾讯科技(深圳)有限公司 Method, device and system for calculating webpage download time of browser
US20170046254A1 (en) * 2015-08-13 2017-02-16 Spirent Communications, Inc. Method to configure monitoring thresholds using output of load or resource loadings
CN107562610A (en) * 2017-09-21 2018-01-09 上海谦问万答吧云计算科技有限公司 Obtain method, apparatus, terminal and the medium of page load time
CN108228463A (en) * 2018-01-10 2018-06-29 百度在线网络技术(北京)有限公司 For detecting the method and apparatus of initial screen time
CN109299000A (en) * 2018-08-22 2019-02-01 中国平安人寿保险股份有限公司 A kind of webpage response test method, computer readable storage medium and terminal device
CN109446095A (en) * 2018-11-07 2019-03-08 北京奇艺世纪科技有限公司 A kind of test method, device and the electronic equipment of page presentation speed
US20190304214A1 (en) * 2013-03-15 2019-10-03 Predictive Fleet Technologies, Inc. Engine analysis and diagnostic system
CN110333903A (en) * 2018-03-28 2019-10-15 优酷网络技术(北京)有限公司 The determination method and device of page load duration

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102761467A (en) * 2011-04-25 2012-10-31 腾讯科技(深圳)有限公司 Method, device and system for calculating webpage download time of browser
US20190304214A1 (en) * 2013-03-15 2019-10-03 Predictive Fleet Technologies, Inc. Engine analysis and diagnostic system
US20170046254A1 (en) * 2015-08-13 2017-02-16 Spirent Communications, Inc. Method to configure monitoring thresholds using output of load or resource loadings
CN107562610A (en) * 2017-09-21 2018-01-09 上海谦问万答吧云计算科技有限公司 Obtain method, apparatus, terminal and the medium of page load time
CN108228463A (en) * 2018-01-10 2018-06-29 百度在线网络技术(北京)有限公司 For detecting the method and apparatus of initial screen time
CN110333903A (en) * 2018-03-28 2019-10-15 优酷网络技术(北京)有限公司 The determination method and device of page load duration
CN109299000A (en) * 2018-08-22 2019-02-01 中国平安人寿保险股份有限公司 A kind of webpage response test method, computer readable storage medium and terminal device
CN109446095A (en) * 2018-11-07 2019-03-08 北京奇艺世纪科技有限公司 A kind of test method, device and the electronic equipment of page presentation speed

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
MURAT BIRINCI, SERKAN KIRANYAZ: "A perceptual scheme for fully automatic video shot boundary detection", 《SIGNAL PROCESSING: IMAGE COMMUNICATION》, vol. 29, no. 3, pages 410 - 423, XP028627512, DOI: 10.1016/j.image.2013.12.003 *
吴清扬 等: "基于完全渲染的网页首屏性能测量设计", 《电子制作》, no. 16, pages 42 - 44 *
王皘: "面向Web加速的HTTP协议优化机制的研究与设计", 《 CNKI优秀硕士学位论文全文库》, no. 04, pages 139 - 296 *
马征: "浅析资讯类App发展现状及央视新闻移动网客户端使用分析", 《现代电视技术》, no. 06, pages 103 - 106 *
马雪琴 等: "基于韦伯-费希纳定律的网页访问质量评价方法", 《计算机与数字工程》, vol. 44, no. 01, pages 68 - 72 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538658A (en) * 2020-04-20 2020-08-14 卓望数码技术(深圳)有限公司 Automatic testing method for interface loading duration
CN111581558A (en) * 2020-04-27 2020-08-25 北京达佳互联信息技术有限公司 Method, device and equipment for determining page loading duration and storage medium
CN111581558B (en) * 2020-04-27 2024-03-05 北京达佳互联信息技术有限公司 Page loading time length determining method, device, equipment and storage medium
CN113760631A (en) * 2020-07-06 2021-12-07 北京沃东天骏信息技术有限公司 Page loading duration determination method, device, equipment and storage medium
CN112203150A (en) * 2020-09-30 2021-01-08 腾讯科技(深圳)有限公司 Time-consuming acquisition method, device, equipment and computer-readable storage medium
CN112905449A (en) * 2021-01-27 2021-06-04 长沙市到家悠享网络科技有限公司 Target test method, device, equipment and storage medium
CN112905449B (en) * 2021-01-27 2024-04-23 长沙市到家悠享网络科技有限公司 Target test method, device, equipment and storage medium
CN113238958A (en) * 2021-06-01 2021-08-10 广东好太太智能家居有限公司 Automatic testing method and device for big data visualization platform and electronic equipment
CN113778825A (en) * 2021-08-24 2021-12-10 北京达佳互联信息技术有限公司 Method and device for determining page index parameters, storage medium and electronic equipment
CN113703872A (en) * 2021-09-01 2021-11-26 北京云蝶智学科技有限公司 Method and device for acquiring page loading time
CN114896013A (en) * 2022-05-12 2022-08-12 北京达佳互联信息技术有限公司 Page loading duration determining method and device, electronic equipment and storage medium
CN114896013B (en) * 2022-05-12 2024-07-02 北京达佳互联信息技术有限公司 Page loading time length determining method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110825456B (en) 2024-01-23

Similar Documents

Publication Publication Date Title
CN110825456B (en) Loading time calculation method, loading time calculation device, computer equipment and storage medium
CN109240576B (en) Image processing method and device in game, electronic device and storage medium
CN109213611B (en) Cross-process communication method, device, terminal and storage medium
CN106888236B (en) Session management method and session management device
CN109684573B (en) Target picture display method and device, storage medium and electronic equipment
CN109117153B (en) Application processing method, device, terminal and storage medium
CN112040312A (en) Split-screen rendering method, device, equipment and storage medium
US9210203B2 (en) Resource based mobile device application streaming
CN113784049A (en) Camera calling method of android system virtual machine, electronic device and storage medium
CN113780163A (en) Page loading time detection method and device, electronic equipment and medium
CN109492163B (en) List display recording method and device, terminal equipment and storage medium
CN110769316A (en) Method, device, equipment and storage medium for calculating first frame time
CN112291602B (en) Video playing method, electronic equipment and storage medium
US11442606B2 (en) User interface interaction method and system
CN111367783A (en) Application program testing method and device and electronic equipment
CN115373998A (en) Application program optimization method, device, equipment and medium
CN115225950A (en) Video playing control method and device
CN116627521A (en) Service module preloading method, skipping method, device and storage medium
CN114490265A (en) Data acquisition method, device, equipment and storage medium
CN110262856B (en) Application program data acquisition method, device, terminal and storage medium
CN111124795B (en) Application starting monitoring method, device and equipment
CN111258877B (en) Method and device for detecting visible time of first screen page and electronic equipment
CN112367295A (en) Plug-in display method and device, storage medium and electronic equipment
CN112843736A (en) Method and device for shooting image, electronic equipment and storage medium
CN107741992B (en) Network storage method and device for conference records, intelligent tablet and storage medium

Legal Events

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