Information collection method, device and equipment

By detecting the target method of the target class in the target application, obtain the display status of the child page and match the display information, solve the problem of inaccurate collection of the change of the sub -page hierarchical relationship, improve the efficiency of multi -level page information collection and accuracy.

CN114637680BActive Publication Date: 2025-01-28MASHANG CONSUMER FINANCE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210284225.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-22
Publication Date
2025-01-28
Estimated Expiration
2042-03-22

AI Technical Summary

Technical Problem

During the application operation, due to the changes in the hierarchical relationship of the subpages, it is impossible to collect the display information of multi-level pages in a timely and accurate manner, which affects the optimization and maintenance of the application.

Method used

Call the target method corresponding to the target class in the target application, obtain the display status of the child page, and match the state of the target method, obtain the display information of the subpage, so as to determine the level page display information corresponding to the hierarchical structure of the page Essence

Benefits of technology

This method can avoid inaccurate collection due to changes in the sub -page hierarchical relationship, improve the efficiency and accuracy of multi -level page information collection, and meet the needs of fast iterative business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114637680B_ABST
    Figure CN114637680B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose an information collection method, device and equipment, the method comprising: if it is detected that the target method corresponding to the target class in the page of the target application is called, then the display state of the sub-page corresponding to the target class is obtained, and the target method is used to display or hide the sub-page corresponding to the target class; if the display state of the sub-page corresponding to the target class matches the state corresponding to the target method, then the display information of the sub-page corresponding to the target class is obtained; based on the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page is determined. Through the above method, the collection efficiency and accuracy of the display information of multi-level pages can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of computer technology, and in particular to an information collection method, device and equipment. Background Art

[0002] With the rapid development of computer technology, the services that applications can provide to users are becoming more and more diverse. Therefore, the application page may contain multiple levels of sub-pages. To improve the user experience, the application can be optimized and improved by collecting the display information of each sub-page in the page.

[0003] Typically, developers can collect information for sub-pages of a specific level in a specific page based on collection requirements. For example, developers can design information collection code for the third-level sub-page of the first page in an application based on collection requirements, and collect display information of the sub-page based on the collection code while the application is running.

[0004] However, since sub-pages may be added or deleted, the hierarchical relationship of the sub-pages may change. During the testing phase, since only functional requirements are tested, it is difficult to detect changes in the hierarchical information of the sub-pages. Therefore, during the operation of the application, the display information of the hierarchical pages may not be collected in a timely and accurate manner due to changes in the hierarchical relationship of the sub-pages. Based on this, it is necessary to provide a technical solution to improve the collection efficiency and accuracy of the display information of multi-level pages. Summary of the invention

[0005] The purpose of the embodiments of this specification is to provide a technical solution for improving the collection efficiency and accuracy of display information for multi-level pages.

[0006] In order to implement the above technical solution, the embodiments of this specification are implemented as follows:

[0007] An information collection method provided in an embodiment of the present specification includes:

[0008] If it is detected that a target method corresponding to a target class in a page of a target application is called, the display status of a sub-page corresponding to the target class is obtained, and the target method is used to display or hide the sub-page corresponding to the target class;

[0009] If the display state of the subpage corresponding to the target class matches the state corresponding to the target method, then obtaining display information of the subpage corresponding to the target class;

[0010] Based on the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page is determined.

[0011] An information collection device provided in an embodiment of the present specification includes:

[0012] A state acquisition module is configured to acquire the display state of the sub-page corresponding to the target class if it is detected that the target method corresponding to the target class in the page of the target application is called, wherein the target method is used to display or hide the sub-page corresponding to the target class;

[0013] an information acquisition module, configured to acquire display information of the subpage corresponding to the target class if the display state of the subpage corresponding to the target class matches the state corresponding to the target method;

[0014] The information determination module is configured to determine the hierarchical page display information corresponding to the hierarchical structure of the page based on the display information of the sub-page corresponding to the target class.

[0015] An information collection device provided in an embodiment of the present specification includes:

[0016] Processor; and

[0017] a memory arranged to store computer executable instructions which, when executed, cause the processor to:

[0018] If it is detected that a target method corresponding to a target class in a page of a target application is called, the display status of a sub-page corresponding to the target class is obtained, and the target method is used to display or hide the sub-page corresponding to the target class;

[0019] If the display state of the subpage corresponding to the target class matches the state corresponding to the target method, then obtaining display information of the subpage corresponding to the target class;

[0020] Based on the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page is determined.

[0021] The above-mentioned technical scheme provided in this specification determines the display information of the sub-page through the actual display status of the sub-page corresponding to the target class (that is, whether the display status of the sub-page matches the status corresponding to the target method). This can avoid the situation where, when obtaining the display information of the sub-page through the hierarchical relationship of the sub-page in the page, the hierarchical relationship of the sub-page in the page is changed due to the deletion or addition of a sub-page, making it impossible to collect the display information of the sub-page in a timely and accurate manner. During the operation of the target application, the display information corresponding to the sub-pages of each level can be collected in a timely and accurate manner, that is, the information collection efficiency and accuracy for multi-level pages can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0023] Figure 1 This is an example of an information collection method in this specification;

[0024] Figure 2 This is a schematic diagram of a multi-level page of this manual;

[0025] Figure 3 This is a schematic diagram of another multi-level page of this manual;

[0026] Figure 4 This is another information collection method embodiment of the present specification;

[0027] Figure 5 This is another information collection method embodiment of the present specification;

[0028] Figure 6 This is another information collection method embodiment of the present specification;

[0029] Figure 7 This is another information collection method embodiment of the present specification;

[0030] Figure 8 This is another information collection method embodiment of the present specification;

[0031] Fig. 9 This is another information collection method embodiment of this specification

[0032] Fig.10 This is another information collection method embodiment of the present specification;

[0033] Fig.11 A schematic diagram of the insertion process of a first method of the present specification;

[0034] Fig.12 This is a schematic diagram of a process of obtaining information displayed on a hierarchical page in this manual;

[0035] Fig.13 This is an example of an information collection device in this specification;

[0036] Fig.14 This is an example of an information collection device in this specification. DETAILED DESCRIPTION

[0037] The embodiments of this specification provide an information collection method, device and equipment.

[0038] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0039] The inventive concept of the present application is as follows: developers can collect information for sub-pages of a specific level in a specific page according to collection requirements. For example, developers can design information collection code for the third-level sub-page of the first page in an application according to collection requirements, and collect display information of the sub-page based on the collection code during the operation of the application.

[0040] However, since subpages may be added or deleted, the hierarchical relationship of subpages may change. In the testing phase, since only functional requirements are tested, it is difficult to detect changes in the hierarchical information of subpages in the testing phase. Therefore, during the operation of the application, there may be a situation where the display information of multi-level pages cannot be collected in a timely and accurate manner due to changes in the hierarchical relationship of subpages. For example, assuming that page 1 contains subpage 1, and subpage 1 contains subpage 2, that is, the page level of subpage 2 is 3, the corresponding collection code can be designed to collect the display information of the subpages of the third layer. However, if subpage 1 is deleted, then the level of subpage 2 is changed to level 2. If a subpage 3 is added between subpage 1 and subpage 2, then the level of subpage 2 is changed to level 4. In the testing phase, since the product staff only tests the functional requirements of each subpage in each page, it is difficult to detect changes in the hierarchical information of subpage 2 in a timely manner, and the collection code corresponding to subpage 2 is still used to collect the display information of the subpages of the third layer. Obviously, the display information of subpage 2 cannot be collected based on the collection code during the running of the application. In addition, due to the abnormality of the collected information, on the one hand, a large amount of manpower is required to detect and modify the problem, and on the other hand, it will also affect the normal development cycle of the application, resulting in a long repair cycle of the application and high management and maintenance costs in the later stage, which cannot meet the needs of fast iteration business scenarios. Based on this, it is necessary to provide a technical solution to improve the collection efficiency and accuracy of display information for multi-level pages.

[0041] In the present technical scheme, the display information of the sub-page is determined by the actual display status of the sub-page corresponding to the target class (that is, whether the display status of the sub-page matches the status corresponding to the target method). This can avoid the situation where, when obtaining the display information of the sub-page through the hierarchical relationship of the sub-page in the page, the hierarchical relationship of the sub-page in the page is changed due to the deletion or addition of a sub-page, making it impossible to collect the display information of the sub-page in a timely and accurate manner. During the operation of the target application, the display information corresponding to the sub-pages of each level can be collected in a timely and accurate manner, that is, the information collection efficiency and accuracy for multi-level pages can be improved, and the business scenario requirements of rapid iteration of applications can be met.

[0042] like Figure 1 As shown, the embodiment of this specification provides an information collection method, the execution subject of the method can be a terminal device or a server, wherein the terminal device can be a mobile terminal device such as a mobile phone, a tablet computer, or a personal computer device, and the server can be an independent server or a server cluster composed of multiple different servers. The method can be applied to the collection and processing of the display information of the page.

[0043] The method may specifically include the following steps:

[0044] In step S102, if it is detected that a target method corresponding to a target class in a page of a target application is called, the display state of a sub-page corresponding to the target class is obtained.

[0045] Among them, the target method can be used to display or hide the sub-page corresponding to the target class, the target application can be any application that can be run on a terminal device or server, the structure of the page can include a hierarchical structure composed of multiple sub-pages, and the target class can be the class of the 2nd to nth layers nested in the class corresponding to the main page of the page. For example, the class corresponding to the main page of the page can be an Activity class, and one or more Fragement classes can be nested in the Activity class. The Fragement class can nest one or more Fragement classes. The Fragement class is the target class, and the page corresponding to the Fagement class is the sub-page of the page. The display status of the sub-page corresponding to the target class can be displayed or hidden.

[0046] In implementation, in order to improve the user experience of the application, the application can be optimized and improved by collecting the display information of each sub-page in the page. In order to improve the collection efficiency and accuracy of the display information of the multi-level pages, the embodiment of this specification provides an achievable processing method, which can specifically include the following contents:

[0047] Taking the target application as a resource transfer application as an example, when the terminal device detects that the user triggers the start of the resource transfer application, Figure 2 As shown, the initialization page of the resource transfer application can be displayed. Taking the initialization page as an example, the page contains 1 main page and 3 sub-pages. The 3 sub-pages are sub-page 1 corresponding to the "Home Page", sub-page 2 corresponding to the "Resource Transfer Service", and sub-page 3 corresponding to "My".

[0048] The terminal device displays Figure 2 When the page shown is displayed, the display method of the class corresponding to the main page and the display method of the target class corresponding to sub-page 1 (such as the onResume method) will be called, that is, when the terminal device detects that the onResume method (i.e. the target method) is called, it can obtain the display status of the sub-page 1 corresponding to the target class. For example, the getUserVisibleHint method and isHidden method of the target class can be called to determine whether the sub-page 1 corresponding to the target class is displayed.

[0049] The above method for obtaining the display status of the sub-page corresponding to the target class is an optional and feasible acquisition method. In actual application scenarios, there may be a variety of different acquisition methods, which may vary according to different actual application scenarios. The embodiments of this specification do not make specific limitations on this.

[0050] In step S104, if the display state of the sub-page corresponding to the target class matches the state corresponding to the target method, the display information of the sub-page corresponding to the target class is obtained.

[0051] Among them, the state corresponding to the target method can be display or hide. For example, if the target method is used to display the sub-page corresponding to the target class, then the state corresponding to the target method is display, and the display information of the sub-page corresponding to the target class may include the display time and display duration of the sub-page.

[0052] In implementation, if the display state of the subpage corresponding to the target class is display, and the state corresponding to the target method is also display, then the display time of the subpage corresponding to the target class can be obtained. For example, the time when the target method is called can be determined as the display time of the subpage corresponding to the target class. For example, if the time when the onResume method is called is 10:00, then the display time of the subpage corresponding to the target class is 10:00.

[0053] In step S106, based on the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page is determined.

[0054] In implementation, for example, Figure 3As shown, there may be multiple target classes, such as a target class that may also be a class corresponding to a "resource object list", etc. The display information of the sub-page corresponding to each target class may be obtained respectively through the above steps S102 to S104.

[0055] Based on the acquired display information of the sub-pages, the hierarchical page display information corresponding to the hierarchical structure of the page can be determined, and the hierarchical page display information corresponding to the hierarchical structure of the page may include: the display time of sub-page 1 of the second level (i.e., the sub-page corresponding to the "home page") is 10:01, and the display duration is 10 seconds; the display time of sub-page 2 of the second level (i.e., the sub-page corresponding to the "resource transfer service") is 10:02, and the display duration is 1 minute; the display time of sub-page 3 of the third level (i.e., the sub-page corresponding to "Service 2") is 10:02, and the display duration is 1 minute; the display time of sub-page 4 of the fourth level (i.e., the sub-page corresponding to the "transfer object list") is 10:02, and the display duration is 1 minute, etc.

[0056] In this way, even if the hierarchical information of the above subpages changes (such as subpage 1 changes from the second level to the third level), the display information of the subpages can be collected timely and accurately based on the display status and other information of the subpages corresponding to the target class.

[0057] The embodiment of the present specification provides an information collection method. During the operation of a target application, if it is detected that a target method corresponding to a target class in a page of the target application is called, the display status of a sub-page corresponding to the target class is obtained. The target method is used to display or hide the sub-page corresponding to the target class. If the display status of the sub-page corresponding to the target class matches the status corresponding to the target method, the display information of the sub-page corresponding to the target class is obtained. Based on the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page is determined. In this way, the display information of the sub-page can be determined by the actual display status of the sub-page corresponding to the target class (that is, whether the display status of the sub-page matches the status corresponding to the target method). This can avoid the situation where the hierarchical relationship of the sub-page in the page is changed due to the deletion or addition of a sub-page when the display information of the sub-page is obtained through the hierarchical relationship of the sub-page in the page, so that the display information of the sub-page cannot be collected in a timely and accurate manner. During the operation of the target application, the display information corresponding to the sub-pages of each level can be collected in a timely and accurate manner, that is, the information collection efficiency and collection accuracy for multi-level pages can be improved.

[0058] In one or more embodiments of this specification, the target method is used to hide the sub-page corresponding to the target class, and the display information may also include the display duration. Figure 4As shown, the above step S104 may specifically include the processing of the following steps S1042 to S1044.

[0059] In step S1042, if the display status of the sub-page corresponding to the target class is hidden, the hiding time of the sub-page corresponding to the target class is obtained.

[0060] In implementation, Figure 3 As shown, when the terminal device receives a trigger display for the "resource transfer service" from the user, it can hide the sub-page corresponding to the "home page" and display the sub-page corresponding to the "resource transfer service". At this time, the terminal device can call the onPause method (i.e., the target method) of the target class corresponding to the "home page" sub-page. If the display status of the sub-page is hidden, the calling time of the onPause method can be determined as the hiding time of the sub-page corresponding to the target class.

[0061] In step S1044, based on the identifier of the target class, the display time of the sub-page corresponding to the target class is obtained.

[0062] In implementation, the display time of the subpage corresponding to the target class can be obtained based on the identifier of the target class. For example, the display time of the subpage of the "home" subpage can be obtained from the memory based on the identifier of the target class corresponding to the subpage.

[0063] In one or more embodiments of this specification, Figure 4 As shown, after obtaining the display time of the sub-page corresponding to the target category, step S1046 may be further executed.

[0064] In step S1046, the display duration of the target class is determined based on the display time and the hiding time.

[0065] In implementation, the difference between the display time and the hiding time may be determined as the display duration of the target class.

[0066] In one or more embodiments of the present specification, before obtaining the display information of the sub-page corresponding to the target class, the identifier of the target class may also be determined, such as Figure 5 As shown, the process may specifically include the following steps S202 to S206.

[0067] In step S202, the nesting relationship of the target class in the class corresponding to the page is obtained.

[0068] In implementation, there may be multiple ways to name classes in an application, that is, the class names may not be unique, for example, Figure 3As shown, the name of the class corresponding to the "Service 1" sub-page at the second level may be the same as the class name corresponding to the "Service 1" sub-page at the second level. Therefore, the name of the class cannot be used to uniquely identify the class. Therefore, an identifier that can uniquely identify the class can be generated for the target class.

[0069] For example, the nested relationship of the target class can be obtained by recursive calling. Specifically, the parent class of the target class can be obtained by recursively calling the getParentFragement method of the target class to obtain the nested relationship of the target class. Figure 3 Taking the class corresponding to the "Service 2" sub-page as an example, the nested relationship of the obtained target class can be Activity-Fragement1-(Fragement2, Fragement3), where the Activity class is the class corresponding to the main page of the page, the Fragement1 class is the target class corresponding to the "Service 2" sub-page, the Fragement2 class is the class corresponding to the "Transfer Object List" sub-page, and the Fragement3 class is the class corresponding to the "Transfer Quantity" sub-page.

[0070] In step S204, based on the nested relationship, the hierarchical information of the sub-page corresponding to the target class in the hierarchical structure of the page is determined.

[0071] In implementation, the hierarchical information of the sub-page corresponding to the target class in the page can be determined based on the nested relationship. For example, based on the nested relationship obtained in the above step S202, it can be determined that the hierarchical information of the "Service 2" sub-page in the page is the second level, and the hierarchical information of the "Transfer Object List" sub-page in the page can be the third level.

[0072] In step S206, the hierarchical information of the sub-page corresponding to the target class in the page is determined as the identifier of the target class.

[0073] In addition, the obtained hierarchical information of the target class can be determined as the identifier of the target class through recursive calls. For example, the parent class of the target class can be obtained by recursively calling the getParentFragement method of the target class to determine the hierarchical information of the target class. Specifically, when a parent class exists, the number of layers of the target class is increased by 1 until the parent class object is null (that is, there is no parent class), and then the hierarchical information of the target class is determined as the identifier of the target class.

[0074] In addition, based on a preset verification algorithm, verifiable information of the target class can be generated, and the verifiable information can be used as an identifier of the target class. Specifically, a hash value corresponding to the target class can be generated based on a preset hash algorithm and the nested relationship of the target class, and the hash value can be used as an identifier of the target class.

[0075] The above-mentioned method for determining the identification of the target class is an optional and feasible determination method. In actual application scenarios, there may be a variety of different determination methods, which may vary according to different actual application scenarios. The embodiments of this specification do not make specific limitations on this.

[0076] There are many ways to determine the hierarchical page display information corresponding to the hierarchical structure of the page in the above step S106. An optional processing method is provided below, such as Figure 6 As shown, the processing may specifically include the following step S1062.

[0077] In step S1062, based on the hierarchical information of the sub-page corresponding to the target class in the hierarchical structure of the page and the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page is determined.

[0078] In implementation, adding the hierarchical information of the sub-pages corresponding to the target class in the hierarchical page display information can achieve rapid positioning of the class to improve the efficiency and accuracy of subsequent data processing.

[0079] In one or more embodiments of this specification, there are various ways to obtain the display information of the sub-page corresponding to the target class. The following is an optional processing method, such as Figure 7 As shown, the processing may specifically include the following steps S1048 to S100412.

[0080] In step S1048, the nesting relationship of the target class in the class corresponding to the page is obtained, and based on the nesting relationship, it is determined whether the first parent class of the target class exists in the class corresponding to the page.

[0081] The first parent class may be an Activity class corresponding to the main page of the page, or may be a Fragement class corresponding to the subpage of the page. The first parent class may be a direct parent class and / or an indirect parent class of the target class.

[0082] In implementation, for example, Figure 3As shown, taking the target class as the class corresponding to the "Service 2" sub-page as an example, the obtained nested relationship of the target class can be Activity-Fragement1-(Fragement2, Fragement3), wherein the Activity class is the class corresponding to the main page of the page, the Fragement1 class is the target class corresponding to the "Service 2" sub-page, the Fragement2 class is the class corresponding to the "Transfer Object List" sub-page, the Fragement3 class is the class corresponding to the "Transfer Quantity" sub-page, and the first parent class of the Fragement2 class is the Activity class and the Fragement1 class. Based on the nested relationship, it can be determined that the first parent class of the target class is the Activity class, wherein the Activity class is the indirect parent class of the Fragement2 class, and the Fragement1 class is the direct parent class of the Fragement2 class.

[0083] In step S10410, if the first parent class of the target class exists in the class corresponding to the page, the display status of the page corresponding to the first parent class of the target class is obtained.

[0084] In step S10412, if the display state of the page corresponding to the first parent class of the target class matches the state corresponding to the target method, and the display state of the sub-page corresponding to the target class matches the state corresponding to the target method, the display information of the sub-page corresponding to the target class is obtained.

[0085] In implementation, it is possible to determine whether the sub-page corresponding to the target class is displayed or hidden by the display state of the page corresponding to the first parent class of the target class and the display state of the sub-page corresponding to the target class, so as to improve the accuracy of the collection of the display information of the sub-page. For example, if the display state of the page corresponding to the first parent class of the target class is hidden, the display state of the sub-page corresponding to the target class is displayed, and the target method is used to display the sub-page corresponding to the target class, it is obvious that since the page corresponding to the first parent class of the target class is not actually displayed, the actual display state of the sub-page corresponding to the target class is hidden. Therefore, when the display state of the page corresponding to the first parent class of the target class matches the state corresponding to the target method, and the display state of the sub-page corresponding to the target class matches the state corresponding to the target method, it can be determined that the actual display state of the sub-page corresponding to the target class is displayed, and the display information of the sub-page corresponding to the target class can be obtained at this time.

[0086] In one or more embodiments of the present specification, when the display state of the subpage corresponding to the target class matches the state corresponding to the target method, the subclass of the target class may be triggered to call the target method, or the display information of the target class may be determined as the display information of the subclass of the target class. Figure 8As shown, the following steps S302 to S304 may also be performed.

[0087] In step S302, subclasses of the target class are determined based on the nested relationship.

[0088] In step S304, if the target method corresponding to the subclass of the target class is not called, the subclass of the target class is triggered to call the target method, or the display information of the target class is determined as the display information of the subclass of the target class.

[0089] In implementation, for example, Figure 3 As shown, taking the target class as the class corresponding to the "Service 2" subpage as an example, if the target method of the target class corresponding to the "Service 2" subpage is called, it is possible to detect whether the target method corresponding to the subclass of the target class is called. Specifically, if the target method is the onPause method, then when the onPause method of the target class corresponding to the "Service 2" subpage is called, it is possible to detect whether the onPause methods of the class corresponding to the "Transfer Object List" subpage and the class corresponding to the "Transfer Quantity" subpage are called.

[0090] If the target method corresponding to the subclass of the target class is not called, the subclass of the target class may be triggered to call the target method, so as to accurately determine the display information of the subclass of the target class according to the display information of the target class.

[0091] Among them, when the subclass of the target class is triggered to call the target method, the target method can be passed to the subclass of the target class by passing. For example, the getChildFragement object of the target class can be called by recursive traversal to obtain the object list corresponding to the subclass of the target class, and the target method of the target class can be passed to each subclass in the object list.

[0092] In addition, the display information of the target class can also be determined as the display information of the subclass of the target class. The display information of the first parent class of each layer of the class can be stored in the terminal device or server. When the display status of the sub-page corresponding to the target class is determined, the display status of the page corresponding to the first parent class corresponding to the target class can be obtained. The display information of the sub-page corresponding to the target class can be determined based on the display status of the sub-page corresponding to the target class and the display status of the page corresponding to the first parent class of the target class.

[0093] In one or more embodiments of this specification, there are various ways to obtain the display status of the sub-page corresponding to the target class. The following is an optional processing method, such as Fig. 9 As shown, the process may specifically include the following steps S1022 to S1024.

[0094] In step S1022, if it is detected that a target method corresponding to a target class in a page of a target application is called, a first method corresponding to the target method of the target class is acquired.

[0095] The first method may be a method inserted in the application packaging stage of the target application for obtaining the display status of the sub-page. For example, the first method may be a getUserVisibleHint method, isHidden method, or other method for obtaining the display status of a page.

[0096] In implementation, during the application packaging phase, it is possible to detect whether a target method exists in the methods of each class in the code of the target application, and when it is detected that a class has a target method, create a ClassVisitor object and insert the corresponding first method after the target method.

[0097] In step S1024, the display status of the sub-page corresponding to the target category is obtained through the first method.

[0098] In implementation, taking the target methods as onResume method, onPause method, setUserVisibleHint method and onHiddenChanged method as examples, during the application packaging stage of the target application, the class file in the target application can be detected. If the class file contains the target method, the corresponding first method can be inserted into the target method, wherein the correspondence between the target method and the first method can be as shown in Table 1.

[0099] Table 1

[0100] Target Method First method onResume method OnFragementResume method onPause Method OnFragementPause method setUserVisibleHint Method OnFragementUserVisibleHint method onHiddenChanged Method OnFragementHiddenChanged method

[0101] In one or more embodiments of the present specification, the first method may also be that the target class inherits from the base class of the target class, and the base class of the target class may be the parent class of the target class determined based on the class inheritance relationship. Before the target application is run, the first method may be inserted in the application packaging stage of the target application. Accordingly, Fig.10 As shown, the following steps S502 to S508 may also be performed.

[0102] In step S502, the class inheritance relationship of the target application is obtained.

[0103] In implementation, in order to improve the extensibility and maintainability of the code, the definition of the subclass can be based on the existing parent class through the inheritance mechanism to achieve the reuse of the parent class code. Therefore, in the application packaging stage of the target application, the class inheritance relationship in the target application can be obtained based on the code of the target application. For example, the keyword "extends" can be queried in the code of the target application. If the keyword exists, the two classes connected by the keyword can be determined as the subclass and the direct parent class. Specifically, in the code of the target application, if mylass1 extends myclass2, it can be determined that the myclass2 class is the direct parent class of the myclass1 class, and the myclass1 class is the subclass of the myclass2 class. Similarly, if mylass2 extends System, it can be determined that the System class is the direct parent class of the myclass2 class. The class inheritance relationship between the three classes can be: mylass1 class-mylass2 class-System class.

[0104] The above-mentioned method for obtaining the class inheritance relationship is an optional and feasible method for obtaining. In actual application scenarios, there may be a variety of different methods for obtaining, which may vary according to the actual application scenarios. The embodiments of this specification do not make specific limitations on this.

[0105] In step S504, based on the class inheritance relationship, it is determined whether the direct parent class of the first class is a class provided by the system.

[0106] Among them, classes can include custom classes and classes provided by the system. The classes provided by the system can include System class, Runtime class, Object class, etc. The System class provides class variables representing standard input, standard output and error output, and provides class methods for accessing environment variables and system properties, loading files and dynamic link libraries. Since the System class is a class provided by the system, objects of the System class cannot be created, but the System class can be inherited through the inheritance mechanism to call the class variables and class methods corresponding to the class.

[0107] In practice, since there are many different ways to name a class, it is impossible to determine whether the class is a base class by its name. Therefore, the class inheritance relationship can be used to determine whether the class is a base class by determining whether its direct parent class is a class provided by the system.

[0108] In step S506, if the direct parent class of the first class is a class provided by the system, the first class is determined as the base class.

[0109] In implementation, for example, based on the class inheritance relationship, it can be determined that the direct parent class of the myclass1 class is the myclass2 class, and the direct parent class of the myclass2 class is the System class, wherein the myclass1 class and the myclass1 class are custom classes, and the System class is a class provided by the system. Therefore, since the direct parent class of the myclass2 class is a class provided by the system, it can be determined that the myclass2 class is the base class.

[0110] In step S508, if the target method exists in the method corresponding to the base class, the first method is inserted after the target method of the base class.

[0111] In implementation, the first method is inserted after the target method of the base class, so that all subclasses of the base class determined based on the inheritance relationship can inherit the first method, without the need to perform method judgment and method insertion operations for each class, thereby improving data processing efficiency. As in the above step S506, if the myclass2 class is determined to be the base class, the first method can be inserted after the target method of the class, so that the subclass of the class (i.e., the myclass1 class) can inherit the first method, without the need to perform operations such as searching for the target method and inserting the first method for the myclass1 class.

[0112] In addition, the first method can be inserted during the application packaging stage of the target application to achieve imperceptible collection of the display information of the sub-page. At the same time, it can also support the collection of hierarchical page display information in third-party SDKs, reducing the probability of operational risks caused by manual insertion of collection codes.

[0113] For example, the target application is a resource transfer application, and the "Login" sub-page and other functional pages in the target application are provided by a third party. In order to collect the display information of the "Login" sub-page, the code provided by the third party can be detected, and the first method can be inserted after the target method of the base class is detected. This avoids manually searching and inserting the collection code for the display information of the sub-pages of the specified level in the code provided by the third party, which makes the operation process more complicated and easily leads to a high risk of operational errors.

[0114] The following describes the above information collection in detail through specific application scenarios, which may include: resource transfer and other scenarios, which may specifically include the following:

[0115] Take the target application as a resource transfer application as an example. Fig.11As shown, during the application packaging stage of the target application, the compiled class files can be scanned, and custom bytecodes (i.e., codes corresponding to the first method) can be inserted into the target methods of the base class, thus eliminating the development work of developers after accessing the SDK and achieving the purpose of no perception to developers.

[0116] Taking the implementation of code insertion through the Transform in the Android Gradle plug-in as an example, you can reference the custom plug-in in the configuration file of the Android project, register the custom Transform in the plug-in, implement the transform method, and traverse the input class file. Use the ASM tool (a general Java bytecode operation and analysis framework that can be used to modify existing classes or dynamically generate classes in binary form) to modify the bytecode, insert the specified code and save it. Android Gradle will pass the file saved by the custom Transform to the next Transform to continue executing the packaging logic. The specific steps are as follows:

[0117] 1. Customize Transform and implement the transform method.

[0118] 2. In the transform method, traverse the inputs parameters to get the compressed file.

[0119] 3. Traverse the compressed file. If the element exists, execute step 4, otherwise execute step 9. The element can be a class file, a resource file (such as an image file, a configuration file, an XML file, etc.), etc.

[0120] 4. Determine whether the current element is a class file. If so, execute step 5. If not, directly write the source file to the output path and execute step 3 to continue to determine the next element.

[0121] 5. Create a ClassVisitor object corresponding to the file.

[0122] a) Implement the visit method and store className, superName, and interfaces in memory, where className is the name of the current class, superName is the name of the parent class of the class, and interfaces is the interface;

[0123] b) Implement the visitMethod method, and use the name and desc parameters to determine whether the target method (such as the target method for displaying or hiding subpages, such as onResume, onPause, setUserVisibleHint, and onHiddenChanged of the Fragment class) exists in the class. If yes, execute step 6; if not, execute step 5c.

[0124] c) Implement the visitEnd method, based on the class inheritance relationship, determine whether the direct parent class of the current class is a class provided by the system (that is, determine whether sperName is a class provided by the system), and whether the corresponding first method has been inserted after determining the target method. If it has been inserted, execute step 3 and continue to determine the next element. If it has not been inserted, execute step 6.

[0125] 6. Create a MethodVisitor object. Implement the visitInsn method to determine whether the opcode input parameter is the Opcodes.RETURN constant. If so, execute the visitVarInsn and visitMethodInsn methods of the MethodVisitor object to insert the call event code of the first method corresponding to the target method. The purpose is to notify the SDK that the method has been called and to record the collection information of the called object.

[0126] 7. Customize the Gradle plug-in and implement the apply method. In this method, get the AppExtension object and call registerTransform of the object to add a custom Transform.

[0127] 8. Publish the custom Gradle plug-in to the Maven repository.

[0128] 9. Add the plug-in classpath dependency in the project's build.gradle configuration file.

[0129] 10. Add the apply plugin reference to the build.gradle configuration file in the main module of the project.

[0130] 11. Execute application packaging and end.

[0131] like Fig.12As shown, during the operation of the target application, the collection of hierarchical page display information corresponding to the hierarchical structure of the page can be realized by inserting the first method. Among them, the collection of display information of the main page corresponding to the Activity class can be realized by monitoring the life cycle events, and the collection of display information of the sub-page corresponding to the Fragement class can be realized by the method in the above embodiment of this specification.

[0132] By monitoring life cycle events, the specific steps to collect the display information of the main page corresponding to the Activity class can be as follows:

[0133] 1. The target application starts and goes to step 2.

[0134] 2. Initialize the SDK, first execute the startup data supplement logic, then execute to obtain the context of the target application, obtain the Application object through the context, and then call registerActivityLifecycleCallbacks to inject the Activity page listener to listen to the onActivityResumed, onActivityPaused, onActivityCreated, and onActivityDestroyed declaration lifecycle events, and save the collected display information to the database. The collection method corresponding to each event is as follows:

[0135] a) When the listener detects that the onActivityCreated (page creation) and onActivityDestroyed (page destruction) methods are called, the corresponding event identifier can be set, and the page level of the main page can be marked as 1, and the level information and display information of the main page can be saved in the database.

[0136] b) When the listener detects that the onActivityResumed (page display) method is called, the page level of the main page is marked as 1, and the corresponding event and the collected display information are stored in the memory. The storage method can be Key:Value, where the Key can be the identifier of the current Activity class (such as the hash value corresponding to the current Activity class), and the Value can be the collected display information (such as display time).

[0137] c) When the listener detects that the onActivityPaused (page hiding) method is called, the page display information is retrieved from the memory using the identifier of the current Activity class, and the display duration of the main page is calculated based on the display time and hiding time in the display information, and the collected information (including display time, display duration, etc.) is saved in the database.

[0138] When collecting display information of the sub-page corresponding to the Fragement class, the page display information can be collected based on the pre-inserted first method when the onResume method, the onPause method, the onHiddenChanged method, and the setUserVisibleHint method are called.

[0139] For example, Figure 2 As shown, when the target application is triggered, the onResume method of the target class corresponding to the "Home" sub-page will be called. The getParentFragment in the SDK can be called based on the first method corresponding to the target method (i.e., the bytecode inserted in the application packaging phase, such as the onFragementResume method inherited from the base class) to obtain the first parent class of the target class (the parent class determined by the nested relationship). If the first parent class does not exist, step A1 is executed; if the first parent class exists, step A2 is executed. The first method can be a method inherited from the base class determined by the class inheritance relationship.

[0140] In step A1, the getUserVisibleHint and isHidden methods of the current target class are called by the first method to determine whether the subpage corresponding to the current target class is actually displayed. If it is displayed, the display time of the subpage is stored in the memory, otherwise no processing is performed.

[0141] In step A2, the getUserVisibleHint and isHidden methods of the current target class and the first parent class are called by the first method to determine whether the target class is displayed. If it is displayed, the display time of the sub-page is stored in the memory. If not, no processing is performed.

[0142] In addition, in the scenario of switching sub-pages in a page by sliding, display information can be collected by monitoring the setUserVisibleHint method. Specifically, when the setUserVisibleHint method of the target class is called, the corresponding setFragmentUserVisibleHint method (i.e., the first method) can be called to obtain the first parent class of the target class (the parent class determined by the nested relationship). If the first parent class does not exist, step B1 is executed; if the first parent class exists, step B2 is executed. The first method may be a method inherited from a base class determined by a class inheritance relationship.

[0143] In step B1, the isResumed and isHidden methods of the current target class are called by the first method to determine whether the current target class is in a ready state. If yes, steps B11 to B12 are executed; otherwise, no processing is performed.

[0144] In step B11, determine whether the parameter passed into isVisibleToUser is displayed (i.e., whether it is true). If it is displayed, store the display time of the sub-page in the memory. If it is hidden, determine the display duration of the sub-page based on the display time and hiding time of the sub-page, and save the display time and display duration in the database.

[0145] In step B12, the target method or display information of the target class is transferred to the subclass of the target class (the subclass determined based on the nested relationship).

[0146] In step B2, by calling the isHidden and isResumed methods of the target class and the getUserVisibleHint, isHidden, and isResumed methods of the first parent class of the current target class, it is determined whether the subpage corresponding to the target class is in a ready state. If so, the above steps B11 to B12 can be executed. If not, no processing is performed.

[0147] In addition, in the scenario of switching sub-pages in a page by clicking, you can collect display information by listening to the onHiddenChanged method. When the onHiddenChanged method of the target class is called, you can call the onFragmentHiddenChanged method in the SDK (that is, the first method corresponding to the onHiddenChanged method) to obtain the hidden parameter of the target class (system input parameter, Boolean type, indicating whether the sub-page corresponding to the current target class is hidden). You can first negate hidden and record it as the isVisibleToUser variable, and then call the getParentFragment method to obtain the first parent class of the target class (the parent class determined by the nested relationship) to determine whether the parent Fragment exists. If the first parent class does not exist, execute the above step B1; if the first parent class exists, execute the above step B2.

[0148] In the page hiding scenario, the display information can be collected by monitoring the onPause method. Specifically, when the onPause method of the target class is called, the first method can be used to determine whether the first parent class exists. If not, step C1 is executed; if so, step C2 is executed.

[0149] In step C1, the getUserVisibleHint and isHidden methods of the target class are called through the first method to determine whether the sub-page corresponding to the target class is hidden. If so, the display time of the sub-page corresponding to the target class is obtained according to the identifier of the target class, and then the display duration of the sub-page is calculated according to the display time and the hiding time, and the display information such as the identifier, display time, and display duration of the target class is saved in the database, and then the target method or display information is passed to the sub-class of the target class (the sub-class determined by the nested relationship). If otherwise, no processing is performed.

[0150] In step C2, the getUserVisibleHint, isHidden, and isResumed methods of the target class and the first parent class are called through the first method to determine whether the subpage corresponding to the target class is hidden. If so, the display time of the subpage corresponding to the target class is obtained according to the identifier of the target class, and then the display duration of the subpage is calculated according to the display time and the hiding time, and the display information such as the identifier, display time, and display duration of the target class is saved in the database, and then the target method or display information is passed to the subclass of the target class (the subclass determined by the nested relationship). Otherwise, no processing is performed.

[0151] The embodiment of the present specification provides an information collection method. During the operation of a target application, if it is detected that a target method corresponding to a target class in a page is called, the display status of a sub-page corresponding to the target class is obtained. The structure of the page includes a hierarchical structure composed of multiple sub-pages. The target method is used to display or hide the sub-page corresponding to the target class. If the display status of the sub-page corresponding to the target class matches the status corresponding to the target method, the display information of the sub-page corresponding to the target class is obtained. Based on the display information of the sub-page corresponding to the target class, the hierarchical page display information of the page is determined. In this way, the display information of the sub-page can be determined by the actual display status of the sub-page corresponding to the target class (that is, whether the display status of the sub-page matches the status corresponding to the target method). This can avoid the situation where the hierarchical relationship of the sub-page in the page is changed due to the deletion or addition of a sub-page when the display information of the sub-page is obtained through the hierarchical relationship of the sub-page in the page, so that the display information of the sub-page cannot be collected in time and accurately. During the operation of the target application, the display information corresponding to the sub-pages of each level can be collected in time and accurately, that is, the information collection efficiency and collection accuracy for multi-level pages can be improved.

[0152] The above is the information collection method provided in the embodiments of this specification, based on the same idea, such as Fig.13As shown, the embodiment of this specification also provides an information collection device for improving the collection efficiency and accuracy of display information for multi-level pages. The specific implementation of the device can refer to the relevant content of the information collection method. To avoid redundancy, it will not be repeated here.

[0153] Corresponding to the information collection method provided in the above embodiment, based on the same technical concept, the embodiment of this specification also provides an information collection device, which is used to execute the above information collection method. Fig.14 A schematic diagram of the hardware structure of an information collection device for implementing each embodiment of this specification is provided. Fig.14 The information collection device 140 shown includes but is not limited to: a radio frequency unit 141, a network module 142, an audio output unit 143, an input unit 144, a sensor 145, a user input unit 146, an interface unit 147, a memory 148, a processor 149, and a power supply 1410. Those skilled in the art will appreciate that Fig.14 The information collection device structure shown in the figure does not constitute a limitation on the information collection device. The information collection device may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.

[0154] The processor 149 is used to obtain the display status of the sub-page corresponding to the target class if it is detected that the target method corresponding to the target class in the page of the target application is called, and the target method is used to display or hide the sub-page corresponding to the target class;

[0155] The processor 149 is configured to obtain display information of the sub-page corresponding to the target class if the display state of the sub-page corresponding to the target class matches the state corresponding to the target method;

[0156] The processor 149 is further configured to determine the hierarchical page display information corresponding to the hierarchical structure of the page based on the display information of the sub-page corresponding to the target class.

[0157] In the embodiment of this specification, the processor 149 is further configured to:

[0158] If the display state of the sub-page corresponding to the target class is hidden, obtaining the hiding time of the sub-page corresponding to the target class;

[0159] Based on the identifier of the target class, obtaining the display time of the subpage corresponding to the target class;

[0160] Based on the display time and the hiding time, a display duration of the target class is determined.

[0161] In the embodiment of this specification, the processor 149 is further configured to:

[0162] Obtain the nesting relationship of the target class in the class corresponding to the page;

[0163] Based on the nested relationship, determining the hierarchical information of the sub-page corresponding to the target class in the hierarchical structure of the page;

[0164] The hierarchical information of the sub-page corresponding to the target class in the page is determined as the identifier of the target class.

[0165] In the embodiment of this specification, the processor 149 is further configured to:

[0166] Based on the hierarchical information of the sub-page corresponding to the target class in the hierarchical structure of the page and the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page is determined.

[0167] In the embodiment of this specification, the processor 149 is further configured to:

[0168] Obtaining a nesting relationship of the target class in the class corresponding to the page, and determining, based on the nesting relationship, whether a first parent class of the target class exists in the class corresponding to the page;

[0169] If the first parent class of the target class exists in the class corresponding to the page, obtaining the display status of the page corresponding to the first parent class of the target class;

[0170] If the display state of the page corresponding to the first parent class of the target class matches the state corresponding to the target method, and the display state of the subpage corresponding to the target class matches the state corresponding to the target method, the display information of the subpage corresponding to the target class is obtained.

[0171] In the embodiment of this specification, the processor 149 is further configured to:

[0172] Based on the nested relationship, determining a subclass of the target class;

[0173] If the target method corresponding to the subclass of the target class is not called, the subclass of the target class is triggered to call the target method, or the display information of the target class is determined as the display information of the subclass of the target class.

[0174] In the embodiment of this specification, the processor 149 is further configured to:

[0175] If it is detected that a target method corresponding to a target class in a page of the target application is called, a first method corresponding to the target method of the target class is obtained, where the first method is a method inserted in an application packaging phase of the target application for obtaining a display state of a sub-page;

[0176] Through the first method, the display status of the sub-page corresponding to the target class is obtained.

[0177] In the embodiment of this specification, the first method is that the target class is inherited from the base class of the target class, and the base class of the target class is the parent class of the target class determined based on the class inheritance relationship. The processor 149 is further configured to:

[0178] Obtaining the class inheritance relationship of the target application;

[0179] Based on the class inheritance relationship, determining whether the direct parent class of the first class is a class provided by the system;

[0180] If the direct parent class of the first class is a class provided by the system, the first class is determined as the base class;

[0181] If the target method exists in the method corresponding to the base class, the first method is inserted after the target method of the base class.

[0182] The information collection device in the embodiment of the present specification, during the operation of the target application, if it is detected that the target method corresponding to the target class in the page of the target application is called, then the display status of the sub-page corresponding to the target class is obtained, and the target method is used to display or hide the sub-page corresponding to the target class. If the display status of the sub-page corresponding to the target class matches the status corresponding to the target method, the display information of the sub-page corresponding to the target class is obtained, and the hierarchical page display information corresponding to the hierarchical structure of the page is determined based on the display information of the sub-page corresponding to the target class. In this way, the display information of the sub-page can be determined by the actual display status of the sub-page corresponding to the target class (that is, whether the display status of the sub-page matches the status corresponding to the target method). This can avoid the situation where the hierarchical relationship of the sub-page in the page is changed due to the deletion or addition of a sub-page when the display information of the sub-page is obtained through the hierarchical relationship of the sub-page in the page, so that the display information of the sub-page cannot be collected in time and accurately. During the operation of the target application, the display information corresponding to the sub-pages of each level can be collected in time and accurately, that is, the information collection efficiency and collection accuracy for multi-level pages can be improved.

[0183] It should be noted that the information collection device 140 provided in the embodiment of this specification can implement each process implemented by the information collection device in the above-mentioned information collection method embodiment, and will not be described again here to avoid repetition.

[0184] It should be understood that in the embodiments of this specification, the radio frequency unit 141 can be used to receive and send signals during the process of sending and receiving information or making calls. Specifically, after receiving the downlink data from the upstream device, it is sent to the processor 149 for processing; in addition, the uplink data is sent to the upstream device. Generally, the radio frequency unit 141 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 141 can also communicate with the network and other devices through a wireless communication system.

[0185] The information collection device provides users with wireless broadband Internet access through the network module 142, such as helping users to send and receive emails, browse web pages, and access streaming media.

[0186] The audio output unit 143 can convert audio data received by the RF unit 141 or the network module 142 or stored in the memory 149 into an audio signal and output it as sound. Moreover, the audio output unit 143 can also provide audio output related to a specific function performed by the mobile terminal 140 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 143 includes a speaker, a buzzer, a receiver, and the like.

[0187] The input unit 144 is used to receive audio or video signals. The input unit 144 may include a graphics processor (GPU) 1441 and a microphone 1442, and the graphics processor 1441 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 146. The image frame processed by the graphics processor 1441 can be stored in the memory 149 (or other storage medium) or sent via the radio frequency unit 141 or the network module 142. The microphone 1442 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 141 in the case of a telephone call mode.

[0188] The interface unit 147 is an interface for connecting an external device to the information acquisition device 140. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 147 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements in the mobile terminal 140 or may be used to transmit data between the mobile terminal 140 and an external device.

[0189] The memory 148 can be used to store software programs and various data. The memory 148 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 148 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0190] The processor 149 is the control center of the mobile terminal. It uses various interfaces and lines to connect various parts of the entire mobile terminal. By running or executing software programs and / or modules stored in the memory 148 and calling data stored in the memory 148, it executes various functions of the information collection device and processes data, thereby monitoring the information collection device as a whole. The processor 149 may include one or more processing units; preferably, the processor 149 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 149.

[0191] The information collection device 140 may also include a power supply 1410 (such as a battery) for supplying power to each component. Preferably, the power supply 1410 may be logically connected to the processor 149 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.

[0192] In addition, the information collection device 140 includes some functional modules not shown, which will not be described here.

[0193] Preferably, the embodiments of the present specification also provide an information collection device, including a processor 149, a memory 148, and a computer program stored in the memory 148 and executable on the processor 149. When the computer program is executed by the processor 149, each process of the above-mentioned information collection method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0194] Furthermore, based on the above Figures 1 to 12 In one embodiment, the present specification further provides a storage medium for storing computer executable instruction information. In a specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer executable instruction information stored in the storage medium is executed by the processor, the following process can be implemented:

[0195] If it is detected that a target method corresponding to a target class in a page of a target application is called, the display status of a sub-page corresponding to the target class is obtained, and the target method is used to display or hide the sub-page corresponding to the target class;

[0196] If the display state of the subpage corresponding to the target class matches the state corresponding to the target method, then obtaining display information of the subpage corresponding to the target class;

[0197] Based on the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page is determined.

[0198] In the embodiment of this specification, if the display state of the sub-page corresponding to the target class is hidden, the hiding time of the sub-page corresponding to the target class is obtained;

[0199] Based on the identifier of the target class, obtaining the display time of the subpage corresponding to the target class;

[0200] After obtaining the display time of the sub-page corresponding to the target class, the method further includes:

[0201] Based on the display time and the hiding time, a display duration of the target class is determined.

[0202] In the embodiment of the specification, before obtaining the display information of the sub-page corresponding to the target class, the method further includes:

[0203] Obtain the nesting relationship of the target class in the class corresponding to the page;

[0204] Based on the nested relationship, determining the hierarchical information of the sub-page corresponding to the target class in the hierarchical structure of the page;

[0205] The hierarchical information of the sub-page corresponding to the target class in the page is determined as the identifier of the target class.

[0206] In the embodiment of the present specification, the determining, based on the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page includes:

[0207] Based on the hierarchical information of the sub-page corresponding to the target class in the hierarchical structure of the page and the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page is determined.

[0208] In the embodiment of this specification, if the display state of the sub-page corresponding to the target class matches the state corresponding to the target method, obtaining the display information of the sub-page corresponding to the target class includes:

[0209] Obtaining a nesting relationship of the target class in the class corresponding to the page, and determining, based on the nesting relationship, whether a first parent class of the target class exists in the class corresponding to the page;

[0210] If the first parent class of the target class exists in the class corresponding to the page, obtaining the display status of the page corresponding to the first parent class of the target class;

[0211] If the display state of the page corresponding to the first parent class of the target class matches the state corresponding to the target method, and the display state of the subpage corresponding to the target class matches the state corresponding to the target method, the display information of the subpage corresponding to the target class is obtained.

[0212] In the embodiment of this specification, if the display state of the sub-page corresponding to the target class matches the state corresponding to the target method, after obtaining the display information of the sub-page corresponding to the target class, the method further includes:

[0213] Based on the nested relationship, determining a subclass of the target class;

[0214] If the target method corresponding to the subclass of the target class is not called, the subclass of the target class is triggered to call the target method, or the display information of the target class is determined as the display information of the subclass of the target class.

[0215] In the embodiment of the present specification, if it is detected that a target method corresponding to a target class in a page of a target application is called, obtaining a display state of a sub-page corresponding to the target class includes:

[0216] If it is detected that a target method corresponding to a target class in a page of the target application is called, a first method corresponding to the target method of the target class is obtained, where the first method is a method inserted in an application packaging phase of the target application for obtaining a display state of a sub-page;

[0217] Through the first method, the display status of the sub-page corresponding to the target class is obtained.

[0218] In the embodiment of this specification, the first method is that the target class inherits from the base class of the target class, the base class of the target class is the parent class of the target class determined based on the class inheritance relationship, and before the target application is run, the first method is inserted in the application packaging stage of the target application, including:

[0219] Obtaining the class inheritance relationship of the target application;

[0220] Based on the class inheritance relationship, determining whether the direct parent class of the first class is a class provided by the system;

[0221] If the direct parent class of the first class is a class provided by the system, the first class is determined as the base class;

[0222] If the target method exists in the method corresponding to the base class, the first method is inserted after the target method of the base class.

[0223] The embodiment of the present specification provides a storage medium. During the operation of a target application, if it is detected that a target method corresponding to a target class in a page of the target application is called, the display status of a sub-page corresponding to the target class is obtained. The target method is used to display or hide the sub-page corresponding to the target class. If the display status of the sub-page corresponding to the target class matches the status corresponding to the target method, the display information of the sub-page corresponding to the target class is obtained. Based on the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page is determined. In this way, the display information of the sub-page can be determined by the actual display status of the sub-page corresponding to the target class (that is, whether the display status of the sub-page matches the status corresponding to the target method). This can avoid the situation where the hierarchical relationship of the sub-page in the page is changed due to the deletion or addition of a sub-page when the display information of the sub-page is obtained through the hierarchical relationship of the sub-page in the page, so that the display information of the sub-page cannot be collected in a timely and accurate manner. During the operation of the target application, the display information corresponding to the sub-pages of each level can be collected in a timely and accurate manner, that is, the information collection efficiency and collection accuracy for multi-level pages can be improved.

[0224] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0225] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0226] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0227] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0228] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0229] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0230] The embodiments of this specification are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable fraud case serial and parallel device to produce a machine, so that the instructions executed by the processor of the computer or other programmable fraud case serial and parallel device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0231] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable fraud case serial and parallel device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0232] These computer program instructions may also be loaded onto a computer or other programmable device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0233] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0234] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0235] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0236] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0237] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0238] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0239] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0240] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.

Claims

1. An information collection method, the method comprising: If it is detected that a target method corresponding to a target class in a page of a target application is called, the display status of a sub-page corresponding to the target class is obtained, and the target method is used to display or hide the sub-page corresponding to the target class; If the display state of the subpage corresponding to the target class matches the state corresponding to the target method, the nesting relationship of the target class in the class corresponding to the page is obtained by recursively calling the preset method of the target class to obtain the parent class of the target class; Based on the nested relationship, determining the hierarchical information of the sub-page corresponding to the target class in the hierarchical structure of the page; Determine the hierarchical information of the sub-page corresponding to the target class in the page as the identifier of the target class, the identifier of the target class is used to obtain the display time of the sub-page corresponding to the target class, and the display time is used to determine the display information of the sub-page corresponding to the target class; Obtaining display information of the sub-page corresponding to the target class; Based on the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page is determined.

2. According to the method of claim 1, the target method is used to hide the sub-page corresponding to the target class, and the obtaining of display information of the sub-page corresponding to the target class includes: Obtaining the hiding time of the subpage corresponding to the target category; Based on the identifier of the target class, obtaining the display time of the subpage corresponding to the target class; After obtaining the display time of the sub-page corresponding to the target class, the method further includes: Based on the display time and the hiding time, a display duration of the target class is determined.

3. The method according to claim 2, wherein determining the hierarchical page display information corresponding to the hierarchical structure of the page based on the display information of the sub-page corresponding to the target class comprises: Based on the hierarchical information of the sub-page corresponding to the target class in the hierarchical structure of the page and the display information of the sub-page corresponding to the target class, the hierarchical page display information corresponding to the hierarchical structure of the page is determined.

4. The method according to claim 1, further comprising: Based on the nested relationship, determining whether there is a first parent class of the target class in the class corresponding to the page; If the first parent class of the target class exists in the class corresponding to the page, obtaining the display status of the page corresponding to the first parent class of the target class; If the display state of the page corresponding to the first parent class of the target class matches the state corresponding to the target method, and the display state of the subpage corresponding to the target class matches the state corresponding to the target method, then the display information of the subpage corresponding to the target class is obtained.

5. According to the method of claim 1, after obtaining the display information of the sub-page corresponding to the target class, the method further comprises: Based on the nested relationship, determining a subclass of the target class; If the target method corresponding to the subclass of the target class is not called, the subclass of the target class is triggered to call the target method, or the display information of the target class is determined as the display information of the subclass of the target class.

6. The method according to claim 1, wherein if it is detected that a target method corresponding to a target class in a page of a target application is called, obtaining a display status of a sub-page corresponding to the target class comprises: If it is detected that a target method corresponding to a target class in a page of the target application is called, a first method corresponding to the target method of the target class is obtained, where the first method is a method inserted in an application packaging phase of the target application for obtaining a display state of a sub-page; Through the first method, the display status of the sub-page corresponding to the target class is obtained.

7. The method according to claim 6, wherein the first method is inherited by the target class from a base class of the target class, the base class of the target class being a parent class of the target class determined based on a class inheritance relationship, and before the target application is run, the first method is inserted in the application packaging stage of the target application, comprising: Obtaining the class inheritance relationship of the target application; Based on the class inheritance relationship, determining whether the direct parent class of the first class is a class provided by the system; If the direct parent class of the first class is a class provided by the system, the first class is determined as the base class; If the target method exists in the method corresponding to the base class, the first method is inserted after the target method of the base class.

8. An information collection device, comprising: A state acquisition module is configured to acquire the display state of the sub-page corresponding to the target class if it is detected that the target method corresponding to the target class in the page of the target application is called, wherein the target method is used to display or hide the sub-page corresponding to the target class; The information acquisition module is configured to obtain the nesting relationship of the target class in the class corresponding to the page by recursively calling a preset method of the target class to obtain the parent class of the target class if the display state of the subpage corresponding to the target class matches the state corresponding to the target method; Based on the nested relationship, determining the hierarchical information of the sub-page corresponding to the target class in the hierarchical structure of the page; Determine the hierarchical information of the sub-page corresponding to the target class in the page as the identifier of the target class, the identifier of the target class is used to obtain the display time of the sub-page corresponding to the target class, and the display time is used to determine the display information of the sub-page corresponding to the target class; Obtaining display information of the sub-page corresponding to the target class; The information determination module is configured to determine the hierarchical page display information corresponding to the hierarchical structure of the page based on the display information of the sub-page corresponding to the target class.

9. An information collection device, comprising: processor; as well as A memory configured to store computer executable instructions, which, when executed, cause the processor to perform the information collection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the information collection method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Event tracking method and system for application program

    CN108536589A

  • Page track recording method and related equipment

    CN111858282A

  • Web automatic test method and device

    CN112579456A