[go: up one dir, main page]

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

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

Info

Publication number
CN110825456B
CN110825456B CN201911060726.3A CN201911060726A CN110825456B CN 110825456 B CN110825456 B CN 110825456B CN 201911060726 A CN201911060726 A CN 201911060726A CN 110825456 B CN110825456 B CN 110825456B
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.)
Active
Application number
CN201911060726.3A
Other languages
Chinese (zh)
Other versions
CN110825456A (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

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

Abstract

The embodiment of the invention discloses a loading time calculation method, a loading time calculation device, computer equipment and a storage medium. The method comprises the following steps: acquiring a loading starting moment of a preset module in the page loading process; from the loading starting moment, respectively screenshot pages at different moments, and respectively comparing two adjacent page images; determining target page images meeting the change stability conditions according to the comparison result, and determining loading end time according to screenshot time corresponding to each target page image; and calculating the loading time 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, loading time calculation device, computer equipment and storage medium
Technical Field
Embodiments of the present invention relate to the field of computer networks, and in particular, to a method and apparatus for calculating loading time, a computer device, and a storage medium.
Background
With the development and popularization of application programs, the requirements of users on the performance of the application programs are higher and higher. The performance of an application can be evaluated by monitoring the duration of different operations performed by the application.
In the process of application development, technicians usually count the starting time of the application so as to test the application, optimize the application based on test results and improve user experience. Typically, the application program is started for a short time, but a long time is required from when the user opens the application program to when the program can be used normally. The existing performance evaluation only takes the starting time as a judging basis.
The performance evaluation mode omits the intuitive loading time of the user in the using process, and the evaluation result is single, and only the loading time of the network or the page loading time is counted. In addition, after the page loading is completed, the page drawing process also needs to consider the asynchronous loading condition, namely, after the page loading is completed, the page requests the resource to further perfect the page content and the like.
Disclosure of Invention
The embodiment of the invention provides a loading time calculating method, a loading time calculating device, computer equipment and a storage medium, which can accurately calculate 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:
acquiring a loading starting moment of a preset module in the page loading process;
from the loading starting moment, respectively screenshot pages at different moments, and respectively comparing two adjacent page images;
determining target page images meeting the change stability conditions according to the comparison result, and determining loading end time according to screenshot time corresponding to each target page image;
and calculating the loading time 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 moment acquisition module is used for acquiring the loading starting moment of the preset module in the page loading process;
the screenshot comparison module is used for respectively screenshot pages at different moments from the loading starting moment and comparing two time-adjacent page images;
the loading end time determining module is used for determining target page images meeting the change stability conditions according to the comparison result, and determining loading end time according to screenshot time corresponding to each target page image;
the loading time length calculation module is used for calculating the loading time length 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 capable of running on the processor, where the processor executes the program to implement a load time calculation method according to any one of the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention further provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a load time calculation method according to any of the embodiments of the present invention.
According to the embodiment of the invention, the pages are respectively subjected to screenshot according to different moments in the loading process to obtain the page images under different loading moments, every two page images adjacent in time are compared, the two page images adjacent in time and small in change are taken as target page images, the loading ending moment is determined according to the screenshot moment of the target page images, the moment that the display page of the application program is not changed is taken as the loading ending moment, the problem that in the prior art, only the starting time of the application program is counted as a performance judging standard, the performance evaluation reliability is poor due to inaccuracy of the loading time point is solved, the stable and unchangeable moment of the display page in the display screen is taken as the loading ending moment, and the duration of the application program can be accurately determined, so that the performance of the application program is accurately evaluated.
Drawings
FIG. 1 is a flow chart of a load time calculation method according to a first embodiment of the invention;
FIG. 2a is a flowchart of a load time calculation method according to a second embodiment of the present invention;
FIG. 2b is a flowchart illustrating an application front page loading process according to a second embodiment of the present invention;
FIG. 3 is a schematic diagram of a loading time calculating device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device in a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a schematic diagram of a flowchart of a loading time calculating method in a first embodiment of the present invention, where the method may be applied to a case of calculating a home page loading time of an application program after the application program is started and starts to run, and the method may be performed by a loading time calculating device provided in the embodiment of the present invention, where 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, and more specifically, a client of a mobile terminal. As shown in fig. 1, the method in this embodiment specifically includes:
s110, acquiring loading starting time of a preset module in the page loading process.
A page may refer to a page of an application. The preset module is used for determining the starting time of page loading, and may refer to a first loaded functional program in the page loading process, and may refer to a so file or a jar file, for example.
Optionally, the preset module includes a code packet injected by adopting a Hook technology. Code packets injected using Hook technology refer to remote thread insertion (injection) techniques, which refer to entering the memory address space of a target process by creating a remote thread in another process. By injecting the code packages, the application can set up the corresponding subroutines to monitor the messaging of the application and process the messages before they reach the target window program. The code package injected by the Hook technology reduces the difficulty and the realization cost of monitoring the loading of the preset module, and accurately determines the loading starting moment.
The loading starting time is used as a starting point of the loading time to calculate the loading time.
Typically, an application program needs to load at least one page during execution. The method is used for evaluating the performance of the application program by counting the loading time of the page, for example, the loading time is long, and the performance of the application program is indicated to be poor; the loading time is short, which indicates that the application program has good performance.
Optionally, the page includes an application home page. The first page refers to the first page displayed after the application program is started.
In fact, after loading the application program home page, the user can control the application program through interactive operation. Therefore, the home page loading duration refers to a duration from when a user sends a start instruction to when loading of all resources of the home page is completed, that is, a duration when the user actually starts to use the application program, and the duration can be used for evaluating the running speed of the application program so as 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 jump stage, a network resource loading stage, a page drawing stage and the like.
The performance of the application program can be determined through calculation of the loading time length of the application program, so that a technician can load local resources in an asynchronous mode by reducing the advertisement time length, cache home page data, reduce the complexity of the home page data and the like, and the application program is optimized from the angle of a user when the full loading of the home page is reduced.
S120, from the loading starting moment, respectively screenshot pages at different moments, and respectively comparing two adjacent page images.
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 screenshot of the page may refer to screenshot of an area in the page, or screenshot of the entire page, which is specifically set according to needs, and the embodiment of the present invention is not limited in particular. The area in the page may be preconfigured, and may be, for example, a static area, where the static area refers to an area where the content in the page is almost unchanged, for example, a page element in a native page, such as a control or a background area, and the like. The resources acquired and displayed from the server may change in real time according to the content provided by the server, so that the area to which the resources belong is not a static area, and the resources may refer to multimedia resources such as text, images, audio, video, and the like. The area in the page may also be an area other than a dynamic image, which refers to an image that automatically loops over to be switched to an image, for example, a gif format.
Optionally, the step of capturing the page includes: and screenshot is carried out on a stable area in the page, wherein the change frequency of the display content in the stable area meets the low-frequency condition.
The stable region may refer to a region of the page in which an automatic change frequency is low, wherein the automatic change frequency refers to a frequency at which the region changes without an operation instruction input by a user. The stable area is used for judging whether the page is loaded completely or not. The frequency of the change is used. The low frequency condition is used for judging whether the display content in the stable area is stable and unchanged. For example, the low frequency condition may include a format of an image, and accordingly, if the image format 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 frequency of change of the presentation content is lower than a set threshold, it is determined that the presentation content satisfies the low frequency condition.
By taking the screenshot of the stable region as a page image, the time when the loading of the network resource in the page is completed can be accurately determined, so that the loading time of the network resource is used as a part of the loading time, and the loading time which takes the normal use of the application program as the ending time is accurately calculated.
In addition, the static area is subjected to screenshot, and the loading end time is determined, so that the determined loading time is actually the time when the application program is started to the page to load the local resource. Therefore, a user can determine different types of loading time lengths through screenshot of different areas of the page according to needs. The embodiment of the present invention is not particularly limited in this regard.
The screenshot of the page is performed at different moments, and the screenshot of the page can be performed according to a preset period.
Two temporally adjacent page images refer to two page images that are temporally adjacent, i.e., there are no other captured page images between the screenshot moments of the two page images.
The comparison of two temporally adjacent page images is actually whether the two page images are similar. The two time-adjacent page images are compared to judge whether the two time-adjacent page images are similar, namely, whether the page changes in the corresponding two screenshot moments is judged, and accordingly whether the page loading is completed is judged. If two time-adjacent page images are the same or similar, namely, the page is not changed in the corresponding two screenshot moments, the page loading is determined to be completed; if two time adjacent page images are different, namely the page changes in the corresponding two screenshot moments, determining that the page is not loaded.
S130, determining target page images meeting the change stability condition according to the comparison result, and determining the loading end time according to the screenshot time corresponding to each target page image.
The comparison results are used to determine whether two time-adjacent page images are similar. The varying stabilizing condition is used to determine whether the two target page images are the same or similar. When two page images are the same or similar, both page images are target page images. For example, if it is determined that the comparison result is the same result, two time-adjacent page images are determined as target page images satisfying the change stabilization condition.
The screenshot time corresponding to the target page image may refer to the time when the target page image is obtained by interception, and the time may refer to absolute system time or relative loading starting time.
The earliest screenshot time in the timeline may be taken as the loading end time.
Optionally, the determining, according to the comparison result, the target page image that meets the change stability condition, and determining, according to the screenshot time corresponding to each target page image, the loading end time includes: taking two page images with the same comparison result and adjacent time as target page images meeting the change stability condition; acquiring screenshot moments corresponding to the target page images; taking the screenshot time closest to the loading starting time as the loading ending time.
The screenshot time closest to the loading starting time is used for determining the earliest time of the page stable and unchanged. The screenshot time closest to the loading start time actually means that the duration between the screenshot time and the loading start time is the shortest, that is, the screenshot time is earliest compared with other screenshot times in the time axis.
By taking the screenshot time closest to the loading start time as the loading end time, the loading end time is closest to the actual loading end time, so that the loading end time is accurately determined.
When comparing two adjacent page images, the comparison of the page images at two adjacent times may be stopped when the same result appears for the first time in the comparison result. That is, comparing two temporally adjacent page images, respectively, includes: and respectively comparing two time adjacent page images according to the time sequence until two page images with the same result appear for the first time. Therefore, the workload of the comparison process can be saved, and the calculation efficiency of the loading end time is improved, so that the calculation efficiency of the loading time is improved.
And S140, calculating the loading time of the page according to the loading starting time and the loading ending time.
The time difference between the loading start time and the loading end time is the loading time of the page.
According to the embodiment of the invention, the pages are respectively subjected to screenshot according to different moments in the loading process to obtain the page images under different loading moments, every two page images adjacent in time are compared, the two page images adjacent in time and small in change are taken as target page images, the loading ending moment is determined according to the screenshot moment of the target page images, the moment that the display page of the application program is not changed is taken as the loading ending moment, the problem that in the prior art, only the starting time of the application program is counted as a performance judging standard, the performance evaluation reliability is poor due to inaccuracy of the loading time point is solved, the stable and unchangeable moment of the display page in the display screen is taken as the loading ending moment, and the duration of the application program can be accurately determined, so that the performance of the application program is accurately evaluated.
Example two
Fig. 2a is a flowchart of a loading time calculating method according to a second embodiment of the present invention, which is implemented based on the foregoing embodiment, and the comparing of the two time-adjacent page images respectively is implemented as follows: after the page loading is completed, calculating the similarity between two time adjacent page images from the at least two intercepted page images respectively; and if the similarity between two time adjacent target page images exceeds a pre-configured similarity threshold, determining that the comparison results of the two target page images are the same result.
The method of the embodiment specifically comprises the following steps:
s210, acquiring loading starting time of a preset module in the page loading process.
The page in the embodiment of the invention, the preset module, the loading start time, the screenshot, the page image, the change stable condition, the target page image, the screenshot time, the loading end time and the loading time can be referred to the description of the above embodiment.
Optionally, the preset module includes a code packet injected by adopting a Hook technology.
The code packet is an jar packet, and correspondingly, the loading time is the time when the application program ClassLoader loads the jar packet.
Optionally, the page includes an application home page.
S220, from the loading starting moment, respectively screenshot pages at different moments.
Optionally, the step of capturing the page includes: and screenshot is carried out on a stable area in the page, wherein the change frequency of the display content in the stable area meets the low-frequency condition.
S230, after the page loading is completed, 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 time adjacent target page images exceeds a pre-configured similarity threshold, determining that the comparison results of the two target page images are the same result.
The similarity threshold is used for judging whether two page images are identical or not. Typically, if the similarity exceeds a similarity threshold, it is determined that the two page images are identical.
Alternatively, the similarity threshold may be updated by a server or user instruction.
The similarity threshold may be configured in real-time, for example, by the server issuing data to update, or directly by input data received by the user instruction. By updating the similarity threshold, the configuration flexibility of the similarity threshold can be improved, and a plurality of application scenes are compatible.
S250, determining target page images meeting the change stability condition according to the comparison result, and determining loading end time according to screenshot time corresponding to each target page image.
Optionally, the determining, according to the comparison result, the target page image that meets the change stability condition, and determining, according to the screenshot time corresponding to each target page image, the loading end time includes: taking two page images with the same comparison result and adjacent time as target page images meeting the change stability condition; acquiring screenshot moments corresponding to the target page images; taking the screenshot time closest to the loading starting time as the loading ending time.
S260, calculating the loading time 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 the time between the starting of loading of the preset module by the application program and the completion of drawing of the page information. Specifically, as shown in fig. 2b, the home page loading process of the application program specifically includes:
s271, an application startup instruction is received.
The start instruction may refer to an instruction entered by a user to trigger the start 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 a so file and injecting jar packets by Hook.
Specifically, the Zygote process is also called a fertilized egg process, and is started by app_process, the maximum meaning of the Zygote process is as a Socket Server end, all-around process creation requests are received, all application processes in Android are created by one application process through a Binder request System Server process, and the System Server process sends Socket information to the Zygote process and is uniformly created by the Zygote process.
S273, creating Application and spark Activity.
When the Application is started for the first time, firstly, an Application process enters a Splash Activity (starting page), and jumps to a Main interface (e.g. Main Activity) of the Application program in a short time (e.g. 1-2 seconds). Typically, advertisements or pictures will be shown in the Splash Activity.
S274, loading the resource and initializing the library.
And acquiring the local resources of the spark Activity and the local resources of the Main Activity, and loading and initializing.
S275, request and play the start advertisement.
And acquiring a starting advertisement to be displayed in the Splash Activity, and playing the starting advertisement.
S276, starting Main Activity.
Main Activity is the Main interface of the application program.
S277, drawing application program home page information through the Main Activity.
And drawing the home page information in the main interface of the application program.
S278, drawing the application program home page information is completed.
After the drawing of the home page information is completed, the user can control the application program to execute corresponding functions through interactive operation.
Wherein S272 may be the loading start time, S278 is the loading end time. In order to avoid the interference of loading the top page of the application program, the loading time calculation method provided by the embodiment of the invention generally only performs the screenshot operation in the top page loading process of the application program, and performs the execution after S278, that is, after the drawing of the top page information is completed, the page image comparison operation, the loading time calculation operation and the like.
According to the embodiment of the invention, through acquiring the page images under different loading moments in the page loading process, comparing every two page images which are adjacent in time, taking the two page images which are adjacent in time and similar as target page images, determining the loading end moment according to the screenshot moment of the target page images, and taking the moment of no longer changing the display page of the application program as the loading end moment, the time for starting the application program to be instantly used can be accurately determined, and the method comprises a local resource loading stage, a network resource loading stage and a page drawing stage, so that the local resource loading performance, the network resource loading performance, the page drawing performance and the like of the application program are evaluated, the application program performance is comprehensively, completely and accurately evaluated, and the reliability and the accuracy of the application program performance evaluation are improved.
Example III
Fig. 3 is a schematic diagram of a loading time calculating device according to a third embodiment of the present invention. The third embodiment of the present invention is a corresponding apparatus for implementing the loading time calculating method provided in the foregoing embodiment of the present invention, where the apparatus may be implemented in a software and/or hardware manner, and may generally be integrated into a computer device, for example, a terminal device, etc., and specifically, a mobile phone, a tablet computer, or a vehicle-mounted device, etc.
Accordingly, the apparatus of this embodiment may include:
the loading starting moment obtaining module 310 is configured to obtain a loading starting moment of the preset module in a page loading process;
the screenshot comparing module 320 is configured to, from the loading start time, screenshot pages at different times, and compare two time-adjacent page images respectively;
the loading end time determining module 330 is configured to determine, according to the comparison result, target page images that satisfy the change stability condition, and determine loading end time according to screenshot time corresponding to each of the target page images;
the loading duration calculation module 340 is 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 pages are respectively subjected to screenshot according to different moments in the loading process to obtain the page images under different loading moments, every two page images adjacent in time are compared, the two page images adjacent in time and small in change are taken as target page images, the loading ending moment is determined according to the screenshot moment of the target page images, the moment that the display page of the application program is not changed is taken as the loading ending moment, the problem that in the prior art, only the starting time of the application program is counted as a performance judging standard, the performance evaluation reliability is poor due to inaccuracy of the loading time point is solved, the stable and unchangeable moment of the display page in the display screen is taken as the loading ending moment, and the duration of the application program can be accurately determined, so that the performance of the application program is accurately evaluated.
Further, the loading end time determining module 330 includes: a target page image determining unit for taking two adjacent page images with the same comparison result as target page images meeting the change stability condition; acquiring screenshot moments corresponding to the target page images; taking the screenshot time closest to the loading starting time as the loading ending time.
Further, the screenshot comparing module 320 includes: and the region screenshot unit is used for screenshot the stable region in the page, wherein the change frequency of the display content in the stable region meets the low-frequency condition.
Further, the screenshot comparing module 320 includes: an image similarity calculating unit, configured to calculate, from the at least two intercepted page images after the page loading is completed, a similarity between two time-adjacent page images, respectively; and if the similarity between two time adjacent target page images exceeds a pre-configured similarity threshold, determining that the comparison results of the two target page images are the same result.
Further, the similarity threshold may be updated by a server or user instruction.
Further, the preset module comprises code packages injected by the Hook technology.
Further, the page includes an application home page.
The loading time calculating device can execute the loading time calculating method provided by the embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executed loading time calculating method.
Example IV
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 merely an example and should not be construed as limiting the functionality and scope of use of embodiments of the present invention.
As shown in FIG. 4, the computer device 12 is in the form of a general purpose computing device. Components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, a bus 18 that connects the various system components, including the system memory 28 and the processing units 16. Computer device 12 may be a device that is attached to a bus.
Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, and a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include industry standard architecture (Industry Standard Architecture, ISA) bus, micro channel architecture (Micro Channel Architecture, MCA) bus, enhanced ISA bus, video electronics standards association (Video Electronics Standards Association, VESA) local bus, and peripheral component interconnect (Peripheral Component Interconnect, PCI) bus.
Computer device 12 typically includes a variety of computer system readable media. Such media can 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. The 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 or write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, commonly referred to as a "hard disk drive"). Although not shown in fig. 4, a 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 and writing to a removable nonvolatile optical disk (e.g., a compact disk Read Only Memory (CD-ROM), digital versatile disk (Digital Video Disc-Read Only Memory, DVD-ROM), or other optical media) may be provided. In such cases, each drive may be coupled to bus 18 through one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored in, for example, 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 or some combination of which may include an implementation of a network environment. Program modules 42 generally perform the functions and/or methods of the embodiments described herein.
The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and/or any devices (e.g., network card, modem, etc.) that enable the computer device 12 to communicate with one or more other computing devices. Such communication may be via an Input/Output (I/O) interface 22. The computer device 12 may also communicate with one or more networks (e.g., local area network (Local Area Network, LAN), wide area network (Wide Area Network, WAN)) via the network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via the bus 18. It should be understood that, although not shown in FIG. 4, other hardware and/or software modules may be used in connection with the computer device 12, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, (Redundant Arrays of Inexpensive Disks, RAID) systems, tape drives, data backup storage systems, and the like.
The processing unit 16 executes various functional applications and data processing by running 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
A fifth embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a load time calculation method as provided in all the embodiments of the present invention:
that is, the program, when executed by the processor, implements: acquiring a loading starting moment of a preset module in the page loading process; from the loading starting moment, respectively screenshot pages at different moments, and respectively comparing two adjacent page images; determining target page images meeting the change stability conditions according to the comparison result, and determining loading end time according to screenshot time corresponding to each target page image; and calculating the loading time of the page according to the loading starting time and the loading ending time.
The computer storage media of embodiments of the invention may take the form of 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. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 (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 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.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either 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 of the foregoing. 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 (RadioFrequency, RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations 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 ++ 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 kind of network, including a LAN or WAN, or may be connected to an external computer (for example, through the Internet using an Internet service provider).
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. 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, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (6)

1. A load time calculation method, comprising:
acquiring a loading starting moment of a preset module in the page loading process; the loading process comprises an advertisement starting loading stage, a local resource loading stage, a page jumping stage, a network resource loading stage and a page drawing stage; the preset module comprises a code packet injected by adopting a Hook technology;
from the loading starting moment, respectively carrying out screenshot on the page at different moments, wherein the screenshot comprises the following steps: screenshot is carried out on a stable region in the page to be used as a page image; wherein the frequency of variation of the display content in the stable region satisfies a low frequency condition;
and comparing the two time adjacent page images according to the time sequence until the two page images with the same result appear for the first time, comprising: after the page loading is completed, calculating the similarity between two time adjacent page images from the at least two intercepted page images respectively; if the similarity between the two time adjacent target page images exceeds a preset similarity threshold, determining that the comparison results of the two target page images are the same result;
taking two page images with the same comparison result and adjacent time as target page images meeting the change stability condition; acquiring screenshot moments corresponding to the target page images; taking the screenshot time closest to the loading starting time as the loading ending time; the change stabilizing condition is used for judging whether two target page images are identical or similar;
and calculating the loading time of the page according to the loading starting time and the loading ending time.
2. The method of claim 1, wherein the similarity threshold is updatable by a server or user instruction.
3. The method of claim 1, wherein the page comprises an application home page.
4. A load time calculation apparatus, comprising:
the loading starting moment acquisition module is used for acquiring the loading starting moment of the preset module in the page loading process; the loading process comprises an advertisement starting loading stage, a local resource loading stage, a page jumping stage, a network resource loading stage and a page drawing stage; the preset module comprises a code packet injected by adopting a Hook technology;
the screenshot comparison module is used for respectively screenshot pages at different moments from the loading starting moment, and respectively comparing two page images adjacent in time according to the time sequence until two page images with the same result appear;
the screenshot comparison module comprises a region screenshot unit and an image similarity calculation unit;
the region screenshot unit is used for screenshot the stable region in the page as a page image; wherein the frequency of variation of the display content in the stable region satisfies a low frequency condition;
the image similarity calculation unit is used for respectively calculating the similarity between two time adjacent page images from the at least two intercepted page images after the page loading is completed; if the similarity between the two time adjacent target page images exceeds a preset similarity threshold, determining that the comparison results of the two target page images are the same result;
the loading end time determining module is used for taking the page images of two adjacent times, the comparison results of which are the same, as target page images meeting the change stability condition; acquiring screenshot moments corresponding to the target page images; taking the screenshot time closest to the loading starting time as the loading ending time; the change stabilizing condition is used for judging whether two target page images are identical or similar;
the loading time length calculation module is used for calculating the loading time length of the page according to the loading starting time and the loading ending time.
5. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the load time calculation method of any of claims 1-3 when the program is executed by the processor.
6. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements a load time calculation method according to any of claims 1-3.
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 CN110825456A (en) 2020-02-21
CN110825456B true 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)

Families Citing this family (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
CN111581558B (en) * 2020-04-27 2024-03-05 北京达佳互联信息技术有限公司 Page loading time length determining method, device, equipment and storage medium
CN113760631B (en) * 2020-07-06 2024-07-16 北京沃东天骏信息技术有限公司 Page loading time length determining method, device, equipment and storage medium
CN112203150B (en) * 2020-09-30 2022-03-11 腾讯科技(深圳)有限公司 Time-consuming acquisition method, device, equipment and computer-readable 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
CN113778825B (en) * 2021-08-24 2025-01-07 北京达佳互联信息技术有限公司 Method and device for determining page index parameters, storage medium and electronic device
CN113703872A (en) * 2021-09-01 2021-11-26 北京云蝶智学科技有限公司 Method and device for acquiring page loading time
CN114371885A (en) * 2021-12-31 2022-04-19 北京沃东天骏信息技术有限公司 Method and device for testing page loading performance
CN114896013B (en) * 2022-05-12 2024-07-02 北京达佳互联信息技术有限公司 Page loading time length determining method and device, electronic equipment and storage medium

Citations (6)

* 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
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
CN110333903A (en) * 2018-03-28 2019-10-15 优酷网络技术(北京)有限公司 The determination method and device of page load duration

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10818107B2 (en) * 2013-03-15 2020-10-27 Predictive Fleet Technologies, Inc. Engine analysis and diagnostic system
US10198348B2 (en) * 2015-08-13 2019-02-05 Spirent Communications, Inc. Method to configure monitoring thresholds using output of load or resource loadings

Patent Citations (6)

* 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
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
A perceptual scheme for fully automatic video shot boundary detection;Murat Birinci, Serkan Kiranyaz;《Signal Processing: Image Communication》;第29卷(第3期);410-423 *
基于完全渲染的网页首屏性能测量设计;吴清扬 等;《电子制作》(第16期);42-44 *
基于韦伯-费希纳定律的网页访问质量评价方法;马雪琴 等;《计算机与数字工程》;第44卷(第01期);68-72 *
浅析资讯类App发展现状及央视新闻移动网客户端使用分析;马征;《现代电视技术》(第06期);103-106 *
面向Web加速的HTTP协议优化机制的研究与设计;王皘;《 CNKI优秀硕士学位论文全文库》(第04期);I139-296 *

Also Published As

Publication number Publication date
CN110825456A (en) 2020-02-21

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
CN107172454B (en) Video recommendation method, medium, device and computing equipment
CN106888236B (en) Session management method and session management device
CN111488185B (en) Page data processing method, device, electronic equipment and readable medium
CN109726076B (en) Applet life cycle management method and system
CN109614195B (en) Method, device and equipment for preloading list items and storage medium
CN110287146B (en) Method, device and computer storage medium for application download
CN109117153B (en) Application processing method, device, terminal and storage medium
US9210203B2 (en) Resource based mobile device application streaming
CN109241128B (en) Automatic triggering method and system for overdue event
US20120297399A1 (en) Automatically updating the display state of the user interface of a client device in a publish/subscribe system
CN116170549A (en) Video processing method and device
CN107943377A (en) A kind of list is loaded into transition method, device, terminal and the storage medium of displaying
US11442606B2 (en) User interface interaction method and system
CN104796785A (en) Video playing method and device in application program
CN111367783B (en) Application program testing method and device and electronic equipment
CN113760631B (en) Page loading time length determining method, device, equipment and storage medium
CN109669715A (en) application program dynamic updating method, device and storage medium
CN112291602B (en) Video playing method, electronic equipment and storage medium
CN112506592B (en) Page loading time length determining method, device, equipment and storage medium
CN109450993B (en) Method and apparatus for presenting information
CN109614564B (en) Method and device for improving interaction instantaneity of WebView and H5
CN110262856B (en) Application program data acquisition method, device, terminal and storage medium
CN111124795B (en) Application starting monitoring method, device and equipment

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