CN111625432A - Page loading time consumption determination method and device and computer readable storage medium - Google Patents

Page loading time consumption determination method and device and computer readable storage medium Download PDF

Info

Publication number
CN111625432A
CN111625432A CN201910153537.4A CN201910153537A CN111625432A CN 111625432 A CN111625432 A CN 111625432A CN 201910153537 A CN201910153537 A CN 201910153537A CN 111625432 A CN111625432 A CN 111625432A
Authority
CN
China
Prior art keywords
class
page
loading
determining
time
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
CN201910153537.4A
Other languages
Chinese (zh)
Other versions
CN111625432B (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 ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910153537.4A priority Critical patent/CN111625432B/en
Publication of CN111625432A publication Critical patent/CN111625432A/en
Application granted granted Critical
Publication of CN111625432B publication Critical patent/CN111625432B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Abstract

The invention discloses a page loading time-consuming determining method, a page loading time-consuming determining device, a page loading time-consuming determining hardware device and a computer readable storage medium. The page loading time consumption determining method comprises the following steps: determining the loading start time of a page in an application program according to the provided initialization class; determining the loading finish time of the page according to the generated mapping relation class, wherein the mapping relation class comprises an identifier for representing the page loading finish; and determining the time consumed by page loading according to the loading start time and the loading finish time. According to the method and the device for determining the loading start time of the page in the application program, the loading finish time of the page is determined according to the generated initialization class and the generated mapping relation class containing the identification representing the page loading finish, and the actual loading duration of the page can be accurately and completely reflected.

Description

Page loading time consumption determination method and device and computer readable storage medium
Technical Field
The present disclosure relates to the field of information processing technologies, and in particular, to a method and an apparatus for determining page loading time consumption, and a computer-readable storage medium.
Background
In order to measure the opening speed of a page in an application program, a developer carries out page time consumption monitoring by embedding points, and besides manual embedding points, an automatic embedding point or semi-automatic embedding point scheme with strong universality and low access cost is more prone to be used.
In the prior art, an ASM technology is used to interpolate an Activity lifecycle function, a beginning of an onCreate method is used as a page loading starting point, a beginning of an onWindowFocusChanged method is used as a page loading ending point, and a time interval between the starting point and the ending point is calculated as a page loading duration.
However, the start point and the end point of the statistical duration in the above method are fixed by the Activity lifecycle function, and may not completely reflect the actual loading duration of the page.
Disclosure of Invention
The technical problem solved by the present disclosure is to provide a page loading time-consuming determination method, so as to at least partially solve the technical problem that the actual page loading time cannot be fully reflected in the prior art. In addition, a page loading time consumption determining device, a page loading time consumption determining hardware device, a computer readable storage medium and a page loading time consumption determining terminal are also provided.
In order to achieve the above object, according to one aspect of the present disclosure, the following technical solutions are provided:
a method for determining page loading time consumption comprises the following steps:
determining the loading start time of the page in the application program according to the generated initialization class;
determining the loading finish time of the page according to the generated mapping relation class, wherein the mapping relation class comprises an identifier for representing the page loading finish;
and determining the time consumed by page loading according to the loading start time and the loading finish time.
Further, the mapping relation class includes a search method;
correspondingly, the determining the loading completion time of the page according to the generated mapping relationship class includes:
and searching whether the identifier is visible on the page or not through the searching method of the mapping relation class, if so, determining that the page is completely loaded, and determining the loading finish time of the page.
Further, the method further comprises:
reading the attribute file in the packet in the byte code processing stage;
analyzing the mapping relation between the class name of the class of the page and the identifier according to the attribute file;
and generating a mapping relation class of the mapping relation between the class name and the identifier through a plug-in.
Further, the method further comprises:
receiving an annotation class added to the class of the page, wherein the parameter of the annotation class is the identifier;
when the application program is compiled, acquiring a mapping relation between a class name of annotation labeling and the identifier through an annotation class processing library, and generating an attribute file according to the mapping relation;
and when the component class of the page is compiled and packaged, packaging the attribute files into a package, wherein the names of the attribute files corresponding to different components are different.
Further, the determining the loading start time of the page in the application program according to the generated initialization class includes:
receiving initialization operation performed in a method for starting creation of an application class corresponding to the application;
registering a life cycle callback of a component class of the page through the initialization class, recording the loading start time of the page in the creation start method of the component class, registering a layout function callback, and triggering and executing an operation of determining the loading finish time of the page through the generated mapping relation class when the layout is changed.
In order to achieve the above object, according to still another aspect of the present disclosure, the following technical solutions are also provided:
a page loading time-consuming determining device comprises:
the starting time determining module is used for determining the loading starting time of the page in the application program according to the generated initialization class;
the finish time determining module is used for determining the loading finish time of the page according to the generated mapping relation class, wherein the mapping relation class comprises an identifier for representing that the page is loaded completely;
and the time consumption determining module is used for determining the page loading time consumption according to the loading start time and the loading finish time.
Further, the mapping relation class includes a search method;
correspondingly, the finish time determination module is specifically configured to: and searching whether the identifier is visible on the page or not through the searching method of the mapping relation class, if so, determining that the page is completely loaded, and determining the loading finish time of the page.
Further, the apparatus further comprises:
the mapping relation class generation module is used for reading the attribute files in the package at the byte code processing stage; analyzing the mapping relation between the class name of the class of the page and the identifier according to the attribute file; and generating a mapping relation class of the mapping relation between the class name and the identifier through a plug-in.
Further, the apparatus further comprises:
the attribute file generation module is used for receiving an annotation class added to the class of the page, and the parameter of the annotation class is the identifier; when the application program is compiled, acquiring a mapping relation between a class name of annotation labeling and the identifier through an annotation class processing library, and generating an attribute file according to the mapping relation; and when the component class of the page is compiled and packaged, packaging the attribute files into a package, wherein the names of the attribute files corresponding to different components are different.
Further, the start time determining module is specifically configured to: receiving initialization operation performed in a method for starting creation of an application class corresponding to the application; registering a life cycle callback of a component class of the page through the initialization class, recording the loading start time of the page in the creation start method of the component class, registering a layout function callback, and triggering and executing an operation of determining the loading finish time of the page through the generated mapping relation class when the layout is changed.
In order to achieve the above object, according to still another aspect of the present disclosure, the following technical solutions are also provided:
an electronic device, comprising:
a memory for storing non-transitory computer readable instructions; and
and the processor is used for operating the computer readable instructions, so that the steps in any one of the above technical schemes of the page loading time-consuming determination method are realized when the processor is executed.
In order to achieve the above object, according to still another aspect of the present disclosure, the following technical solutions are also provided:
a computer-readable storage medium for storing non-transitory computer-readable instructions, which, when executed by a computer, cause the computer to perform any of the steps of the page loading elapsed time determination method technical solution.
In order to achieve the above object, according to still another aspect of the present disclosure, the following technical solutions are also provided:
a page loading time-consuming determination terminal comprises any page loading time-consuming determination device.
According to the method and the device for determining the loading start time of the page in the application program, the loading finish time of the page is determined according to the generated initialization class and the generated mapping relation class containing the identification representing the page loading finish, and the actual loading duration of the page can be accurately and completely reflected.
The foregoing is a summary of the present disclosure, and for the purposes of promoting a clear understanding of the technical means of the present disclosure, the present disclosure may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
Drawings
Fig. 1 is a schematic flowchart of a method for determining a page loading time according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a page loading elapsed time determination apparatus according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
The embodiments of the present disclosure are described below with specific examples, and other advantages and effects of the present disclosure will be readily apparent to those skilled in the art from the disclosure in the specification. It is to be understood that the described embodiments are merely illustrative of some, and not restrictive, of the embodiments of the disclosure. The disclosure may be embodied or carried out in various other specific embodiments, and various modifications and changes may be made in the details within the description without departing from the spirit of the disclosure. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
It is noted that various aspects of the embodiments are described below within the scope of the appended claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the disclosure, one skilled in the art should appreciate that one aspect described herein may be implemented independently of any other aspects and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. Additionally, such an apparatus may be implemented and/or such a method may be practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present disclosure, and the drawings only show the components related to the present disclosure rather than the number, shape and size of the components in actual implementation, and the type, amount and ratio of the components in actual implementation may be changed arbitrarily, and the layout of the components may be more complicated.
In addition, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects may be practiced without these specific details.
In order to solve the technical problem of low efficiency in determining page loading time consumption in the prior art, the embodiment of the disclosure provides a page loading time consumption determining method. As shown in fig. 1, the page loading elapsed time determination method mainly includes the following steps S1 to S3. Wherein:
step S1: and determining the loading starting time of the page in the application program according to the provided initialization class.
In an optional embodiment, step S1 specifically includes:
step S11: receiving initialization operation performed in a method for starting creation of an application class corresponding to an application;
step S12: the method comprises the steps of recording the loading starting time of a page in a creating starting method of a component class by initializing the life cycle callback of the component class of a class registration page, registering the layout function callback, and triggering and executing the operation of determining the loading finishing time of the page through a generated mapping relation class when the layout is changed.
Wherein, the creation start method may be an onCreate method.
For example, the embodiment may provide the initialization class PageTraceTimeManager, where the user needs to initialize in the onCreate method of the application class, the initialization class PageTraceTimeManager registers a lifecycle callback of Activity therein, records a page loading start time in the onCreate method of the component class, registers a layout function, i.e., a view tree observer.
Step S2: and determining the loading finish time of the page according to the generated mapping relation class, wherein the mapping relation class comprises an identifier for representing the finish of the page loading.
The identifier may be an id value of a view, where the view may be a resource in the main project. The id value may be imported with r.id.xxx, or may be a view defined in a subcomponent, imported with r2.id.yyy using ButterKnife library.
In an optional embodiment, the mapping relation class includes a lookup method; correspondingly, step S2 specifically includes: and searching whether the identifier is visible on the page or not by a searching method of the mapping relation class, if so, determining that the page is completely loaded, and determining the loading finish time of the page.
The searching method can be defined as a findViewIdByActivities name method, the Id of the associated view is searched by the findViewIdByActivities name method, whether the view is visible on the page or not is judged, when the condition is met, the page is considered to be completely loaded, and the current time is recorded as the page loading ending time.
Step S3: and determining the time consumed by page loading according to the loading start time and the loading finish time.
According to the embodiment, the loading start time of the page in the application program is determined according to the generated initialization class, and the loading finish time of the page is determined according to the generated mapping relation class containing the identifier representing the page loading finish, so that the actual loading duration of the page can be accurately and completely reflected.
In an optional embodiment, the method further comprises:
step S4: reading the attribute file in the packet in the byte code processing stage;
wherein, the packet can be jar packet or aar packet.
Step S5: analyzing the mapping relation between the class name and the identification of the class of the page according to the attribute file;
step S6: and generating a mapping relation class of the mapping relation between the class name and the identifier through the plug-in.
Further, a lookup method included in the mapping relationship class may also be generated.
For example, the embodiment may provide plug-in, extract attribute files in the jar package and the engineering folder in the byte code processing stage, analyze the mapping relationship between the Activity class and the id value of the view that marks the completion of Activity loading, modify the Activity recodmap class by javasist, inject the relationship into the class to obtain a mapping relationship class, and store the mapping relationship class in a hashmap manner, so that the findviewidbyactivingname method of the Activity recodmap class can find the id value of the mapped view by the Activity class name.
Further, the method further comprises:
step S7: receiving an annotation class added to the class of the page, wherein the parameter of the annotation class is an identifier;
step S8: when the application program is compiled, acquiring a mapping relation between a class name and an identifier of annotation through an annotation class processing library, and generating an attribute file according to the mapping relation;
step S9: when the component class of the page is compiled and packaged, the attribute files are packaged into a package, wherein the names of the attribute files corresponding to different components are different.
For example, the embodiment may provide an annotation class AddPageTrace, and the parameter may be an id value of view. The user adds an annotation on the page Activity class, passing in an id that identifies the view that the page load is complete (i.e., when the view appears in Activity and is visible, it means that the page has been loaded completely). A view may be a resource in the main project. The id value is imported with r.id.xxx, or may be a view defined in a subcomponent, using r2.id.yyy from butterknit library.
The embodiment can provide a processing library monitor _ builder of the AddPageTrace annotation, and is used for collecting the Activity class name and the id value of the view labeled by the annotation during code compiling, storing the Activity class name and the id value of the view into a property file map _ uuid. Class _ OUTPUT can be set as the OUTPUT directory of properties file, ensuring that properties file can be packed into package when module is compiled into jar package or aar package. Therefore, the subsequent bytecode processing process can read the properties file. And each component generates a properties file, and the properties file ensures that the file name is not repeated by using the generated uuid as a suffix of the file name. If the file names are repeated, the problem that the subsequent resource merging task leaves the properties files in multiple components only one is caused.
In order to support the resource reference mode of R2.id.yy provided by the butterknit library, JCTree is also used in the embodiment to analyze R2.id.yy, and when a mapping relationship is generated, R2 is removed, and the Android project is replaced with the method for automatically generating r.id.yy reference.
In the embodiment, the identifier of the page loading completion is indicated in a way of annotating the view id in association with the page Activity, the page loading duration calculated in this way meets the requirements of a general service scene, and is close to the actual use experience of an application program user, the access way is simple and universal, the way of quoting the resource id through the R class in general android development can be supported, the way of quoting the resource id through the R2 class generated by using a butterknit library is also supported, and the requirements of componentization development are met.
It will be appreciated by those skilled in the art that obvious modifications (e.g., combinations of the enumerated modes) or equivalents may be made to the above-described embodiments.
In the above, although the steps in the embodiment of the page loading time-consuming determination method are described in the above sequence, it should be clear to those skilled in the art that the steps in the embodiment of the present disclosure are not necessarily performed in the above sequence, and may also be performed in other sequences such as reverse, parallel, and cross, and on the basis of the above steps, those skilled in the art may also add other steps, and these obvious modifications or equivalent alternatives should also be included in the protection scope of the present disclosure, and are not described herein again.
For convenience of description, only the relevant parts of the embodiments of the present disclosure are shown, and details of the specific techniques are not disclosed, please refer to the embodiments of the method of the present disclosure.
In order to solve the technical problem of how to improve the efficiency and the real-time performance of determining page loading time consumption, the embodiment of the present disclosure provides a device for determining page loading time consumption. The device can execute the steps in the page loading time-consuming determination method embodiment. As shown in fig. 2, the apparatus mainly includes: a start time determination module 21, a finish time determination module 22, and a consumed time determination module 23; wherein the content of the first and second substances,
the start time determining module 21 is configured to determine a start time for loading a page in the application according to the provided initialization class;
the finish time determining module 22 is configured to determine a load finish time of the page according to the generated mapping relationship class, where the mapping relationship class includes an identifier indicating that the page is loaded finish;
the time consumption determining module 23 is configured to determine the page loading time consumption according to the loading start time and the loading finish time.
Further, the mapping relation class includes a search method;
correspondingly, the finish time determination module 22 is specifically configured to: and searching whether the identifier is visible on the page or not through the searching method of the mapping relation class, if so, determining that the page is completely loaded, and determining the loading finish time of the page.
Further, the apparatus further comprises: a mapping relation class generation module 24;
the mapping relation class generating module 24 is configured to read the attribute file in the packet at the bytecode processing stage; analyzing the mapping relation between the class name of the class of the page and the identifier according to the attribute file; and generating a mapping relation class of the mapping relation between the class name and the identifier through a plug-in.
Further, the apparatus further comprises: an attribute file generation module 25;
the attribute file generating module 25 is configured to receive an annotation class added to the class of the page, where a parameter of the annotation class is the identifier; when the application program is compiled, acquiring a mapping relation between a class name of annotation labeling and the identifier through an annotation class processing library, and generating an attribute file according to the mapping relation; and when the component class of the page is compiled and packaged, packaging the attribute files into a package, wherein the names of the attribute files corresponding to different components are different.
Further, the start time determining module 21 is specifically configured to: receiving initialization operation performed in a method for starting creation of an application class corresponding to the application; registering a life cycle callback of a component class of the page through the initialization class, recording the loading start time of the page in the creation start method of the component class, registering a layout function callback, and triggering and executing an operation of determining the loading finish time of the page through the generated mapping relation class when the layout is changed.
For detailed descriptions of the working principle, the realized technical effect, and the like of the embodiment of the page loading time-consuming determination apparatus, reference may be made to the related descriptions in the foregoing embodiment of the page loading time-consuming determination method, and details are not described here again.
Referring now to FIG. 3, shown is a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 3, the electronic device may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage device 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device to communicate wirelessly or by wire with other devices to exchange data. While fig. 3 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 308, or installed from the ROM 302. The computer program, when executed by the processing device 301, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise 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 many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: determining the loading start time of the page in the application program according to the generated initialization class; determining the loading finish time of the page according to the generated mapping relation class, wherein the mapping relation class comprises an identifier for representing the page loading finish; and determining the time consumed by page loading according to the loading start time and the loading finish time.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: determining the loading start time of the page in the application program according to the generated initialization class; determining the loading finish time of the page according to the generated mapping relation class, wherein the mapping relation class comprises an identifier for representing the page loading finish; and determining the time consumed by page loading according to the loading start time and the loading finish time.
Computer program code for carrying out operations for aspects of the present disclosure 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 type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (12)

1. A method for determining page loading time consumption is characterized by comprising the following steps:
determining the loading start time of a page in an application program according to the provided initialization class;
determining the loading finish time of the page according to the generated mapping relation class, wherein the mapping relation class comprises an identifier for representing the page loading finish;
and determining the time consumed by page loading according to the loading start time and the loading finish time.
2. The method of claim 1, wherein the mapping relationship class comprises a lookup method;
correspondingly, the determining the loading completion time of the page according to the generated mapping relationship class includes:
and searching whether the identifier is visible on the page or not through the searching method of the mapping relation class, if so, determining that the page is completely loaded, and determining the loading finish time of the page.
3. The method of claim 1, further comprising:
reading the attribute file in the packet in the byte code processing stage;
analyzing the mapping relation between the class name of the class of the page and the identifier according to the attribute file;
and generating a mapping relation class of the mapping relation between the class name and the identifier through a plug-in.
4. The method of claim 3, further comprising:
receiving an annotation class added to the class of the page, wherein the parameter of the annotation class is the identifier;
when the application program is compiled, acquiring a mapping relation between a class name of annotation labeling and the identifier through an annotation class processing library, and generating an attribute file according to the mapping relation;
and when the component class of the page is compiled and packaged, packaging the attribute files into a package, wherein the names of the attribute files corresponding to different components are different.
5. The method according to any one of claims 1-4, wherein determining a loading start time of a page in the application according to the generated initialization class comprises:
receiving initialization operation performed in a method for starting creation of an application class corresponding to the application;
registering a life cycle callback of a component class of the page through the initialization class, recording the loading start time of the page in the creation start method of the component class, registering a layout function callback, and triggering and executing an operation of determining the loading finish time of the page through the generated mapping relation class when the layout is changed.
6. An apparatus for determining time spent loading a page, comprising:
the starting time determining module is used for determining the loading starting time of the page in the application program according to the provided initialization class;
the finish time determining module is used for determining the loading finish time of the page according to the generated mapping relation class, wherein the mapping relation class comprises an identifier for representing that the page is loaded completely;
and the time consumption determining module is used for determining the page loading time consumption according to the loading start time and the loading finish time.
7. The apparatus of claim 6, wherein the mapping relationship class comprises a lookup method;
correspondingly, the finish time determination module is specifically configured to: and searching whether the identifier is visible on the page or not through the searching method of the mapping relation class, if so, determining that the page is completely loaded, and determining the loading finish time of the page.
8. The apparatus of claim 6, further comprising:
the mapping relation class generation module is used for reading the attribute files in the package at the byte code processing stage; analyzing the mapping relation between the class name of the class of the page and the identifier according to the attribute file; and generating a mapping relation class of the mapping relation between the class name and the identifier through a plug-in.
9. The apparatus of claim 8, further comprising:
the attribute file generation module is used for receiving an annotation class added to the class of the page, and the parameter of the annotation class is the identifier; when the application program is compiled, acquiring a mapping relation between a class name of annotation labeling and the identifier through an annotation class processing library, and generating an attribute file according to the mapping relation; and when the component class of the page is compiled and packaged, packaging the attribute files into a package, wherein the names of the attribute files corresponding to different components are different.
10. The apparatus according to any of claims 6-9, wherein the start time determining module is specifically configured to: receiving initialization operation performed in a method for starting creation of an application class corresponding to the application; registering a life cycle callback of a component class of the page through the initialization class, recording the loading start time of the page in the creation start method of the component class, registering a layout function callback, and triggering and executing an operation of determining the loading finish time of the page through the generated mapping relation class when the layout is changed.
11. An electronic device, comprising:
a memory for storing non-transitory computer readable instructions; and
a processor for executing the computer readable instructions, such that the processor when executing implements the method for determining page loading elapsed time according to any of claims 1-5.
12. A computer readable storage medium storing non-transitory computer readable instructions which, when executed by a computer, cause the computer to perform the page load elapsed time determination method of any one of claims 1-5.
CN201910153537.4A 2019-02-28 2019-02-28 Page loading time consumption determination method and device and computer readable storage medium Active CN111625432B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910153537.4A CN111625432B (en) 2019-02-28 2019-02-28 Page loading time consumption determination method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910153537.4A CN111625432B (en) 2019-02-28 2019-02-28 Page loading time consumption determination method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111625432A true CN111625432A (en) 2020-09-04
CN111625432B CN111625432B (en) 2023-03-28

Family

ID=72258777

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910153537.4A Active CN111625432B (en) 2019-02-28 2019-02-28 Page loading time consumption determination method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111625432B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424092A (en) * 2013-08-22 2015-03-18 腾讯科技(深圳)有限公司 Page loading time length testing method and device
CN105630566A (en) * 2016-02-26 2016-06-01 北京奇虎科技有限公司 Application page loading duration determining method and application page loading duration determining device
WO2016107325A1 (en) * 2014-12-29 2016-07-07 北京奇虎科技有限公司 Page resource loading method and device based on mobile terminal
CN106649063A (en) * 2016-11-22 2017-05-10 腾讯科技(深圳)有限公司 Method and system used for monitoring time consuming data when program runs
CN107391518A (en) * 2016-05-17 2017-11-24 腾讯科技(深圳)有限公司 Count system, the method and device of page load performance information
US20170346909A1 (en) * 2016-05-31 2017-11-30 Linkedin Corporation Client-side bottleneck analysis using real user monitoring data
CN107562610A (en) * 2017-09-21 2018-01-09 上海谦问万答吧云计算科技有限公司 Obtain method, apparatus, terminal and the medium of page load time
CN108920179A (en) * 2017-04-12 2018-11-30 中国移动通信集团福建有限公司 Java reflects implementation method, device and system
CN109165152A (en) * 2018-07-31 2019-01-08 上海哔哩哔哩科技有限公司 Method for monitoring performance, system and the storage medium of WEB system
CN109284470A (en) * 2018-10-25 2019-01-29 天津字节跳动科技有限公司 Page window communication means and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424092A (en) * 2013-08-22 2015-03-18 腾讯科技(深圳)有限公司 Page loading time length testing method and device
WO2016107325A1 (en) * 2014-12-29 2016-07-07 北京奇虎科技有限公司 Page resource loading method and device based on mobile terminal
CN105630566A (en) * 2016-02-26 2016-06-01 北京奇虎科技有限公司 Application page loading duration determining method and application page loading duration determining device
CN107391518A (en) * 2016-05-17 2017-11-24 腾讯科技(深圳)有限公司 Count system, the method and device of page load performance information
US20170346909A1 (en) * 2016-05-31 2017-11-30 Linkedin Corporation Client-side bottleneck analysis using real user monitoring data
CN106649063A (en) * 2016-11-22 2017-05-10 腾讯科技(深圳)有限公司 Method and system used for monitoring time consuming data when program runs
CN108920179A (en) * 2017-04-12 2018-11-30 中国移动通信集团福建有限公司 Java reflects implementation method, device and system
CN107562610A (en) * 2017-09-21 2018-01-09 上海谦问万答吧云计算科技有限公司 Obtain method, apparatus, terminal and the medium of page load time
CN109165152A (en) * 2018-07-31 2019-01-08 上海哔哩哔哩科技有限公司 Method for monitoring performance, system and the storage medium of WEB system
CN109284470A (en) * 2018-10-25 2019-01-29 天津字节跳动科技有限公司 Page window communication means and device

Also Published As

Publication number Publication date
CN111625432B (en) 2023-03-28

Similar Documents

Publication Publication Date Title
WO2018223717A1 (en) Webpage front-end testing method, device, system, apparatus and readable storage medium
CN111897740B (en) User interface testing method and device, electronic equipment and computer readable medium
CN112395253B (en) Index file generation method, terminal device, electronic device and medium
CN111198859B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN110865852B (en) Webpage component loading method and device, electronic equipment and storage medium
CN110659210A (en) Information acquisition method and device, electronic equipment and storage medium
CN110333843B (en) Method and device for realizing high-precision timer of virtual machine and electronic equipment
CN111813465A (en) Information acquisition method, device, medium and equipment
CN109408387B (en) Page testing method and device
CN110908882A (en) Performance analysis method and device of application program, terminal equipment and medium
CN111625432B (en) Page loading time consumption determination method and device and computer readable storage medium
CN111797270A (en) Audio playing method and device, electronic equipment and computer readable storage medium
CN115562686A (en) Lightweight packaging method, system, terminal and storage medium for Springboot project
CN111475148A (en) Third-party dependent library isolation method and device, electronic equipment and storage medium
CN112379967B (en) Simulator detection method, device, equipment and medium
CN111796865B (en) Byte code file modification method, device, terminal equipment and medium
CN113268221A (en) File matching method and device, storage medium and computer equipment
CN112711400B (en) View processing method, device and storage medium
CN112306683A (en) Function hijacking method, device, medium and electronic equipment
CN111274551A (en) Compiler-based java code protection method and device and electronic equipment
CN112559394B (en) System library access method and device and electronic equipment
CN111399844B (en) Secure compiling method, secure compiling device, electronic equipment and computer readable medium
CN111475138B (en) Routing method and device based on weex framework, electronic equipment and readable medium
CN111562913B (en) Method, device and equipment for pre-creating view component and computer readable medium
CN112688863B (en) Gateway data processing method and device and electronic 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