Statistical method, device, equipment and product for time consumption of page display in application program
By recording the start and end times of page statistics and combining them with pre-set events, the differences in time consumption statistics for different page types are resolved. This enables unified calculation and monitoring of page display time in the application, reducing the difficulty of statistics and improving accuracy and efficiency.
Patent Information
- Application Number
- CN202210940025.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-05
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-08-05
AI Technical Summary
The lack of a unified method for calculating page display time in existing technologies leads to differences in page display time statistics for different page types, increasing the difficulty of monitoring and calculating page display time in applications.
By recording the occurrence time of the statistical start and end events of the page to be counted, and using them as the start and end times of the statistics respectively, and by pre-setting the statistical start and end events for each page type, the display time of each page type can be obtained based on the start and end times.
It provides a unified method for calculating page display time, which reduces the difficulty of statistical monitoring of page display time in applications and improves the accuracy and efficiency of statistics.
Smart Images

Figure CN115422019B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of electronic map, and particularly relates to a method and device for counting time consumption of page display in an application, equipment and product. BACKGROUND
[0002] In addition to the logical smoothness of interaction, the time consumption of page opening is also extremely important experience for users in the user experience of business in an application. Therefore, developers need to count and monitor the time consumption of pages in the application to evaluate the performance of the application. In the application, there may be multiple page types. Since the display principles and display methods of each page type are different, the page time consumption statistics of different page types are different. At present, there is no unified page display time consumption calculation method in the prior art. SUMMARY
[0003] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method and device for counting time consumption of page display in an application, equipment and product.
[0004] In a first aspect, the present disclosure provides a method for counting time consumption of page display in an application, the method comprising:
[0005] In response to a counting start event of a page to be counted, an operation of recording a time point when the counting start event occurs is performed as a start counting time point;
[0006] In response to a counting stop event of the page to be counted, an operation of recording a time point when the counting stop event occurs is performed as a stop counting time point, and an operation of recording a page type of the page to be counted is performed;
[0007] Based on the start counting time point and the stop counting time point, the display time consumption of the page to be counted of each page type is obtained;
[0008] The page type of the page to be counted includes at least one of a scene page group, a dynamic rendering page, an H5 page and a Native page. The counting start event and the counting stop event corresponding to the page to be counted of each page type are pre-set. At least one of the counting start event and the counting stop event corresponding to the page to be counted of different page types is different.
[0009] In a second aspect, the present disclosure further provides a device for counting time consumption of page display in an application, the device comprising:
[0010] The first recording module is configured to, in response to a counting start event of a page to be counted, perform an operation of recording a time point when the counting start event occurs as a start counting time point;
[0011] The second recording module is configured to, in response to the statistical end event of the page to be counted, record a time when the statistical end event occurs as a statistical end time, and record a page type of the page to be counted;
[0012] The acquisition module is configured to acquire a display time of the page to be counted of each page type based on the statistical start time and the statistical end time.
[0013] The page type of the page to be counted includes at least one of a scene page group, a dynamic rendering page, an H5 page, and a Native page, the statistical start event and the statistical end event corresponding to the page to be counted of each page type are pre-set, and at least one of the statistical start event and the statistical end event corresponding to the page to be counted of different page types is different.
[0014] In a third aspect, the present disclosure further provides an electronic device, which comprises a memory and a processor.
[0015] The memory is configured to store executable instructions of the processor.
[0016] The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the page display time counting method in any of the above application programs.
[0017] In a fourth aspect, the present disclosure further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the page display time counting method in any of the above application programs.
[0018] In a fifth aspect, the present disclosure further provides a computer program product for executing the page display time counting method in any of the above application programs.
[0019] Compared with the prior art, the technical solution provided by this disclosure has at least the following advantages: In this disclosure, in response to the statistical start event of the page to be counted, an operation is performed to record the occurrence time of the statistical start event as the start time of the statistics, and in response to the statistical end event of the page to be counted, an operation is performed to record the occurrence time of the statistical end event as the end time of the statistics, and an operation is performed to record the page type of the page to be counted, thereby obtaining the display time of the page to be counted for each page type based on the start time of the statistics and the end time of the statistics. The page type of the page to be counted includes at least one of scene page group, dynamic rendering page, H5 page and Native page. The statistical start event and statistical end event corresponding to the page to be counted for each page type are preset. For the page to be counted for different page types, at least one of the statistical start event and the statistical end event is different. This solution pre-sets statistical start and end events for each page type, allowing for the determination of page display time based on the recorded start and end times of the statistical events. This provides a unified method for calculating page display time, reducing the difficulty of monitoring page display time statistics in applications. Attached Figure Description
[0020] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0021] Figure 1 A flowchart illustrating a method for calculating the time taken to display a page in an application, as provided in an embodiment of this disclosure;
[0022] Figure 2 This diagram illustrates the page lifecycle for different page types.
[0023] Figure 3 Example diagrams of event monitoring and reporting for different page types provided in an exemplary embodiment of this disclosure;
[0024] Figure 4 A schematic diagram of the structure of a statistical device for displaying page time in an application provided in an embodiment of this disclosure;
[0025] Figure 5A structural schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown in FIG. 1. DETAILED DESCRIPTION
[0026] Embodiments of the present disclosure will be described in more detail by referring to the drawings. Although certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein, but rather the embodiments are provided so as to more thoroughly and completely understand the present disclosure. It is understood that the drawings and embodiments of the present disclosure are for exemplary purposes only and are not intended to limit the scope of the present disclosure.
[0027] It should be understood that each of the steps recited in the method embodiments of the present disclosure can be executed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the execution of the steps shown. The scope of the present disclosure is not limited in this respect.
[0028] The term "comprising" and variations thereof as used herein are open-ended, that is, "comprising but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment." The term "another embodiment" means "at least one additional embodiment." The term "some embodiments" means "at least some embodiments." Related definitions are given throughout the detailed description.
[0029] It should be noted that the terms "first", "second", and the like in the present disclosure are merely used to distinguish different devices, modules or units, and do not imply the order or interdependence of the functions performed by these devices, modules or units.
[0030] It should be noted that the modification of "one" or "multiple" in the present disclosure is illustrative rather than limiting, and those skilled in the art should understand that, unless otherwise explicitly indicated in the context, it should be understood as "one or more".
[0031] The application program can involve multiple page types of pages, such as dynamic rendering pages based on Javascript and XML (eXtensible Markup Language), H5 (Hyper Text Markup Language 5) pages, Native pages developed by system SDK (Software Development Kit) development languages on Android and IOS terminals, and the like. Since the display principles and display modes of each page type are different, the page display time consumption statistics of different page types are different, and there is no unified page display time consumption calculation method in the prior art, resulting in great difficulty in application program page display time consumption statistics.
[0032] To solve the above problems, the embodiment of the present disclosure provides a solution. When the statistical starting event of the page to be counted occurs, the occurrence time of the statistical starting event is recorded as the starting statistical time, and when the statistical cutoff event of the page to be counted occurs, the occurrence time of the statistical cutoff event is recorded as the termination statistical time, and the page type of the page to be counted is recorded. Then, the display time consumption of the page to be counted of each page type is obtained based on the starting statistical time and the termination statistical time, wherein the page type of the page to be counted includes at least one of a scene page group, a dynamic rendering page, an H5 page and a Native page. The statistical starting event and the statistical cutoff event corresponding to the page to be counted of each page type are pre-set. In this solution, the statistical starting event and the statistical cutoff event corresponding to the page of each page type are pre-set, so that for different page types of pages, the occurrence time of the statistical starting event is recorded as the starting statistical time when the statistical starting event occurs, and the occurrence time of the statistical cutoff event is recorded as the termination statistical time when the statistical cutoff event occurs. Then, the display time consumption of the page can be determined according to the termination statistical time and the starting statistical time, a unified page display time consumption calculation method is provided, the occurrence time of the statistical starting event and the statistical cutoff event is recorded to determine the display time consumption of the page, and the difficulty of page display time consumption statistics and monitoring in the application program is reduced.
[0033] Figure 1A flowchart of a page display time consumption statistical method provided by an embodiment of the present disclosure can be applied to the monitoring of the display time consumption of different types of pages in an application. The page display time consumption statistical method in the application can be executed by a page display time consumption statistical device in the application. The device can be implemented by software and / or hardware and can be integrated on any electronic device with computing capability, such as a mobile phone, a tablet computer, or the like. The electronic device has an application installed thereon, and the application supports at least one of the following page types: a scene page group, a dynamic rendering page, an H5 page, and a Native page.
[0034] As shown in Figure 1 The page display time consumption statistical method in the application includes the following steps.
[0035] S101, in response to a statistical starting event of a page to be counted, an operation of recording a time when the statistical starting event occurs is performed as a starting statistical time.
[0036] The page to be counted can be any page in the application, and the page type of the page to be counted can be at least one of the following: a scene page group, a dynamic rendering page, an H5 page, and a Native page. For each page type, a corresponding statistical starting event can be set in advance according to actual needs. The statistical starting events of different page types can be the same or different.
[0037] In the embodiment of the present disclosure, for the page to be counted, the life cycle of the page to be counted can be monitored. When a preset statistical starting event is detected, the occurrence time of the statistical starting event is recorded in response to the statistical starting event, and the recorded occurrence time is taken as the starting statistical time.
[0038] S102, in response to a statistical ending event of the page to be counted, an operation of recording a time when the statistical ending event occurs is performed as a terminating statistical time, and an operation of recording a page type of the page to be counted is performed, wherein the page type of the page to be counted includes at least one of the following: a scene page group, a dynamic rendering page, an H5 page, and a Native page. The statistical starting event and the statistical ending event corresponding to the page to be counted of each page type are set in advance. At least one of the statistical starting event and the statistical ending event corresponding to the page to be counted of different page types is different.
[0039] For each page type, a corresponding statistical ending event can be set in advance according to actual needs. The statistical starting events of different page types can be the same or different.
[0040] Exemplarily, for the scene page group, a start event of the scene can be preset as a statistical start event, and an end time of the scene can be preset as a statistical end event; for the dynamic rendering page, the H5 page and the Native page, a page creation event can be preset as a statistical start event, and a page display event can be preset as a statistical end event.
[0041] In the embodiments of the present disclosure, for the page to be counted, the life cycle of the page to be counted is continuously monitored, and when a preset statistical end event is monitored to occur, the occurrence time of the statistical end event is recorded in response to the statistical end event, and the recorded occurrence time of the statistical end event is taken as a termination statistical time.
[0042] In S103, the display time consumption of the page to be counted of each page type is obtained based on the start statistical time and the termination statistical time.
[0043] In the embodiments of the present disclosure, by obtaining the start statistical time and the termination statistical time of the page to be counted, and then based on the start statistical time and the termination statistical time, the display time consumption of the page to be counted can be obtained. Specifically, the difference obtained by subtracting the start statistical time from the termination statistical time is calculated, and the obtained difference is determined as the display time consumption of the page to be counted.
[0044] The embodiments of the present disclosure provide a method for counting the display time consumption of a page in an application program. The method comprises the following steps: in response to a statistical start event of a page to be counted, recording the occurrence time of the statistical start event as a start statistical time; in response to a statistical end event of the page to be counted, recording the occurrence time of the statistical end event as a termination statistical time; and recording the page type of the page to be counted, and then based on the start statistical time and the termination statistical time, obtaining the display time consumption of the page to be counted of each page type. The page type of the page to be counted comprises at least one of a scene page group, a dynamic rendering page, an H5 page and a Native page. The statistical start event and the statistical end event corresponding to the page to be counted of each page type are preset. For the page to be counted of different page types, at least one of the statistical start event and the statistical end event corresponding thereto is different. In the present scheme, the statistical start event and the statistical end event corresponding to the page of each page type are preset, so that for the page of different page types, the occurrence time of the statistical start event is recorded as the start statistical time when the statistical start event occurs, and the occurrence time of the statistical end event is recorded as the termination statistical time when the statistical end event occurs, and then the display time consumption of the page can be determined according to the termination statistical time and the start statistical time. A unified page display time consumption calculation method is provided, the display time consumption of the page can be determined by recording the occurrence time of the statistical start event and the statistical end event, and the difficulty of counting and monitoring the display time consumption of the page in the application program is reduced.
[0045] Different services can be implemented in an application, for example, for an electronic map application, route navigation services, taxi services, hotel booking services, etc. can be implemented, each service can be regarded as a scene, and the completion of one service can require loading multiple pages, and the page types of the loaded multiple pages can be the same or different. Therefore, multiple pages, referred to as a scene page group, can be included in one scene.
[0046] A SceneLog is a start and end point log point specially customized for a service, and there are multiple groups of start and end points to distinguish different scene page groups. When a certain end point is reached, all memory log point information is exposed at one time. From experience, the specified page is completed after the first frame, which is the last callback when the page is operable. For example, when implementing route navigation services, the following process needs to be performed: the user inputs a search place name, the search result is displayed, the user selects a route, clicks on navigation, and starts navigation. Each process can be regarded as a page, and each page can include multiple frames. The first frame can be the basic framework of the page, and subsequent frames are displayed on the basis of the basic framework. Therefore, multiple frames of multiple pages are usually required to implement a service. When the last frame of the last page is displayed, the page is considered to be completely displayed. For the above-mentioned scene of implementing route navigation services, the last frame of the page can be set as a statistical cutoff event. In addition, the SceneLog defines a start point. The start time of the start point can be an occurrence time earlier than the page creation time of the page lifecycle. At this time, the start point of the statistics should be calculated according to the start of the SceneLog. For example, the user input of the search place name can be set as a statistical start event.
[0047] Therefore, in an optional embodiment of the present disclosure, when the page type of the page to be counted is a scene page group, the scene page group includes at least two pages associated with a scene, the statistical start event can be pre-set as a start operation event of the scene, and the statistical cutoff event can be pre-set as a display completion event of the last page in the at least two pages. Therefore, in response to the statistical start event of the page to be counted, an operation of recording the occurrence time of the statistical start event is performed as a start statistical time, which includes:
[0048] in response to the start operation event, an operation of recording the occurrence time of the start operation event is performed as a start statistical time;
[0049] in response to the statistical cutoff event of the page to be counted, an operation of recording the occurrence time of the statistical cutoff event is performed as a termination statistical time, and an operation of recording the page type of the page to be counted is performed, which includes:
[0050] In response to the display completion event, an operation of recording a time point of occurrence of the display completion event is performed as a termination time point, and an operation of recording a page type of the page to be counted as a scene page group is performed.
[0051] In the embodiments of the present disclosure, when the page type of the page to be counted is a scene page group, since the starting point (the starting operation event) defined by the scene log is earlier than the time point of occurrence of the page creation event of the page, the time point of occurrence of the starting operation event can be recorded as the starting time point in response to the starting operation event when the occurrence of the starting operation event is monitored. Since the loading of the scene page group is considered to be completed only when the display completion event of the last page in the scene page group occurs, the display completion event of the last page in the scene page group can be taken as the termination event, and the time point of occurrence of the display completion event of the last page can be recorded as the termination time point when the display completion event of the last page is monitored.
[0052] In order to facilitate the differentiation of different page types, in the embodiments of the present disclosure, the page type of the page to be counted can also be recorded when recording. When the display completion event of the last page is monitored, according to the monitored event, it can be determined that the page type of the page to be counted is a scene page group, and when the time point of occurrence of the display completion event of the last page is recorded, it can be recorded that the page type of the page to be counted is a scene page group.
[0053] Taking the Android system as an example, in general, a newly created page will sequentially experience the following life cycle: page creation (onCreate) - page startup (onStart) - page display (onResume) - page pause (onPause) - page stop (onStop) - page destruction (onDestroy), and generally, the Native page is executed according to the above-mentioned life cycle. For a dynamic rendering page, the life cycle thereof includes a first frame callback (Rendfull) event, and the Rendfull event is used to represent the first frame content of the dynamic rendering page; for a scene page group, the life cycle thereof can further include a monitoring log end (SceneLogEnd) event. For an H5 page, since it depends on a web view control, such as a Webview, to load, and after the loading is completed, the Webview calls a loading end (LoadFinish) event or a presentation loading progress (LoadPropress), a preset recording progress setting value can be set, and therefore, the life cycle of the H5 page includes the loading end event or the event that the loading progress reaches the setting value. Figure 2 The page life cycle diagrams of different page types are shown in FIGS. 1 to 3, Figure 2 In the embodiments of the present disclosure, the life cycle of the H5 page includes the loading end event as an example.Figure 2 In the prior art, when page multiplexing occurs, for example, when a bus planning page of a certain map software is switched to a driving page, a new page event (onNewIntent) is generated, which is equivalent to another form of page creation, and the two pages before and after will multiplex the page instance.
[0054] From Figure 2 As can be seen, for the dynamic rendering page, the H5 page and the Native page, the starting point of the life cycle is the page creation event, and thus, in an optional embodiment of the present disclosure, for the three page types of the dynamic rendering page, the H5 page and the Native page, the statistical starting event can be set in advance as the page creation event, and thus, if the page type of the page to be counted is at least one of the dynamic rendering page, the H5 page and the Native page, the operation of recording the occurrence time of the statistical starting event is performed as the starting statistical time in response to the statistical starting event of the page to be counted, including:
[0055] In response to the page creation event, the operation of recording the occurrence time of the page creation event is performed as the starting statistical time.
[0056] In the embodiment of the present disclosure, when the page type of the page to be counted is at least one of the dynamic rendering page, the H5 page and the Native page, the page creation event is set as the statistical starting event and the occurrence of the page creation event is monitored, and when the occurrence of the page creation event is monitored, the occurrence time is recorded as the starting statistical time.
[0057] For the dynamic rendering page, the drawing of the page content is triggered after the page framework is displayed. Since the page is dynamically rendered, it is not possible to uniformly define the complete display time of a page, and thus, in the embodiment of the present disclosure, a calculation method for evaluating the display time consumption of the dynamic rendering page according to the first frame time consumption is proposed. The first frame time consumption is used for evaluation because, for a page with a skeleton screen, when the skeleton screen is first rendered, it is considered that the first frame of the page is displayed, and after all, the user has seen the page content. After the first frame content of the dynamic rendering page is displayed, a first frame callback event is triggered, and thus, for the dynamic rendering page, the statistical end event can be set in advance as the first frame callback event. Thus, in an optional embodiment of the present disclosure, if the page type of the page to be counted is the dynamic rendering page, the operation of recording the occurrence time of the statistical end event is performed as the termination statistical time in response to the statistical end event of the page to be counted, and the operation of recording the page type of the page to be counted is performed, including:
[0058] In response to the first frame callback event, an operation of recording a time when the first frame callback event occurs is performed as a termination time point, and an operation of recording that the page type of the page to be counted is a dynamic rendering page is performed.
[0059] In the embodiments of the present disclosure, for a dynamic rendering page, a statistical cutoff event is set in advance as a first frame callback event, when the occurrence of the first frame callback event is monitored, in response to the first frame callback event, the time when the first frame callback event occurs is recorded as a termination time point, and according to the monitored first frame callback event, it can be determined that the page type of the page to be counted is a dynamic rendering page, and then the page type of the page to be counted is recorded as a dynamic rendering page.
[0060] For an H5 page, since the H5 page needs to rely on a page view control, such as Webview, to load, the Webview loads the end event or the loading progress reaches the set value after loading is completed, therefore, for the H5 page, the statistical cutoff event can be set in advance as the end event or the loading progress reaching the set value, wherein the set value can be set in advance according to actual needs, for example, when the loading progress is 100%, it means that the page loading is completed, then the set value can be set in advance as 100%, that is, LoadPropress = 100%. Therefore, in an optional embodiment of the present disclosure, if the page type of the page to be counted is an H5 page, in response to the statistical cutoff event of the page to be counted, an operation of recording a time when the statistical cutoff event occurs is performed as a termination time point, and an operation of recording the page type of the page to be counted is performed, including:
[0061] In response to the end callback event of loading or the loading progress reaching the set value, an operation of recording a time when the end callback event of loading or the loading progress reaching the set value occurs is performed as a termination time point, and an operation of recording that the page type of the page to be counted is an H5 page is performed.
[0062] In the embodiments of the present disclosure, for an H5 page, a statistical cutoff event is set in advance as an end event of loading or a loading progress reaching a set value, when the end event of loading is monitored, in response to the end event of loading, a time when the end event of loading occurs is recorded as a termination time point, or when the loading progress reaches the set value is monitored, a time when the loading progress reaches the set value is recorded as a termination time point. And according to the monitored end event of loading or the loading progress reaching the set value, it can be determined that the page type of the current page to be counted is an H5 page, and the page type of the page to be counted is recorded as an H5 page.
[0063] From the above, Figure 2The illustrated lifecycle state can be seen that for the Native page, after the page is created, the page is in an interactive state when the page is displayed, and the user can perform click and other interaction operations on the page. Therefore, it can be considered that the first frame content of the Native page has been drawn when the first interaction operation of the user is monitored. It can be understood that, Figure 2 The lifecycle state is taken as an example of the Android system. For the IOS system, the page is in an interactive state at the didAppear state. Therefore, for the Native page, the statistical cutoff event can be set in advance as receiving the first page interaction operation message. Thus, in an optional embodiment of the present disclosure, if the page type of the page to be counted is a Native page, the operation of recording the occurrence time of the statistical cutoff event is performed as the termination time, and the operation of recording the page type of the page to be counted is performed, including:
[0064] In response to receiving the first page interaction operation message, the operation of recording the occurrence time of receiving the first page interaction operation message is performed as the termination time, and the operation of recording the page type of the page to be counted as a Native page is performed.
[0065] In the embodiment of the present disclosure, for the Native page, the statistical cutoff event can be set in advance as receiving the first page interaction operation message. When the first page interaction operation message is received, the occurrence time of receiving the message is recorded as the termination time, and the page type of the page to be counted is recorded as a Native page.
[0066] As can be seen from the above embodiment, the statistical starting events of the Native page, the H5 page and the dynamic rendering page are the same, and the page type of the page to be counted cannot be known in advance. By monitoring the preset statistical cutoff event corresponding to each page type, the page type of the page to be counted is recorded, which provides convenience for subsequent analysis of the display time consumption of different page types in the application program.
[0067] Figure 3 The event monitoring and reporting example diagram provided by an exemplary embodiment of the present disclosure for different page types is as follows: Figure 3The default page is a Native page. When a page creation event is monitored, a page creation event and a time of occurrence are added in a page log file. When a page display event is monitored, a page display event is added in the page log file. Then, if a first page interaction operation message is monitored, the first page interaction operation and a time of occurrence are added in the page log file, and the page type is recorded as a Native page. If a first frame callback event is monitored, the first frame callback event and a time of occurrence are added in the page log file, and the page type is recorded as a dynamic rendering page. If a loading end event is monitored, the loading end event and a time of occurrence are added in the page log file, and the page type is recorded as an H5 page. If a last page display completion event is monitored, the display completion event and a time of occurrence are added in the page log file, and the page type is recorded as a scene page group. It can be understood that, although not shown in the Figure 3 The starting time of the scene page group is earlier than the time of occurrence of the page creation event. Therefore, when the page creation event is monitored, if a user operation is monitored, a time of occurrence of the user operation is recorded in the page log file. Then, the page life cycle state is continuously monitored. When a page stop event is monitored, it is determined whether data needs to be uploaded. If the data needs to be uploaded, the data is uploaded. Figure 3 In the method, when the page creation event is monitored, the last time of data is uploaded, and the last time of data is complete. According to the uploaded data, the page display time of each page type can be counted.
[0068] In the embodiments of the present disclosure, the same statistical starting event can be pre-set for different page types. Since the page type of a newly created page cannot be known in advance, an object similar to an identity is needed to mark the newly created page, so as to distinguish to which page each event belongs. However, since the Native page framework, the life cycle statistics of the dynamically rendered page, the callback of the scene page group, the callback of the H5 page, and the like are implemented in different modules and classes, the page information and the event information cannot be associated through internal objects. However, in the scheme of the present disclosure, the object that can uniquely determine the page is needed in the statistical period to ensure the accuracy of data collection, so as to ensure the accuracy of the page display time consumption. Based on this, in an optional implementation of the present disclosure, when the event information of the page is collected, a set of event collection objects is set for each newly created page, wherein the event collection objects in the set of event collection objects can be one or more, so as to ensure that each event under the same set of event collection objects belongs to the same page, thereby identifying the events belonging to the same page in subsequent processing, and then determining the display time consumption of the page according to the recorded page type, the pre-set statistical starting event and statistical ending event, and the occurrence time of each event.
[0069] As described in the foregoing embodiments, the statistical ending event is different for different page types, and the page type cannot be known in advance and can only be perceived at the end. In some application scenarios, for example, there are the following scenarios:
[0070] Scenario one: clicking to start the B page in the A page
[0071] If the A page is a Native page, its life cycle state is in the page display state, and the life cycle will immediately call the page creation event of the B page, and then the page pause, page stop, and the like of the A page. Since the page type cannot be known in advance, the first page interaction operation after the page display cannot be directly used for statistics.
[0072] Scenario two: the current page is the C page, and the B page is backed
[0073] In this scenario, for the C page, it will enter the page pause, page stop, and page destruction from the page display state.
[0074] Scenario three: in an electronic map application, the current page is the public transportation planning home page, and the driving page is switched to
[0075] In this scenario, since the instances of each switching page of the planning home page are reused, the life cycle will be onNewIntent, and then onStart, onResume, and the like will be restarted.
[0076] From the above scenario, for the case that the page type and the statistical manner cannot be determined, although the page type cannot be known at the beginning, by using the scheme of the present disclosure, the preset key events (preset statistical starting event, statistical ending event) and the page type can be recorded in the entire life cycle of the page, so that it can be known according to the recorded data which events occur to the page and the page display time consumption is counted, and the page type can be known. Therefore, the data aggregation can be performed in the necessary life cycle, that is, the page display time consumption of different page types can be counted. When the life cycle of the page goes to the page stop state, the page has stopped and cannot be seen, so in an optional embodiment of the present disclosure, the data aggregation can be performed when the page stop event is monitored, and the display time consumption is calculated. Therefore, the display time consumption of the page to be counted of each page type is obtained based on the starting statistical time and the ending statistical time, comprising:
[0077] In response to the page stop event of the page to be counted, the operation of obtaining the display time consumption of the page to be counted of each page type based on the starting statistical time and the ending statistical time is performed.
[0078] In the above Figure 3 In the embodiment, the obtained original data, such as the page type, the starting statistical time and the ending statistical time, can be uploaded, and the display time consumption of the page to be counted of each page type is obtained based on the starting statistical time and the ending statistical time by the server; or the display time consumption of the page to be counted of each page type is obtained according to the above steps on the local device, and then the obtained display time consumption is uploaded; or the data of the above two aspects is uploaded.
[0079] It should be noted that the page stop event will be executed in various scenarios, and the data aggregation can be performed when the page stop event is first monitored, so that the data aggregation and processing can be performed in the scenarios of newly starting the page, backtracking and reusing.
[0080] In the embodiment of the present disclosure, when the page stop event of the page to be counted is monitored, the complete data required for calculating the page display time consumption has been obtained, so that the display time consumption of the page to be counted of each page type is obtained based on the starting statistical time and the ending statistical time, and the page display time consumption of the page to be counted can be accurately counted.
[0081] Based on the same inventive concept, the embodiments of the present disclosure further provide a device for counting time consumption of page display in an application. The device can execute the steps of any of the methods for counting time consumption of page display in an application provided by the embodiments of the present disclosure, and has the function modules and beneficial effects corresponding to the execution method. To avoid repetition, the description is omitted here. The device can be implemented by software and / or hardware, and can be integrated on any electronic device with computing capability.
[0082] Figure 4 FIG. 4 is a structural schematic diagram of a device for counting time consumption of page display in an application according to an embodiment of the present disclosure. Figure 4 The device 400 for counting time consumption of page display in an application includes a first recording module 401, a second recording module 402 and an acquisition module 403, wherein
[0083] The first recording module 401 is configured to, in response to a counting start event of a to-be-counted page, record a time point of occurrence of the counting start event as a start counting time point.
[0084] The second recording module 402 is configured to, in response to a counting stop event of the to-be-counted page, record a time point of occurrence of the counting stop event as a stop counting time point, and record a page type of the to-be-counted page.
[0085] The acquisition module 403 is configured to acquire time consumption of display of the to-be-counted page of each page type based on the start counting time point and the stop counting time point.
[0086] The page type of the to-be-counted page includes at least one of a scene page group, a dynamic rendering page, an H5 page and a Native page. The counting start event and the counting stop event corresponding to the to-be-counted page of each page type are pre-set. At least one of the counting start event and the counting stop event corresponding to the to-be-counted page of different page types is different.
[0087] In an optional implementation of the present disclosure, if the page type of the page to be counted is a scene page group, the scene page group includes at least two pages associated with a scene, the counting start event is preset as a start operation event of the scene, and the counting end event is preset as a display completion event of a last page in the at least two pages; therefore, the first recording module 401 is further configured to: in response to the start operation event, perform an operation of recording a time point when the start operation event occurs as a start counting time point; and the second recording module 402 is further configured to: in response to the display completion event, perform an operation of recording a time point when the display completion event occurs as a termination counting time point, and perform an operation of recording that the page type of the page to be counted is a scene page group.
[0088] In an optional implementation of the present disclosure, if the page type of the page to be counted is at least one of a dynamic rendering page, an H5 page and a Native page, the counting start event is preset as a page creation event; and the first recording module 401 is further configured to: in response to the page creation event, perform an operation of recording a time point when the page creation event occurs as a start counting time point.
[0089] In an optional implementation of the present disclosure, if the page type of the page to be counted is a dynamic rendering page, the counting end event is preset as a first frame callback event; and the second recording module 402 is further configured to: in response to the first frame callback event, perform an operation of recording a time point when the first frame callback event occurs as a termination counting time point, and perform an operation of recording that the page type of the page to be counted is a dynamic rendering page.
[0090] In an optional implementation of the present disclosure, if the page type of the page to be counted is an H5 page, the counting end event is preset as a loading end callback event or a loading progress reaching a set value; and the second recording module 402 is further configured to: in response to the loading end callback event or the loading progress reaching the set value, perform an operation of recording a time point when the loading end callback event or the loading progress reaching the set value occurs as a termination counting time point, and perform an operation of recording that the page type of the page to be counted is an H5 page.
[0091] In an optional implementation of the present disclosure, if the page type of the page to be counted is a Native page, the counting end event is preset as receiving a first page interaction operation message; and the second recording module 402 is further configured to: in response to receiving the first page interaction operation message, perform an operation of recording a time point when the first page interaction operation message is received as a termination counting time point, and perform an operation of recording that the page type of the page to be counted is a Native page.
[0092] In an optional implementation of the present disclosure, the acquisition module 403 is further configured to: in response to a page stop event occurring in the page to be counted, perform the operation of acquiring the display time consumption of the page to be counted of each page type based on the starting counting time and the ending counting time.
[0093] Figure 5 A structural schematic diagram of an electronic device is provided for the embodiments of the present disclosure, which is used to exemplarily illustrate the electronic device implementing the method for counting the page display time consumption in any one of the application programs of the embodiments of the present disclosure, and should not be understood as a specific limitation of the embodiments of the present disclosure.
[0094] As shown in Figure 5 The electronic device 500 can include a processor (such as a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 502 or loaded into a random access memory (RAM) 503 from a storage device 508. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processor 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0095] Generally, the following devices can be connected to the I / O interface 505: input devices 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 508 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 509. The communication devices 509 can allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Although the electronic device 500 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. More or fewer devices can be alternatively implemented or possessed.
[0096] In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program codes for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 509, or installed from the storage devices 508, or installed from the ROM 502. When the computer program is executed by the processor 501, the functions defined in any one of the methods for counting the page display time consumption in the application programs provided by the embodiments of the present disclosure can be performed.
[0097] Note that the computer readable medium described above in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination thereof. 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 any suitable combination of the above. More specific examples of the computer readable storage medium can 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 above. In the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus or device. In the present disclosure, the computer readable signal medium can include a data signal propagated in baseband or propagated as a carrier wave in a propagated data signal, in which the computer readable program code is contained. Such a propagated data signal can take many forms, including but not limited to, an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium can also be any computer readable medium that is not a computer readable storage medium and that can communicate, transmit, or propagate the program for use by or in connection with the instruction execution system, apparatus or device. The program code contained in the computer readable medium can be transmitted by any suitable medium, including but not limited to, wire, cable, RF (radio frequency), or the like, or any suitable combination of the above.
[0098] In some embodiments, the client, server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communications (e.g., a communications network) of any form or medium, including the Internet. Examples of communications networks include local area networks ("LANs"), wide area networks ("WANs"), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
[0099] The computer readable medium described above can be included in the electronic device described above; or can exist separately from the electronic device and be not assembled in the electronic device.
[0100] The computer readable medium described above carries one or more programs, when the one or more programs are executed by the electronic device, cause the electronic device to:
[0101] In response to a statistic starting event of a page to be counted, an operation of recording a time when the statistic starting event occurs is performed as a starting statistic time; in response to a statistic ending event of the page to be counted, an operation of recording a time when the statistic ending event occurs is performed as a terminating statistic time, and an operation of recording a page type of the page to be counted is performed; and a display time consumption of the page to be counted of each page type is obtained based on the starting statistic time and the terminating statistic time; wherein the page type of the page to be counted includes at least one of a scene page group, a dynamic rendering page, an H5 page, and a Native page, the statistic starting event and the statistic ending event corresponding to the page to be counted of each page type are pre-set, and at least one of the statistic starting event and the statistic ending event corresponding to the page to be counted of different page types is different.
[0102] In an embodiment of the present disclosure, computer program code for carrying out operations of the present disclosure can be written in one or more programming languages or combinations of languages including object oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on a computer, partly on the computer, as a stand-alone software package, partly on the computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0103] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations 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 flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can 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
[0104] The units described in the embodiments of the present disclosure can be implemented by software or by hardware. In some cases, the names of the units do not constitute a limitation on the units themselves.
[0105] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, non-limiting examples of exemplary types of hardware logic components that can be used include field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SOCs), complex programmable logic devices (CPLDs), etc.
[0106] In the context of the present disclosure, a computer-readable medium can be a 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 medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the computer-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0107] The above description is merely exemplary of the present disclosure and the application of the principles thereof. It is not intended to limit the disclosed concepts to the precise forms disclosed. Rather, it is intended to cover such departures from the present disclosure as come within the scope of the appended claims and their equivalents. For example, the features described above can be combined with other features disclosed in the present disclosure (but not limited to) to form other technical solutions.
[0108] Moreover, while operations can be depicted in a particular, sequential order, this should not be understood as requiring or implying that such operations be performed in the order illustrated, or in sequential order, or that all illustrated operations be performed, to implement exemplary embodiments. In certain circumstances, multitasking and parallel processing can be advantageous. Likewise, while a number of specific implementation details have been set forth, these should not be construed as limiting the scope of the disclosure, but merely as describing typical implementations. Certain features described in the context of separate embodiments can be combined with each other in single embodiments. Conversely, various features described in the context of single embodiments can be separated and performed in multiple embodiments.
[0109] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims
1. A statistical method of page display time consumption in an application program, comprising: in response to a statistical starting event of a page to be counted, performing an operation of recording a time when the statistical starting event occurs as a starting statistical time; in response to a statistical ending event of the page to be counted, performing an operation of recording a time when the statistical ending event occurs as a terminating statistical time, and performing an operation of recording a page type of the page to be counted; obtaining a display time consumption of the page to be counted of each page type based on the starting statistical time and the terminating statistical time; the display time consumption is a time consumption of page loading, and is used for evaluating performance of the application program; wherein the page type of the page to be counted comprises at least one of a scene page group, a dynamic rendering page, an H5 page and a Native page, the statistical starting event and the statistical ending event corresponding to the page to be counted of each page type are pre-set, and at least one of the statistical starting event and the statistical ending event corresponding to the page to be counted of different page types is different.
2. The method of claim 1, wherein, if the page type of the page to be counted is the scene page group, the scene page group comprises at least two pages associated with a scene, the statistical starting event is pre-set as a starting operation event of the scene, and the statistical ending event is pre-set as a display completion event of a last page in the at least two pages; the operation of recording the time when the statistical starting event occurs as the starting statistical time in response to the statistical starting event of the page to be counted comprises: in response to the starting operation event, performing an operation of recording a time when the starting operation event occurs as the starting statistical time; the operation of recording the time when the statistical ending event occurs as the terminating statistical time in response to the statistical ending event of the page to be counted, and the operation of recording the page type of the page to be counted comprises: in response to the display completion event, performing an operation of recording a time when the display completion event occurs as the terminating statistical time, and performing an operation of recording that the page type of the page to be counted is the scene page group.
3. The method of claim 1, wherein, if the page type of the page to be counted is at least one of the dynamic rendering page, the H5 page and the Native page, the statistical starting event is pre-set as a page creation event; the operation of recording the time when the statistical starting event occurs as the starting statistical time in response to the statistical starting event of the page to be counted comprises: in response to the page creation event, performing an operation of recording a time when the page creation event occurs as the starting statistical time.
4. The method of claim 3, wherein, if the page type of the page to be counted is the dynamic rendering page, the statistical ending event is pre-set as a first frame callback event; the operation of recording the time when the statistical ending event occurs as the terminating statistical time in response to the statistical ending event of the page to be counted, and the operation of recording the page type of the page to be counted comprises: In response to the first frame callback event, an operation of recording a time when the first frame callback event occurs is performed as a termination time point, and an operation of recording that the page type of the page to be counted is a dynamic rendering page is performed.
5. The method of claim 3, wherein, If the page type of the page to be counted is an H5 page, the statistical termination event is set in advance as a loading end callback event or a loading progress reaching a set value; In response to the statistical termination event of the page to be counted, an operation of recording a time when the statistical termination event occurs is performed as a termination time point, and an operation of recording the page type of the page to be counted includes: In response to the loading end callback event or the loading progress reaching the set value, an operation of recording a time when the loading end callback event or the loading progress reaches the set value occurs is performed as a termination time point, and an operation of recording that the page type of the page to be counted is an H5 page is performed.
6. The method of claim 3, wherein, If the page type of the page to be counted is a Native page, the statistical termination event is set in advance as receiving a first page interaction operation message; In response to the statistical termination event of the page to be counted, an operation of recording a time when the statistical termination event occurs is performed as a termination time point, and an operation of recording the page type of the page to be counted includes: In response to receiving the first page interaction operation message, an operation of recording a time when the first page interaction operation message is received occurs is performed as a termination time point, and an operation of recording that the page type of the page to be counted is a Native page is performed.
7. The method of claim 1, wherein, The operation of obtaining the display time consumption of the page to be counted of each page type based on the starting time point and the termination time point includes: In response to a page stop event of the page to be counted, the operation of obtaining the display time consumption of the page to be counted of each page type based on the starting time point and the termination time point is performed.
8. A device for counting page display time consumption in an application program, comprising: a first recording module configured to, in response to a statistical starting event of a page to be counted, perform an operation of recording a time when the statistical starting event occurs as a starting time point; a second recording module configured to, in response to a statistical termination event of the page to be counted, perform an operation of recording a time when the statistical termination event occurs as a termination time point, and perform an operation of recording a page type of the page to be counted; an obtaining module configured to obtain display time consumption of the page to be counted of each page type based on the starting time point and the termination time point; The display time consumption is the time consumption of page loading, which is used to evaluate the performance of the application program. The page type of the page to be counted includes at least one of a scene page group, a dynamic rendering page, an H5 page, and a Native page, the statistical starting event and the statistical termination event corresponding to the page to be counted of each page type are set in advance, and at least one of the statistical starting event and the statistical termination event corresponding to the page to be counted of different page types is different.
9. An electronic device comprising: a memory and a processor, the memory is configured to store instructions executable by the processor; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the method for statistics of page display time consumption in an application program according to any one of claims 1 to 7.
10. A computer program product for implementing the method for statistics of page display time consumption in an application program according to any one of claims 1 to 7.
Citation Information
Patent Citations
An H5 page performance test method and device in an application program and a computer device
CN109766256A
Method and device for acquiring webpage lagging data, terminal and storage medium
CN113067752A
Website page data acquisition and statistical method, storage medium and equipment
CN113761443A
Application running state monitoring method and device, terminal and storage medium
CN114816987A