A method, device, electronic device and storage medium for processing buried points

By using hook functions to intercept the event registration process in the application and dynamically adding buried points, the problems of high cost and invasiveness in the existing technology are solved, and efficient user behavior logging and problem positioning are achieved.

CN117873887BActive Publication Date: 2024-11-26SHUXING TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410018838.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-04
Publication Date
2024-11-26
Estimated Expiration
2044-01-04

AI Technical Summary

Technical Problem

In the prior art, buried points need to be manually added, resulting in high cost and invasiveness to the application, and it is difficult to achieve dynamic buried points, affecting the efficiency of problem positioning.

Method used

By executing the hook function in the event registration method in the target application, the parameters required for event registration are obtained and stored, and the buried point event parameters are stored in the event distribution, dynamic buried point burial is achieved, reducing labor costs and invasiveness of the application.

Benefits of technology

It realizes dynamically adding buried points without changing the application source code, reducing the labor cost of buried points and the invasiveness of the application, and improving problem positioning efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117873887B_ABST
    Figure CN117873887B_ABST
Patent Text Reader

Abstract

The present application discloses a method, device, electronic device and storage medium for processing tracking points. When executing an event registration method for a target operation event of a target control, the event registration process of the method can be intercepted by a hook function in the method, and the parameters required for event registration are obtained from the event registration method by the hook function, and stored in an event dispatch table corresponding to the target control to complete event registration. The parameters required for tracking point events corresponding to preset tracking point events are also stored in the event dispatch table for registration by the hook function. When a target operation event for the target control is detected, an event response is performed based on the parameters required for event registration in the event dispatch table. And tracking point events are processed based on the parameters required for tracking point events in the event dispatch table. Thus, dynamic tracking points are implemented during program runtime by the hook function, which reduces the labor cost of tracking points and the intrusiveness to application programs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and specifically to a method, device, electronic device and storage medium for processing buried points. Background Art

[0002] Tracking is a commonly used data collection method that can better understand the user experience of the application. In related technologies, developers can manually add tracking points during the development process to realize data collection when the program is running. However, this method requires manual tracking and will invade the application source code, which is not conducive to maintenance and iteration. Summary of the invention

[0003] The embodiments of the present application provide a method, device, electronic device and storage medium for processing buried points, which can reduce the labor cost of buried points and reduce the intrusiveness of buried points to application programs.

[0004] In a first aspect, an embodiment of the present application provides a method for processing buried points, including:

[0005] In the target application, executing an event registration method of a target operation event of a target control, wherein the event registration method is provided with a preset hook function, and the event registration method further includes at least one parameter required for event registration;

[0006] Intercepting the event registration process of the event registration method through the hook function;

[0007] The parameters required for the event registration are obtained from the event registration method through the hook function, and stored in the event dispatch table corresponding to the target control to complete the event registration, and the parameters required for the embedded point event corresponding to the preset embedded point event are also stored in the event dispatch table to complete the embedded point event registration through the hook function, wherein the parameters required for the embedded point event have the same parameter structure as the parameters required for the response event;

[0008] When the target operation event for the target control is detected, an event response is performed based on the parameters required for event registration in the event dispatch table; and a point-of-entry event is processed based on the parameters required for the point-of-entry event in the event dispatch table to generate a control operation log record.

[0009] In a second aspect, the embodiment of the present application further provides a buried point processing device, including:

[0010] A method execution unit, used for executing an event registration method of a target operation event of a target control in a target application, wherein a preset hook function is set in the event registration method, and the event registration method also includes at least one parameter required for event registration;

[0011] An interception unit, used for intercepting the event registration process of the event registration method through the hook function;

[0012] A registration unit, used for obtaining the parameters required for event registration from the event registration method through the hook function, storing them in the event dispatch table corresponding to the target control to complete event registration, and storing the parameters required for the embedded point event corresponding to the preset embedded point event in the event dispatch table to complete embedded point event registration through the hook function, wherein the parameters required for the embedded point event have the same parameter structure as the parameters required for the response event;

[0013] A response unit is used to respond to the event based on the parameters required for event registration in the event dispatch table when the target operation event for the target control is detected; and to process the embedded event based on the parameters required for the embedded event in the event dispatch table, and generate a control operation log record.

[0014] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes any one of the methods provided in the embodiments of the present application.

[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute any one of the methods provided in the embodiments of the present application.

[0016] In the fifth aspect, the embodiments of the present application also provide a computer program product or a computer program, which includes computer instructions, which are stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the methods provided in the various optional implementations of the above embodiments.

[0017] By adopting the method of the embodiment of the present application, when executing the event registration method of the target operation event of the target control, the event registration process of the event registration method can be intercepted through the hook function in the event registration method, and the event registration method also includes at least one parameter required for event registration; the required parameters for event registration are obtained from the event registration method through the hook function, and stored in the event dispatch table corresponding to the target control to complete the event registration, and the required parameters for the burying event corresponding to the preset burying event are also stored in the event dispatch table through the hook function to complete the burying event registration, wherein the parameter structure of the required parameters for the burying event is the same as that of the required parameters for the response event; when a target operation event for the target control is detected, an event response is performed based on the required parameters for event registration in the event dispatch table; and the burying event is processed based on the required parameters for the burying event in the event dispatch table, thereby realizing dynamic burying during program runtime through the hook function, reducing the labor cost of burying and the intrusiveness to the application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 It is a schematic diagram of a flow chart of an embodiment of a method for processing buried points provided in an embodiment of the present application;

[0020] Figure 2 This is a schematic diagram of the principle of the point embedding provided by the embodiment of the present application;

[0021] Figure 3 This is a schematic diagram of an event registration method provided by an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of event distribution provided by an embodiment of the present application;

[0023] Figure 5 is a schematic diagram of another event registration method provided in an embodiment of the present application;

[0024] Figure 6 It is a schematic diagram of the page structure provided by the embodiment of the present application;

[0025] Figure 7 It is a structural schematic diagram of a buried point processing device provided in an embodiment of the present application;

[0026] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0027] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0028] Before explaining the embodiments of the present application in detail, some terms involved in the embodiments of the present application are first explained.

[0029] Among them, in the description of the embodiments of the present application, the terms "first", "second", etc. may be used in this article to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0030] The embodiments of the present application provide a method, device, electronic device and computer-readable storage medium for processing buried points. Specifically, the method for processing buried points in the embodiments of the present application can be executed by an electronic device, wherein the electronic device can be a terminal or a server. The terminal can be a terminal device such as a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA), etc., and the terminal can also include a client.

[0031] The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), as well as big data and artificial intelligence platforms.

[0032] For example, the electronic device is explained by taking a terminal as an example, and the terminal can execute an event registration method for a target operation event of a target control, wherein a preset hook function is set in the event registration method, and the event registration method also includes at least one parameter required for event registration; the event registration process of the event registration method is intercepted by the hook function; the parameters required for event registration are obtained from the event registration method by the hook function, and stored in the event dispatch table corresponding to the target control to complete the event registration, and the required parameters for the embedded point event corresponding to the preset embedded point event are also stored in the event dispatch table to complete the embedded point event registration by the hook function, wherein the parameter structure of the required parameters for the embedded point event is the same as that of the required parameters for the response event; when the target operation event for the target control is detected, an event response is performed based on the required parameters for event registration in the event dispatch table; and embedded point event processing is performed based on the required parameters for the embedded point event in the event dispatch table.

[0033] Based on the above problems, the embodiments of the present application provide a method, device, electronic device and computer-readable storage medium for processing buried points, which can reduce the labor cost of buried points.

[0034] The following is a detailed description of the embodiments in conjunction with the accompanying drawings. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments. Although the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings.

[0035] In this embodiment, a terminal is taken as an example for explanation. This embodiment provides a method for processing buried points, such as Figure 1 As shown, the specific process of the buried point processing method can be as follows:

[0036] Step 101: In a target application, an event registration method for a target operation event of a target control is executed, wherein the event registration method is provided with a preset hook function, and the event registration method also includes at least one parameter required for event registration;

[0037] The type and function of the target application in this application are not limited. It is understandable that after the target application is released, its user volume, daily activity and other data will generally increase over time, and the stability pressure faced by the client will become increasingly prominent; at this time, a systematic stability solution suitable for clients with very mature business architecture is needed, and it is best that the solution includes the development stage and the production stage. For the production stage, the most basic requirement is to be able to quickly locate and recover online problems; sufficiently detailed logs are one of the necessary conditions for quickly locating problems.

[0038] During the research and development, when tackling stability issues, the inventors found that it was difficult to determine the user's operation path at the time by only referring to the Crash stack and business tracking points, and it was impossible to narrow the scope of the problem when troubleshooting. At this time, it is very urgent to use some user behavior link logs as a reference to improve the efficiency of problem location.

[0039] When using an application, the following types of user operations are often included: opening the App (process start), killing the App (process disappearance), the App entering the foreground and background (process running and suspension), clicking a page (page display), closing the page (page disappearance), clicking a button or area (control click). Therefore, from the perspective of client technology, optionally, the complete user behavior chain includes user behavior records from the start to the disappearance of the App process. Optionally, the log of the user behavior chain can be obtained by capturing the App life cycle (the concept of the App life cycle can refer to the concept of the IOS life cycle), the page life cycle (the process from opening to closing a page), and the control click events in the page.

[0040] In this example, the system of the terminal where the target application is located is not limited, for example, it can be an IOS system.

[0041] It can be understood that the target control in this example includes controls with specific shapes displayed on the page (ie, visible controls) and may also include non-visual controls, and this example has no limitation on this.

[0042] In one example, when an application runs a process, the process life cycle from when the process starts to when it ends can be considered as a process life cycle.

[0043] In this example, the behavior at the App level during the life cycle can be captured. Optionally, this example may include: during the process life cycle of the target application, calling the life cycle proxy method of the application according to the received user operation to control the process to switch the life cycle state; and generating the process operation log record of the application based on the user operation through the life cycle proxy method.

[0044] Optionally, the life cycle states in this example include, but are not limited to, process startup, process death, process running, and process suspension.

[0045] Optionally, the information required in the process operation log record can be set according to actual conditions. This example has no restrictions on this and can include relevant information of user operations, such as operation behaviors (including but not limited to starting processes, killing processes, process running and hanging), as well as time information of operation behaviors, program identification information of the target application, etc.

[0046] For example, a log output function can be set in the lifecycle proxy method inside the AppDelegate (proxy object) of the target application to output logs. During a single lifecycle of the App running process, AppDelegate (proxy object) acts as the transaction proxy of the App, and logs are written in the lifecycle proxy method inside the AppDelegate object to record App-level startup, killing, and foreground and background switching behaviors. In an optional example, it is not necessary to leverage the dynamic characteristics of Objective-C to implement it. Alternatively, in an optional example, the log output function can be mounted in the lifecycle proxy method in the form of a hook function. When the lifecycle proxy method is triggered to control the process switching lifecycle state, the hook function is called to output the corresponding process operation log record.

[0047] It is understandable that in an application, various controls have the greatest demand for tracking. In this example, in order to reduce the intrusiveness of the control's tracking data acquisition to the code, dynamic tracking is implemented based on the dynamic characteristics of Objective-C.

[0048] Step 102: intercepting the event registration process of the event registration method through the hook function;

[0049] Optionally, the hook function may be located at the entry of the event registration method. When the event registration method is called and executed, the hook function is jumped to run and the continued execution of the event registration method is suspended, thereby intercepting the event registration process of the event registration method.

[0050] Step 103: Obtain the parameters required for event registration from the event registration method through the hook function, store them in the event dispatch table corresponding to the target control to complete event registration, and store the parameters required for the embedded point event corresponding to the preset embedded point event in the event dispatch table through the hook function to complete the embedded point event registration, wherein the parameters required for the embedded point event have the same parameter structure as the parameters required for the response event;

[0051] Optionally, the purpose of step 103 is to proxy the event registration process of the target control through the hook function, so as to dynamically add the tracking time registration required by the business when implementing the original event registration of the target control, thereby realizing dynamic tracking.

[0052] In this example, the number and type of parameters required for the tracking event obtained by the hook function before registering the tracking event match the number and type of parameters required for event registration. After the parameters required for the tracking event and the parameters required for event registration are stored in the event dispatch table corresponding to the same target control, when the target control is triggered, the event dispatch table will be used to trigger the response to the target operation event, and the response record of the triggered tracking event will be used to record the control operation log of the target control, thereby realizing dynamic tracking of controls and generating log data.

[0053] It is understandable that for different target controls or different operation events, the event registration methods used may be different, and the number and types of parameters required for event registration in the event dispatch table may also be different.

[0054] Step 104: When the target operation event for the target control is detected, an event response is performed based on the parameters required for event registration in the event dispatch table; and a point-of-entry event is processed based on the parameters required for the point-of-entry event in the event dispatch table to generate a control operation log record.

[0055] Optionally, the type of the target operation event of the present application is not limited, and may be a control operation event for a control, wherein the control operation includes but is not limited to click, double-click, long press, and knuckle tapping operations, etc.

[0056] According to the above analysis, in this application, under the App level, events of page display and disappearance will be tracked to obtain logs. Optionally, this capture can also be achieved through the dynamic language characteristics of OC (Objective-C). Optionally, the method of the present application may also include: calling the page state control method corresponding to the page life cycle to perform page state control processing, wherein the types of the page state control method include page display method and page display cancellation method, and a page hook function is set in the page state control method; through the page hook function set in the page state control method, a page operation log record is generated.

[0057] Optionally, the page operation log record may include relevant information of the page, including but not limited to page identification information, operation behavior on the page (page display and page disappearance), etc.

[0058] Optionally, in one example, the page state control method may include a page display viewDidAppear method and a page disappearance method viewWillDisappear. In this example, a hook may be performed for the page display method viewDidAppear and the page disappearance method viewWillDisappear of the UIViewController (i.e., the UI view controller). Figure 2UIViewControllerHooker) captures the display information of the page and the behavior of the page disappearing. It can be understood that the page state control method for hooking can also be other methods that can represent page display and page disappearance. This example has no limitation on this.

[0059] It is understandable that relevant information of the page (such as a unique identifier, or a combination of multiple identifiers) can be obtained to ensure the uniqueness of the page in the log. In an optional example, from the perspective of the entire link log, the location of the currently displayed page can be determined through the context log (click behavior) without obtaining the path of the page.

[0060] For ease of understanding, a further explanation is given here. When a page control (UIViewController) displays and sends a message, its two system methods (viewDidAppear and viewWillDisappear) will be called. This application hooks these two methods, so you can add the required logic to these two methods. For example, if we embed points in the display and disappearance, the page control after the hook will automatically execute our newly added embedding points or special logic when it is displayed / disappeared, so that we can get the information we need.

[0061] In an optional example, the target operation event includes a control operation event, and the parameters required for event registration include a first object parameter for indicating an object that responds to the event, a first method indication parameter for indicating a method required to respond to the event, and a first type indication parameter for indicating an event type; optionally, the first object parameter may include an object name, the first method indication parameter may include a method name, and the first type indication parameter is used to indicate which type of event to respond to, such as click, select, press, etc.

[0062] Optionally, in this example, correspondingly, the parameters required for the burying event include a second object parameter, a second method indication parameter, and a second type indication parameter, wherein the object indicated by the second object parameter is the hook function, the second method indication parameter indicates the method required for the burying, and the second type indication parameter is the same as the first type indication parameter; wherein the second object parameter may include the name of the aforementioned preset hook function, the second method indication parameter includes the method name of the method in the hook function that responds to the event, and the event type indicated by the second type indication parameter is the event type indicated by the first type indication parameter.

[0063] Optionally, the step of “processing the tracking event based on the parameters required by the tracking event in the event dispatch table and generating a control operation log record” may include:

[0064] Based on the parameters required for the embedding event in the event dispatch table, the second method indication parameter and the second type indication parameter are sent to the hook function, the embedding event is processed through the hook function, and a control operation log record is generated.

[0065] Optionally, in this example, the hook function runs the corresponding method to record the event based on the method name indicated by the second method indication parameter and the event type indicated by the second type indication parameter, and generates a control operation log record. Optionally, the information in the control operation log record includes, but is not limited to: control identification information of the target control, operation time information of the target control, operation behavior, and other information.

[0066] In another example, the target operation event includes a gesture event, and the parameters required for event registration include a third object parameter for indicating an object that responds to the event, and a third method indication parameter for indicating a method required for the event response; optionally, the third object parameter may include an object name, and the third method indication parameter may include information such as a method name. Correspondingly, in the example of a gesture event, the parameters required for the buried point event include a fourth object parameter and a fourth method indication parameter, wherein the object indicated by the fourth object parameter is the hook function, which may include the function name of the hook function, and the fourth method indication parameter indicates the method required for the buried point; it may include information such as a method name. Optionally, the step of "processing the buried point event based on the parameters required for the buried point event in the event dispatch table, and generating a control operation log record" may include: sending the fourth method indication parameter to the hook function based on the parameters required for the buried point event in the event dispatch table, processing the buried point event through the hook function, and generating a control operation log record.

[0067] Optionally, the hook function can execute the corresponding method based on the method name in the fourth method indication parameter to generate the control operation log record. Optionally, the log records of this application will be written into the log of the target application for maintenance of the target application.

[0068] This application uses IOS as an example to illustrate the logging of control operation. In iOS, UIKit provides two sets of event response mechanisms: UIControl and UIGesture. This example can hook the event registration methods of these two to capture control information for tracking. Figure 2 , Figure 2The block diagram of the tracking principle of the tracking system in this example is shown, where UserAction is the user operation and the input of the system, RedLog is the operation log and the output of the system, and the main function of RedLogManager is to define or set the specific content of the tracking. UIControlHooker, UITapGestureRecoginzerHooker, and UIViewControllerHooker are the core parts, corresponding to the hook functions of control operation events, the hook functions of gesture events, and the hook functions of page state switching, respectively.

[0069] The following is a detailed description of the UIControl event response mechanism. The UIControl event response mechanism includes: event registration and event distribution process.

[0070] First, the following explanation of event registration is given:

[0071] If a business wants UIControl to respond to a specific operation event, it needs to register using the addTarget:action:forControlEvents method provided by UIControl (that is, the event registration method mentioned above). This is a method for UIControl to add events to a specified control object. An example of this method is as follows:

[0072] [controlObj addTarget:recepientObj action@selector(actionMethod)forControlEvents:UIControlEvents];

[0073] Among them, the parameter controlObj is the control object that responds to the event (that is, an instance of UIControl); the parameter receientObj is the object that responds to the event (that is, the object that will respond to the click event of the Control, corresponding to the first object parameter above); @selector(actionMethod) indicates the method that the event needs to respond to (corresponding to the first method indicator parameter), that is, what to do specifically in the response event; the last parameter UIControlEvents (corresponding to the first type indicator parameter) is the event type, which indicates which type of control event to respond to: such as click, selection, press and other events.

[0074] When the above method is executed, the controlObj object will package and save the recepientObj, @selector (actionMethod) and the corresponding UIControlEvents into an ActionEventList (i.e. event dispatch table) maintained by itself for use when the user clicks; at this point, the event registration of a Control is completed.

[0075] Secondly, the explanation of event dispatch processing is as follows:

[0076] When the user operates a control, such as clicking on it, the corresponding Control will traverse its own ActionEventList, take out all the recipientObj in it one by one, and send the corresponding response method and event type to each recipientObj. Each object executes the specific click event processing logic. At this point, the event distribution of a Control is completed.

[0077] In this example, see Figure 3 , the main thing UIControlHooker does is to proxy the event registration process of UIControl, and inject a piece of logic into the add target:action:for control events method: intercept the three parameters brought in the original registration process, namely the target object, the response method and the event type, and save them, and then register these three parameters to the Control (that is, pack these three parameters into the event dispatch table to complete the registration, so as to ensure the normal response to the events registered by the target control in the original code), and at the same time register a point-burying logic for the current Control. When registering, three parameters will also be packed into the ActionEventList for the point-burying, namely the second object parameter, the second method indicator parameter, and the second type indicator parameter. Among them, the second object parameter is the target parameter, indicating UIControlHooker, the second method indicator parameter indicates the logic of the response event in the hook function, and the event type in the second type indicator parameter is the event type registered by the original logic (that is, the event type captured when intercepting the original registration process). Then, in addition to some response events registered in the original code, the ActionEventList of the current Control is also added with a point-burying event of its own by UIControlHooker ( Figure 3 Hooker burying event in).

[0078] The UIControl event response process after being hooked includes: when the user operates the control, in addition to distributing the original registered events, the Control will also trigger the Hooker embedding event of UIControlHooker (see Figure 3 ), and in this buried event, UIControlHooker will take out the relevant information of the original click event saved previously for log printing and recording (as shown below Figure 4 ); So far, the capture of the Control control's click behavior has been realized.

[0079] Optionally, in an example, the target control can be a gesture control, that is, a control operated by gestures. UITapGestureRecoginzer is a gesture recognizer in the App. Any UI control can be enabled to respond to gesture events such as clicks by adding a gesture recognizer. Optionally, UITapGestureRecoginzer provides the addTarget:action: method (an event registration method) for gesture event registration. When registering this event, two parameters are required. The first parameter, target, is the object that wants to respond to the event (i.e., the third object parameter above), such as a UI control. The second parameter is the specific logic to be processed in the response defined in the response object (i.e., the third method indication parameter above).

[0080] Optionally, the event registration logic is as follows:

[0081] If a business wants UITapGestureRecoginzer to respond to a specific operation event, it needs to register using the addTarget:action: method (the event registration method mentioned above) provided by UITapGestureRecoginzer. This is a way for UITapGestureRecoginzer to add events to a specified control object.

[0082] When the above method is executed, the UITapGestureRecoginzer control object will package and save the above two parameters and place them in an ActionEventList (i.e. event dispatch table) maintained by itself for use when the user clicks; at this point, the event registration of a Control is completed.

[0083] Similarly, the explanation of event dispatch is as follows:

[0084] When the user operates a control, such as clicking on it, the control object will traverse its own ActionEventList, take out all the third object parameters one by one, and send the corresponding response method to the object corresponding to each third object parameter. Each object executes the specific click event processing logic. At this point, the event distribution of a UITapGestureRecoginzer is completed.

[0085] See also Figure 5 After Hooking, the main thing UITapGestureRecoginzer Hooker does is to proxy the event registration process of UITapGestureRecoginze, and inject a piece of logic into the add target:action: method: intercept the two parameters brought in the original registration process, namely the target object and the response method, and save them, and then register these two parameters to UITapGestureRecoginzer (that is, package these two parameters into the event dispatch table to complete the registration, so as to ensure that the original code responds normally to the events registered for the target control), and at the same time register a point-burying logic for the current UITapGestureRecoginzer. When registering, two parameters will also be packaged for the point-burying event and put into the ActionEventList, namely the fourth object parameter, namely the target parameter, and the fourth method indication parameter (indicating the UITapGestureRecoginzer Hooker). Then, in addition to some response events registered in the original code, the ActionEventList of the current UITapGestureRecoginzer also has its own point-burying event added by the Hooker ( Figure 5 Hooker burying event in).

[0086] Similarly, when the user clicks on a control, UITapGestureRecoginzer not only distributes the original registered event, but also triggers the Hooker's tracking event. In this tracking event, the UITapGestureRecoginzer ooker will take out the relevant information of the original click event saved previously for log printing and recording; thus, the capture of the click behavior of the UITapGestureRecoginzer control is realized.

[0087] In the principle of obtaining control click events described above, it is explained that Hooker can capture some parameters in the original registration method call when registering events, such as Control or gestureRecoginzer object, original response object TargetObj, response method and event type ControlEvent; the purpose of capturing is to fully record the information of the current control and the context of the click behavior in the logic of the embedding point.

[0088] In this example, the tracking content includes but is not limited to: Control type: Referring to the Control or Gesture object captured above, you can use the Instance.Class method to obtain the specific class of the current control, such as UISwitch or UIButton (these are all subclasses of UIControl).

[0089] In this example, the tracking content can also include: preset feature information of the control: In one example, the preset feature information can be the title. For several subclasses of UIControl, the Title of the control can be obtained dynamically (using the current control object to dynamically call the method to obtain the title). Optionally, for gesture-operated controls, the Title can be obtained using the UIView+gesture method. In one example, for gesture-operated controls, other feature information can be used instead of obtaining the title to simplify the feature acquisition solution.

[0090] In this example, the content of the tracking point can also include: Control ActionName: As mentioned above, the Hooker of the control has saved the response method of the original control, that is, ActionName, when intercepting the original registration behavior. Here, it is directly obtained in the tracking point and written to the log.

[0091] Optionally, the steps of generating a control operation log record through a hook function may include:

[0092] The hook function obtains the control type of the target control based on the parameters required for event registration; based on the control type, obtains preset feature information and control path of the target control; based on the preset feature information, control path and the parameters required for event registration, determines the control identification information of the target control in the log; based on the control identification information, writes the control operation log record corresponding to the target operation event in the log.

[0093] Optionally, the control type includes but is not limited to a Control or Gesture object type. Based on the control type, when obtaining the preset feature information of the target control, different methods may be used to obtain the title as the preset feature information for different control types. This example has no limitation on this.

[0094] Optionally, the control path in this example can be understood as the path from the application window or view controller to the target control.

[0095] In practice, there are many controls in an App, for example, there are many Buttons. If the title of the Button is extracted and the result is called "OK", then there will be many click logs of UIButton type controls called "OK" in the log. It is impossible to distinguish which log corresponds to which Button. At this time, the click log is not unique. In order to ensure uniqueness, an optional solution in this example uses [control Path] + [control Title] + [control ActionName] as the control identification information to ensure the uniqueness of the control log.

[0096] Optionally, the step of obtaining the control path includes: taking the target control as the current control, obtaining the control name of the upper-level control of the current control and the control index of the current control in the upper-level control; taking the upper-level control as the new current control, returning to execute the step of obtaining the control name of the upper-level control of the current control and the control index of the current control in the upper-level control until the upper-level control is the window or view controller of the target application; and obtaining the control path of the target control based on the control names and control indexes of the target control and each upper-level control.

[0097] For example, take UIWindow or UIViewController as the root node of the control path, take the target control as the leaf node, take the target control as the current control, get the current control name and its viewIndex in the parent control, then set the parent control as the new current control, repeat the steps of getting the current control name and its viewIndex in the parent control until the root node is traversed, and concatenate the control name and viewIndex of each control from the leaf node to the root node in sequence. An example of the control path is as follows: Path: / / ViewController or Window class name / SuperView class name [index] / ... / Current View class name [0]:${title}|${actionName}.

[0098] For example, see Figure 6 , Figure 6 It is the main search page of a certain APP. The whole page is not a single picture, but is composed of many elements, and they are stacked up layer by layer. The UIWindow, UIViewController, and UIView in this paragraph are actually various control elements. These control elements can be stacked, spliced, and combined to build a page. Each element actually has a concept of position in the page. The control path is the information used to locate the control element.

[0099] In this example, the process operation log records, the page operation log records, and the control operation log records can be aggregated based on time information to obtain the user behavior link log of the target application during the process life cycle.

[0100] Optionally, each process lifecycle can correspond to a user behavior link log.

[0101] It can be seen that in this application, the dynamic language characteristics of OC (Objective-C) can be used to dynamically add tracking points (that is, write logs) and page information acquisition for the App life cycle, pages and controls at runtime. When an event occurs when a user operates the App, the operation behavior type and the current page / App context (App context means some business information of the current page) are recorded. This implementation method has low complexity and does not intrude on the existing App source code.

[0102] The solution in this example can realize automatic tracking. The log output by the hook function can track the App operation path of online users, which is convenient for users to report App failures. The development team can quickly understand the user's operation path and restore the reproduction path of online failures based on the log, quickly locate and fix the problem, and improve product quality and user experience. It provides technical support for the user interaction experience team to analyze and study user usage habits.

[0103] In addition, this application utilizes the language features of Objective-C to dynamically embed logs of user operations into the App, eliminating the need for developers to manually bury logs for state changes of pages and controls. The log system is non-invasive to the business of existing Apps.

[0104] Furthermore, a Path expression is used to express a page or an operation behavior, which is easy to understand.

[0105] Furthermore, the design of the tracking point system is very simple and not complicated. The use of three aspects of Hooker can realize such an automatic tracking point device. The advantage of this is that it is lightweight enough, and the user's App will not be affected by the size of the App package when integrating such a device system.

[0106] In addition, this example has strong scalability. Through the RedLogManager part, the business side can customize the content of the tracking point, and can customize which page context needs to be carried when the page display disappears or a button is clicked, so that the log information of user operations is richer.

[0107] In order to better implement the above method, the embodiment of the present application also provides a buried point processing device, which can be integrated in an electronic device, such as a computer device, which can be a terminal device, etc. Among them, the terminal can be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a personal computer, etc.

[0108] like Figure 7 As shown, the buried point processing device may include:

[0109] The method execution unit 701 is used to execute an event registration method of a target operation event of a target control in a target application, wherein a preset hook function is set in the event registration method, and the event registration method also includes at least one parameter required for event registration;

[0110] An interception unit 702, configured to intercept the event registration process of the event registration method through the hook function;

[0111] The registration unit 703 is used to obtain the parameters required for the event registration from the event registration method through the hook function, store them in the event dispatch table corresponding to the target control to complete the event registration, and store the parameters required for the embedded point event corresponding to the preset embedded point event in the event dispatch table through the hook function to complete the embedded point event registration;

[0112] The response unit 704 is used to respond to the event based on the parameters required for event registration in the event dispatch table when the target operation event for the target control is detected; and to process the embedded event based on the parameters required for the embedded event in the event dispatch table, and generate a control operation log record.

[0113] In an optional example, the target operation event includes a control operation event, and the parameters required for event registration include a first object parameter for indicating an object that responds to the event, a first method indication parameter for indicating a method required to respond to the event, and a first type indication parameter for indicating an event type;

[0114] The parameters required for the embedding event include a second object parameter, a second method indication parameter, and a second type indication parameter, wherein the object indicated by the second object parameter is the hook function, the second method indication parameter indicates the method required for the embedding, and the second type indication parameter is the same as the first type indication parameter;

[0115] A response unit is used to send the second method indication parameter and the second type indication parameter to the hook function based on the parameters required for the embedding event in the event dispatch table, perform embedding event processing through the hook function, and generate a control operation log record.

[0116] In an optional example, the target operation event includes a gesture event, and the parameters required for event registration include a third object parameter for indicating an object that responds to the event, and a third method indication parameter for indicating a required response method for the event; the parameters required for the burying event include a fourth object parameter and a fourth method indication parameter, wherein the object indicated by the fourth object parameter is the hook function, and the fourth method indication parameter indicates the required method for burying;

[0117] A response unit is used to send the fourth method indication parameter to the hook function based on the parameters required for the embedding event in the event dispatch table, perform embedding event processing through the hook function, and generate a control operation log record.

[0118] In an optional example, a response unit is used to obtain the control type of the target control based on the parameters required for event registration through the hook function; based on the control type, obtain preset feature information and control path of the target control; based on the preset feature information, control path and the parameters required for event registration, determine the control identification information of the target control in the log; based on the control identification information, write a control operation log record corresponding to the target operation event in the log.

[0119] In an optional example, a response unit is used to take the target control as the current control, obtain the control name of the upper-level control of the current control and the control index of the current control in the upper-level control; take the upper-level control as the new current control, and return to execute the step of obtaining the control name of the upper-level control of the current control and the control index of the current control in the upper-level control until the upper-level control is the window or view controller of the target application; and obtain the control path of the target control based on the control names and control indexes of the target control and each upper-level control.

[0120] In an optional example, the device also includes: a page log unit, used to call the page state control method corresponding to the page life cycle to perform page state control processing, wherein the types of the page state control method include page display method and page cancel display method, and a page hook function is set in the page state control method; through the page hook function set in the page state control method, a page operation log record is generated.

[0121] In an optional example, the device also includes: a process log unit, which is used to call the lifecycle proxy method of the application according to the received user operation during the process lifecycle of the target application to control the process to switch the lifecycle state; and generate the process operation log record of the application based on the user operation through the lifecycle proxy method; the process operation log record, the page operation log record, and the control operation log record are aggregated based on time information to obtain the user behavior link log of the target application during the process lifecycle.

[0122] Optionally, using the device of this example, when executing the event registration method of the target operation event of the target control, the event registration process of the event registration method can be intercepted through the hook function in the event registration method, and the event registration method also includes at least one parameter required for event registration; the parameters required for event registration are obtained from the event registration method through the hook function, and stored in the event dispatch table corresponding to the target control to complete the event registration, and the required parameters for the burying event corresponding to the preset burying event are also stored in the event dispatch table through the hook function to complete the burying event registration, wherein the parameter structure of the required parameters for the burying event is the same as that of the required parameters for the response event; when a target operation event for the target control is detected, an event response is performed based on the required parameters for event registration in the event dispatch table; and burying event processing is performed based on the required parameters for the burying event in the event dispatch table, thereby realizing dynamic burying during program runtime through the hook function, reducing the labor cost of burying and the intrusiveness of the burying to the application.

[0123] Accordingly, the embodiment of the present application also provides an electronic device, which may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC, Personal Computer), a personal digital assistant (Personal Digital Assistant, PDA) and other terminal devices. Figure 8 As shown, Figure 8A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 800 includes a processor 801 having one or more processing cores, a memory 802 having one or more computer-readable storage media, and a computer program stored in the memory 802 and executable on the processor. The processor 801 is electrically connected to the memory 802. Those skilled in the art will appreciate that the electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or arrange components differently.

[0124] The processor 801 is the control center of the electronic device 800. It uses various interfaces and lines to connect various parts of the entire electronic device 800, executes various functions of the electronic device 800 and processes data by running or loading software programs and / or modules stored in the memory 802, and calling data stored in the memory 802, thereby monitoring the electronic device 800 as a whole.

[0125] In the embodiment of the present application, the processor 801 in the electronic device 800 loads the computer program corresponding to the process of one or more application programs into the memory 802 according to the following steps, and the processor 801 runs the application program stored in the memory 802 to implement various functions:

[0126] In the target application, executing an event registration method of a target operation event of a target control, wherein the event registration method is provided with a preset hook function, and the event registration method further includes at least one parameter required for event registration;

[0127] Intercepting the event registration process of the event registration method through the hook function;

[0128] The parameters required for the event registration are obtained from the event registration method through the hook function, and stored in the event dispatch table corresponding to the target control to complete the event registration, and the parameters required for the embedded point event corresponding to the preset embedded point event are also stored in the event dispatch table to complete the embedded point event registration through the hook function, wherein the parameters required for the embedded point event have the same parameter structure as the parameters required for the response event;

[0129] When the target operation event for the target control is detected, an event response is performed based on the parameters required for event registration in the event dispatch table; and a point-of-entry event is processed based on the parameters required for the point-of-entry event in the event dispatch table to generate a control operation log record.

[0130] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0131] Optional, such as Figure 8 As shown, the electronic device 800 further includes: a touch screen 803, a radio frequency circuit 804, an audio circuit 805, an input unit 806, and a power supply 807. The processor 801 is electrically connected to the touch screen 803, the radio frequency circuit 804, the audio circuit 805, the input unit 806, and the power supply 807, respectively. Those skilled in the art can understand that Figure 8 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0132] The touch display screen 803 can be used to display a graphical user interface and receive operation instructions generated by the user acting on the graphical user interface. The touch display screen 803 may include a display panel and a touch panel. Among them, the display panel may be used to display information input by the user or information provided to the user and various graphical user interfaces of the electronic device, and these graphical user interfaces may be composed of graphics, text, icons, videos and any combination thereof. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD, Liquid Crystal Display), an organic light-emitting diode (OLED, Organic Light-Emitting Diode) and the like. The touch panel may be used to collect the user's touch operation on or near it (such as the user using any suitable object or attachment such as a finger, a stylus, etc. on the touch panel or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 801, and can receive the command sent by the processor 801 and execute it. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 801 to determine the type of touch event, and then the processor 801 provides a corresponding visual output on the display panel according to the type of touch event. In an embodiment of the present application, the touch panel and the display panel can be integrated into the touch display screen 803 to realize the input and output functions. However, in some embodiments, the touch panel and the touch panel can be used as two independent components to realize the input and output functions. That is, the touch display screen 803 can also be used as a part of the input unit 806 to realize the input function.

[0133] The radio frequency circuit 804 may be used to send and receive radio frequency signals, so as to establish wireless communication with a network device or other electronic devices through wireless communication, and to send and receive signals with the network device or other electronic devices.

[0134] The audio circuit 805 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 805 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 805 and converted into audio data, and then the audio data is output to the processor 801 for processing, and then sent to another electronic device through the radio frequency circuit 804, or the audio data is output to the memory 802 for further processing. The audio circuit 805 may also include an earplug jack to provide communication between an external headset and an electronic device.

[0135] The input unit 806 may be used to receive input numbers, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0136] The power supply 807 is used to supply power to various components of the electronic device 800. Optionally, the power supply 807 can be logically connected to the processor 801 through a power management system, so that the power management system can manage charging, discharging, and power consumption. The power supply 807 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0137] although Figure 8 Not shown, the electronic device 800 may also include a camera, a sensor, a wireless fidelity module, a Bluetooth module, etc., which will not be described in detail here.

[0138] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0139] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0140] To this end, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored, and the computer program can be loaded by a processor to execute any of the point-of-use processing methods provided in the embodiment of the present application. For example, the computer program can execute the following steps:

[0141] In the target application, executing an event registration method of a target operation event of a target control, wherein the event registration method is provided with a preset hook function, and the event registration method further includes at least one parameter required for event registration;

[0142] Intercepting the event registration process of the event registration method through the hook function;

[0143] The parameters required for the event registration are obtained from the event registration method through the hook function, and stored in the event dispatch table corresponding to the target control to complete the event registration, and the parameters required for the embedded point event corresponding to the preset embedded point event are also stored in the event dispatch table to complete the embedded point event registration through the hook function, wherein the parameters required for the embedded point event have the same parameter structure as the parameters required for the response event;

[0144] When the target operation event for the target control is detected, an event response is performed based on the parameters required for event registration in the event dispatch table; and a point-of-entry event is processed based on the parameters required for the point-of-entry event in the event dispatch table to generate a control operation log record.

[0145] It can be seen that the computer program can be loaded by the processor to execute any one of the tracking point processing methods provided in the embodiments of the present application, thereby bringing the following technical effects: reducing the labor cost required for tracking points.

[0146] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0147] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0148] Since the computer program stored in the computer-readable storage medium can execute any of the buried point processing methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any of the buried point processing methods provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0149] The above is a detailed introduction to a method, device, electronic device and computer-readable storage medium for processing a buried point provided in an embodiment of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for processing buried points, It is characterized in that include: In the target application, executing an event registration method of a target operation event of a target control, wherein the event registration method is provided with a preset hook function, and the event registration method further includes at least one parameter required for event registration; Intercepting the event registration process of the event registration method through the hook function; The parameters required for event registration are obtained from the event registration method through the hook function, and stored in the event dispatch table corresponding to the target control to complete event registration. The parameters required for the embedded point event corresponding to the preset embedded point event are also stored in the event dispatch table through the hook function to complete the embedded point event registration. The event dispatch table is a table for storing the parameters required for event registration corresponding to the target operation event of the target control and the parameters required for the embedded point event. For different target controls or different operation events, the event registration methods used may be different, and the number and type of parameters required for event registration in the event dispatch table may also be different; When the target operation event for the target control is detected, an event response is performed based on the parameters required for event registration in the event dispatch table; and a point-of-entry event is processed based on the parameters required for the point-of-entry event in the event dispatch table to generate a control operation log record.

2. The method according to claim 1, It is characterized in that The target operation event includes a control operation event, and the parameters required for event registration include a first object parameter for indicating an object that responds to the event, a first method indication parameter for indicating a method required to respond to the event, and a first type indication parameter for indicating an event type; The parameters required for the embedding event include a second object parameter, a second method indication parameter, and a second type indication parameter, wherein the object indicated by the second object parameter is the hook function, the second method indication parameter indicates the method required for the embedding, and the second type indication parameter is the same as the first type indication parameter; The performing the embedding event processing based on the parameters required by the embedding event in the event dispatch table and generating a control operation log record includes: Based on the parameters required for the embedding event in the event dispatch table, the second method indication parameter and the second type indication parameter are sent to the hook function, the embedding event is processed through the hook function, and a control operation log record is generated.

3. The method according to claim 1, It is characterized in that The target operation event includes a gesture event, and the parameters required for event registration include a third object parameter for indicating an object that responds to the event, and a third method indication parameter for indicating a method required for responding to the event; The parameters required for the embedding event include a fourth object parameter and a fourth method indication parameter, wherein the object indicated by the fourth object parameter is the hook function, and the fourth method indication parameter indicates the method required for the embedding event; The performing the embedding event processing based on the parameters required by the embedding event in the event dispatch table and generating a control operation log record includes: Based on the parameters required for the embedding event in the event dispatch table, the fourth method indication parameter is sent to the hook function, the embedding event is processed through the hook function, and a control operation log record is generated.

4. The method according to claim 2 or 3, It is characterized in that The steps to generate control operation log records through the hook function include: Obtaining the control type of the target control based on the parameters required for event registration through the hook function; Based on the control type, obtaining preset feature information and a control path of the target control; Based on the preset characteristic information, the control path and the parameters required for event registration, determine the control identification information of the target control in the log; A control operation log record corresponding to the target operation event is written into the log based on the control identification information.

5. The method according to claim 4, It is characterized in that The steps to obtain the control path include: Take the target control as the current control, and obtain the control name of the upper-layer control of the current control and the control index of the current control in the upper-layer control; Taking the upper control as the new current control, returning to the step of obtaining the control name of the upper control of the current control and the control index of the current control in the upper control, until the upper control is the window or view controller of the target application; Based on the control names and control indexes of the target control and each upper-level control, the control path of the target control is obtained.

6. The method according to any one of claims 1 to 3, It is characterized in that Also includes: Calling a page state control method corresponding to the page life cycle to perform page state control processing, wherein the types of the page state control method include a page display method and a page display cancellation method, and a page hook function is set in the page state control method; The page operation log record is generated through the page hook function set in the page status control method.

7. The method according to claim 6, It is characterized in that Also includes: During the process life cycle of the target application, a life cycle proxy method of the application is called according to a received user operation to control the process to switch the life cycle state; and generating a process operation log record of the application based on the user operation through the lifecycle proxy method; The process operation log record, the page operation log record, and the control operation log record are aggregated based on time information to obtain a user behavior link log of the target application within the process life cycle.

8. A buried point processing device, It is characterized in that The device comprises: A method execution unit, used for executing an event registration method of a target operation event of a target control in a target application, wherein a preset hook function is set in the event registration method, and the event registration method also includes at least one parameter required for event registration; An interception unit, used for intercepting the event registration process of the event registration method through the hook function; A registration unit, used for obtaining the parameters required for event registration from the event registration method through the hook function, storing them in the event dispatch table corresponding to the target control to complete event registration, and storing the parameters required for the embedded point event corresponding to the preset embedded point event in the event dispatch table through the hook function to complete the embedded point event registration. The event dispatch table is a table for storing the parameters required for event registration corresponding to the target operation event of the target control and the parameters required for the embedded point event. For different target controls or different operation events, the event registration methods used may be different, and the number and type of parameters required for event registration in the event dispatch table may also be different; A response unit is used to respond to the event based on the parameters required for event registration in the event dispatch table when the target operation event for the target control is detected; and to process the embedded event based on the parameters required for the embedded event in the event dispatch table, and generate a control operation log record.

9. An electronic device, It is characterized in that It comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of any one of the methods of claims 1 to 7.

10. A computer-readable storage medium, It is characterized in that It includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any method described in claims 1 to 7.